ResMed IPAP chart data not being imported correctly

This commit is contained in:
Mark Watkins 2016-03-04 13:34:05 +10:00
parent 3e5dcadccb
commit 1a77446155
3 changed files with 25 additions and 4 deletions

View File

@ -119,6 +119,14 @@ void gLineChart::SetDay(Day *d)
Session *sess = d->sessions[i];
if (!sess->enabled()) continue;
CPAPMode mode = (CPAPMode)sess->settings[CPAP_Mode].toInt();
if (mode >= MODE_BILEVEL_FIXED) {
m_enabled[CPAP_Pressure] = false;
m_enabled[CPAP_IPAP] = true;
m_enabled[CPAP_EPAP] = true;
}
if (code == CPAP_MaskPressure) {
if (sess->channelExists(CPAP_MaskPressureHi)) {
code = m_codes[j] = CPAP_MaskPressureHi;

View File

@ -1006,6 +1006,18 @@ void ResmedImport::run()
return;
}
}
CPAPMode mode = (CPAPMode)sess->settings[CPAP_Mode].toInt();
if ((mode >= MODE_BILEVEL_FIXED) && (!sess->eventlist.contains(CPAP_IPAP))) {
QVector<EventList *> & evl = sess->eventlist[CPAP_Pressure];
for (int i=0; i<evl.size(); ++i) {
EventList * el = evl[i];
sess->eventlist[CPAP_IPAP].push_back(el);
}
sess->eventlist.remove(CPAP_Pressure);
}
// Update indexes, process waveform and perform flagging
sess->UpdateSummaries();
@ -3131,6 +3143,7 @@ void ResInitModelMap()
resmed_codes[CPAP_IPAP].push_back("IPAP");
resmed_codes[CPAP_IPAP].push_back("S.BL.IPAP");
resmed_codes[CPAP_EPAP].push_back("Exp Pres");
resmed_codes[CPAP_EPAP].push_back("EprPress.2s");
resmed_codes[CPAP_EPAP].push_back("EPAP");
resmed_codes[CPAP_EPAP].push_back("S.BL.EPAP");
resmed_codes[CPAP_EPAPHi].push_back("Max EPAP");
@ -3230,7 +3243,7 @@ void ResInitModelMap()
// PLD file
resmed_codes[CPAP_MaskPressure].push_back("MaskPress.2s");
resmed_codes[CPAP_Pressure].push_back("Press.2s");
resmed_codes[CPAP_Pressure].push_back("Press.2s"); // Un problemo... IPAP also uses this.. :/
resmed_codes[CPAP_EPAP].push_back("EPRPress.2s");
resmed_codes[CPAP_Leak].push_back("Leak.2s");
resmed_codes[CPAP_RespRate].push_back("RespRate.2s");

View File

@ -240,7 +240,7 @@ void Statistics::updateRXChanges()
rx1.relief = relief;
rx1.mode = mode;
rx1.pressure = pressure;
rx1.machine = day->machine(MT_CPAP);
rx1.machine = mach;
rx1.dates[date] = day;
// Insert new entry into rx cache
@ -391,7 +391,7 @@ void Statistics::updateRXChanges()
RXItem & rx = lastri.value();
// Does it match here?
if ((rx.relief == relief) && (rx.mode == mode) && (rx.pressure == pressure) && (rx.machine == day->machine(MT_CPAP)) ) {
if ((rx.relief == relief) && (rx.mode == mode) && (rx.pressure == pressure) && (rx.machine == mach) ) {
// Update AHI/RDI
tmp = day->count(CPAP_Hypopnea) + day->count(CPAP_Obstructive) + day->count(CPAP_Apnea) + day->count(CPAP_ClearAirway);
@ -443,7 +443,7 @@ void Statistics::updateRXChanges()
rx.relief = relief;
rx.mode = mode;
rx.pressure = pressure;
rx.machine = day->machine(MT_CPAP);
rx.machine = mach;
// add this day to this rx record
rx.dates.insert(date, day);