diff --git a/oscar/Graphs/gPressureChart.cpp b/oscar/Graphs/gPressureChart.cpp index 1c4d1dd9..5bbb0f80 100644 --- a/oscar/Graphs/gPressureChart.cpp +++ b/oscar/Graphs/gPressureChart.cpp @@ -220,6 +220,18 @@ void gPressureChart::populate(Day * day, int idx) } addSlice(CPAP_IPAPHi); + } else if (mode == MODE_TRILEVEL_AUTO_VARIABLE_PDIFF) { + addSlice(CPAP_EEPAPLo); + if (!day->summaryOnly()) { + ChannelID eepap = CPAP_EEPAP; + ChannelID ipap = CPAP_IPAP; + addSlice(eepap, ST_MID); + addSlice(eepap, ST_90P); + addSlice(ipap, ST_MID); + addSlice(ipap, ST_90P); + } + addSlice(CPAP_IPAPHi); + } else if (mode == MODE_ASV) { addSlice(CPAP_EPAP); if (!day->summaryOnly()) { diff --git a/oscar/SleepLib/common.cpp b/oscar/SleepLib/common.cpp index 3dfcf763..cc68e976 100644 --- a/oscar/SleepLib/common.cpp +++ b/oscar/SleepLib/common.cpp @@ -546,6 +546,8 @@ QString STR_TR_BIPAP; // Bi-Level Positive Airway Pressure QString STR_TR_BiLevel; // Another name for BiPAP QString STR_TR_EPAP; // Expiratory Positive Airway Pressure QString STR_TR_EEPAP; // End Expiratory Positive Airway Pressure +QString STR_TR_EEPAPLo; // End-Expiratory Positive Airway Pressure, Low +QString STR_TR_EEPAPHi; // End-Expiratory Positive Airway Pressure, High QString STR_TR_EPAPLo; // Expiratory Positive Airway Pressure, Low QString STR_TR_EPAPHi; // Expiratory Positive Airway Pressure, High QString STR_TR_IPAP; // Inspiratory Positive Airway Pressure @@ -755,7 +757,9 @@ void initializeStrings() STR_TR_BIPAP = QObject::tr("BiPAP"); // Bi-Level Positive Airway Pressure STR_TR_BiLevel = QObject::tr("Bi-Level"); // Another name for BiPAP STR_TR_EPAP = QObject::tr("EPAP"); // Expiratory Positive Airway Pressure - STR_TR_EEPAP = QObject::tr("EEPAP"); // Expiratory Positive Airway Pressure + STR_TR_EEPAP = QObject::tr("EEPAP"); // End-Expiratory Positive Airway Pressure + STR_TR_EEPAPLo = QObject::tr("Min EEPAP"); // Lower End-Expiratory Positive Airway Pressure + STR_TR_EEPAPHi = QObject::tr("Max EEPAP"); // Higher End-Expiratory Positive Airway Pressure STR_TR_EPAPLo = QObject::tr("Min EPAP"); // Lower Expiratory Positive Airway Pressure STR_TR_EPAPHi = QObject::tr("Max EPAP"); // Higher Expiratory Positive Airway Pressure STR_TR_IPAP = QObject::tr("IPAP"); // Inspiratory Positive Airway Pressure diff --git a/oscar/SleepLib/common.h b/oscar/SleepLib/common.h index a3ce885b..d67ff154 100644 --- a/oscar/SleepLib/common.h +++ b/oscar/SleepLib/common.h @@ -253,6 +253,8 @@ extern QString STR_TR_BIPAP; // Bi-Level Positive Airway Pressure extern QString STR_TR_BiLevel; // Another name for BiPAP extern QString STR_TR_EPAP; // Expiratory Positive Airway Pressure extern QString STR_TR_EEPAP; // Expiratory Positive Airway Pressure +extern QString STR_TR_EEPAPLo; // End-Expiratory Positive Airway Pressure, Low +extern QString STR_TR_EEPAPHi; // End-Expiratory Positive Airway Pressure, High extern QString STR_TR_EPAPLo; // Expiratory Positive Airway Pressure, Low extern QString STR_TR_EPAPHi; // Expiratory Positive Airway Pressure, High extern QString STR_TR_IPAP; // Inspiratory Positive Airway Pressure diff --git a/oscar/SleepLib/day.cpp b/oscar/SleepLib/day.cpp index 4e92622f..be24f081 100644 --- a/oscar/SleepLib/day.cpp +++ b/oscar/SleepLib/day.cpp @@ -842,7 +842,7 @@ ChannelID Day::getPressureChannelID() { // And why would ASV or AVAPS have Pressure channels? QList preferredIDs = { CPAP_Pressure, CPAP_PressureSet, CPAP_IPAP, CPAP_IPAPSet }; if (cpapmode == MODE_ASV || cpapmode == MODE_ASV_VARIABLE_EPAP || cpapmode == MODE_AVAPS || - cpapmode == MODE_BILEVEL_FIXED || cpapmode == MODE_BILEVEL_AUTO_FIXED_PS || cpapmode == MODE_BILEVEL_AUTO_VARIABLE_PS) { + cpapmode == MODE_BILEVEL_FIXED || cpapmode == MODE_BILEVEL_AUTO_FIXED_PS || cpapmode == MODE_BILEVEL_AUTO_VARIABLE_PS || cpapmode == MODE_TRILEVEL_AUTO_VARIABLE_PDIFF) { preferredIDs = { CPAP_IPAP, CPAP_IPAPSet, CPAP_Pressure, CPAP_PressureSet }; } @@ -1495,7 +1495,9 @@ QString Day::getCPAPModeStr() // return QObject::tr("Auto Bi-Level (Fixed PS)"); // } else if (mode == MODE_BILEVEL_AUTO_VARIABLE_PS) { // return QObject::tr("Auto Bi-Level (Variable PS)"); -// } else if (mode == MODE_ASV) { +// } else if (mode == MODE_TRILEVEL_AUTO_VARIABLE_PDIFF) { +// return QObject::tr("Auto TriLevel (Variable PDIFF)"); +// } else if (mode == MODE_ASV) { // return QObject::tr("ASV Fixed EPAP"); // } else if (mode == MODE_ASV_VARIABLE_EPAP) { // return QObject::tr("ASV Variable EPAP"); @@ -1605,6 +1607,11 @@ QString Day::getPressureSettings() arg(validPressure(settings_max(CPAP_IPAPHi))). arg(validPressure(settings_min(CPAP_PSMin))). arg(validPressure(settings_max(CPAP_PSMax))).arg(units); + } else if (mode == MODE_TRILEVEL_AUTO_VARIABLE_PDIFF) { + return QObject::tr("Min EEPAP %1 Max EEPAP %2 PDIFF %3-%4 (%5)").arg(validPressure(settings_min(CPAP_EEPAPLo))). + arg(validPressure(settings_max(CPAP_EEPAPHi))). + arg(validPressure(settings_min(CPAP_PSMin))). + arg(validPressure(settings_max(CPAP_PSMax))).arg(units); } else if (mode == MODE_ASV) { return QObject::tr("EPAP %1 PS %2-%3 (%4)").arg(validPressure(settings_min(CPAP_EPAP))). arg(validPressure(settings_min(CPAP_PSMin))). diff --git a/oscar/SleepLib/loader_plugins/prisma_loader.cpp b/oscar/SleepLib/loader_plugins/prisma_loader.cpp index 8d9d1547..c97429f6 100644 --- a/oscar/SleepLib/loader_plugins/prisma_loader.cpp +++ b/oscar/SleepLib/loader_plugins/prisma_loader.cpp @@ -45,7 +45,7 @@ //******************************************************************************************** // parameters -ChannelID Prisma_Mode = 0, Prisma_SoftPAP = 0, Prisma_PSoft = 0, Prisma_PSoft_Min = 0, Prisma_AutoStart = 0, Prisma_Softstart_Time = 0, Prisma_Softstart_TimeMax = 0, Prisma_Softstart_Pressure = 0, Prisma_TubeType = 0, Prisma_PMaxOA = 0, Prisma_EEPAP_Min = 0, Prisma_EEPAP_Max = 0, Prisma_HumidifierLevel = 0; +ChannelID Prisma_Mode = 0, Prisma_SoftPAP = 0, Prisma_BiSoft = 0, Prisma_PSoft = 0, Prisma_PSoft_Min = 0, Prisma_AutoStart = 0, Prisma_Softstart_Time = 0, Prisma_Softstart_TimeMax = 0, Prisma_Softstart_Pressure = 0, Prisma_TubeType = 0, Prisma_PMaxOA = 0, Prisma_EEPAP_Min = 0, Prisma_EEPAP_Max = 0, Prisma_HumidifierLevel = 0; // waveforms ChannelID Prisma_ObstructLevel = 0, Prisma_rMVFluctuation = 0, Prisma_rRMV= 0, Prisma_PressureMeasured = 0, Prisma_FlowFull = 0, Prisma_SPRStatus = 0, Prisma_EEPAP = 0; @@ -216,29 +216,49 @@ void PrismaImport::run() bool found = true; if (parameters.contains(PRISMA_LINE_MODE)) { + + if (parameters[PRISMA_LINE_MODE] == PRISMA_MODE_AUTO_ST || + parameters[PRISMA_LINE_MODE] == PRISMA_MODE_AUTO_S) { + + if (parameters[PRISMA_LINE_EXTRA_OBSTRUCTION_PROTECTION] != 1) { + if (parameters[PRISMA_LINE_AUTO_PDIFF] == 1) { + session->settings[CPAP_Mode] = (int)MODE_BILEVEL_AUTO_VARIABLE_PS; + }else{ + session->settings[CPAP_Mode] = (int)MODE_BILEVEL_AUTO_FIXED_PS; + } + }else{ + session->settings[CPAP_Mode] = (int)MODE_TRILEVEL_AUTO_VARIABLE_PDIFF; + } + + session->settings[Prisma_BiSoft] = parameters[PRISMA_LINE_EXTRA_OBSTRUCTION_PROTECTION]; + session->settings[CPAP_EEPAPLo] = parameters[PRISMA_LINE_EEPAP_MIN] / 100.0; + session->settings[CPAP_EEPAPHi] = parameters[PRISMA_LINE_EEPAP_MAX] / 100.0; + session->settings[CPAP_EPAP] = parameters[PRISMA_LINE_EPAP] / 100.0; + session->settings[CPAP_IPAP] = parameters[PRISMA_LINE_IPAP] / 100.0; + session->settings[CPAP_IPAPHi] = parameters[PRISMA_LINE_IPAP_MAX] / 100.0; + session->settings[CPAP_PSMin] = parameters[PRISMA_LINE_PDIFF_NORM] / 100.0; + session->settings[CPAP_PSMax] = parameters[PRISMA_LINE_PDIFF_MAX] / 100.0; + session->settings[Prisma_Softstart_Pressure] = parameters[PRISMA_LINE_SOFT_START_PRESS] / 100.0; + session->settings[Prisma_Softstart_Time] = parameters[PRISMA_LINE_SOFT_START_TIME]; + session->settings[Prisma_AutoStart] = parameters[PRISMA_LINE_AUTOSTART]; + if (parameters.contains(PRISMA_SMART_TUBE_TYPE)) { + session->settings[Prisma_TubeType] = parameters[PRISMA_LINE_TUBE_TYPE] / 10.0; + } + // Indicate partial support + session->settings[Prisma_Warning] = 2; + } + switch(parameters[PRISMA_LINE_MODE]) { case PRISMA_MODE_AUTO_ST: // TODO AXT // Was not sure which mode this should be mapped, maybe we need to intorudce new modes // Setting/parameter mapping should be reviewed and tested // session->settings[CPAP_Mode] = (int)MODE_BILEVEL_AUTO_VARIABLE_PS; ??? - session->settings[Prisma_Mode] = (int)PRISMA_COMBINED_MODE_AUTO_ST; - session->settings[Prisma_EEPAP_Min] = parameters[PRISMA_LINE_EEPAP_MIN] / 100.0; - session->settings[Prisma_EEPAP_Max] = parameters[PRISMA_LINE_EEPAP_MAX] / 100.0; - session->settings[CPAP_EPAP] = parameters[PRISMA_LINE_EPAP] / 100.0; - session->settings[CPAP_IPAP] = parameters[PRISMA_LINE_IPAP] / 100.0; - session->settings[CPAP_IPAPHi] = parameters[PRISMA_LINE_IPAP_MAX] / 100.0; - session->settings[CPAP_PSMin] = parameters[PRISMA_LINE_PDIFF_NORM] / 100.0; - session->settings[CPAP_PSMax] = parameters[PRISMA_LINE_PDIFF_MAX] / 100.0; - session->settings[Prisma_Softstart_Pressure] = parameters[PRISMA_LINE_SOFT_START_PRESS] / 100.0; - session->settings[Prisma_Softstart_Time] = parameters[PRISMA_LINE_SOFT_START_TIME]; - session->settings[Prisma_AutoStart] = parameters[PRISMA_LINE_AUTOSTART]; - if (parameters.contains(PRISMA_SMART_TUBE_TYPE)) { - session->settings[Prisma_TubeType] = parameters[PRISMA_LINE_TUBE_TYPE] / 10.0; - } - // Indicate partial support - session->settings[Prisma_Warning] = 2; + break; + + case PRISMA_MODE_AUTO_S: + session->settings[Prisma_Mode] = (int)PRISMA_COMBINED_MODE_AUTO_S; break; case PRISMA_MODE_ACSV: @@ -993,6 +1013,16 @@ void PrismaLoader::initChannels() QObject::tr("TB"), STR_UNIT_Percentage, DEFAULT, QColor("purple"))); + channel.add(GRP_CPAP, chan = new Channel(Prisma_BiSoft=0xe44e, SETTING, MT_CPAP, SESSION, + "Prisma_BiSoft", + QObject::tr("BiSoft Mode"), + QObject::tr("BiSoft Mode"), + QObject::tr("BiSoft Mode"), + "", LOOKUP, Qt::green)); + chan->addOption(Prisma_BiSoft_Off, QObject::tr("Off")); + chan->addOption(Prisma_BiSoft_1, QObject::tr("BiSoft 1")); + chan->addOption(Prisma_BiSoft_2, QObject::tr("BiSoft 2")); + chan->addOption(Prisma_TriLevel, QObject::tr("TriLevel")); } diff --git a/oscar/SleepLib/loader_plugins/prisma_loader.h b/oscar/SleepLib/loader_plugins/prisma_loader.h index 2a88e77f..f32f3eaa 100644 --- a/oscar/SleepLib/loader_plugins/prisma_loader.h +++ b/oscar/SleepLib/loader_plugins/prisma_loader.h @@ -68,7 +68,9 @@ enum Prisma_Parameters { PRISMA_LINE_EPAP = 1201, // PRISMA_LINE_ALARM_LEAK_ACTIVE = 1202, // PRISMA_LINE_ALARM_DISCONNECTION_ACTIVE = 1203, - PRISMA_LINE_APAP_DYNAMIC = 1209 + PRISMA_LINE_APAP_DYNAMIC = 1209, + PRISMA_LINE_EXTRA_OBSTRUCTION_PROTECTION = 1154, // BiSoft off = 0, BiSoft1 = 2, BiSoft2 = 3, TriLevel = 1 + PRISMA_LINE_AUTO_PDIFF = 1219 }; @@ -97,6 +99,13 @@ enum Prisma_SoftPAP_Mode { Prisma_SoftPAP_STANDARD = 2 }; +enum Prisma_BiSoft_Mode { + Prisma_BiSoft_Off = 0, + Prisma_BiSoft_1 = 2, + Prisma_BiSoft_2 = 3, + Prisma_TriLevel = 1, +}; + // NOTE: This enum represents a "virtual mode" which combines the main mode of the device with the APAP submode, // if it makes sense. The reason for this is, that we can see the Standard and Dynamic APAP modes on the statistics // page. Enum values are internal to the loader. We use -1 to indicate a mode that is not recognized. diff --git a/oscar/SleepLib/machine_common.cpp b/oscar/SleepLib/machine_common.cpp index 40c0de89..7cba3535 100644 --- a/oscar/SleepLib/machine_common.cpp +++ b/oscar/SleepLib/machine_common.cpp @@ -27,7 +27,7 @@ ChannelID CPAP_IPAP, CPAP_IPAPLo, CPAP_IPAPHi, CPAP_EPAP, CPAP_EPAPLo, CPAP_EPAP CPAP_UserFlag1, CPAP_UserFlag2, CPAP_UserFlag3, /*CPAP_BrokenSummary, CPAP_BrokenWaveform,*/ CPAP_RDI, CPAP_PresReliefMode, CPAP_PresReliefLevel, CPAP_PSMin, CPAP_PSMax, CPAP_Test1, CPAP_Test2, CPAP_HumidSetting, - CPAP_PressureSet, CPAP_IPAPSet, CPAP_EPAPSet, CPAP_EEPAP; + CPAP_PressureSet, CPAP_IPAPSet, CPAP_EPAPSet, CPAP_EEPAP, CPAP_EEPAPLo, CPAP_EEPAPHi; ChannelID RMS9_E01, RMS9_E02, RMS9_SetPressure, RMS9_MaskOnTime; diff --git a/oscar/SleepLib/machine_common.h b/oscar/SleepLib/machine_common.h index f71278ed..8b704ebd 100644 --- a/oscar/SleepLib/machine_common.h +++ b/oscar/SleepLib/machine_common.h @@ -95,7 +95,7 @@ const quint32 PAP_SplitNight = 0x8000; // Split night capabilities \brief CPAP Machines mode of operation */ enum CPAPMode { //:short - MODE_UNKNOWN = 0, MODE_CPAP, MODE_APAP, MODE_BILEVEL_FIXED, MODE_BILEVEL_AUTO_FIXED_PS, MODE_BILEVEL_AUTO_VARIABLE_PS, MODE_ASV, MODE_ASV_VARIABLE_EPAP, MODE_AVAPS + MODE_UNKNOWN = 0, MODE_CPAP, MODE_APAP, MODE_BILEVEL_FIXED, MODE_BILEVEL_AUTO_FIXED_PS, MODE_BILEVEL_AUTO_VARIABLE_PS, MODE_ASV, MODE_ASV_VARIABLE_EPAP, MODE_AVAPS, MODE_TRILEVEL_AUTO_VARIABLE_PDIFF }; /*! \enum PRTypes @@ -150,7 +150,7 @@ extern ChannelID AllAhiChannels; extern QVector ahiChannels; extern ChannelID NoChannel, SESSION_ENABLED, CPAP_SummaryOnly; -extern ChannelID CPAP_IPAP, CPAP_IPAPLo, CPAP_IPAPHi, CPAP_EPAP, CPAP_EPAPLo, CPAP_EPAPHi, CPAP_EEPAP, +extern ChannelID CPAP_IPAP, CPAP_IPAPLo, CPAP_IPAPHi, CPAP_EPAP, CPAP_EPAPLo, CPAP_EPAPHi, CPAP_EEPAP, CPAP_EEPAPLo, CPAP_EEPAPHi, CPAP_Pressure, CPAP_PS, CPAP_PSMin, CPAP_PSMax, CPAP_Mode, CPAP_AHI, CPAP_PressureMin, CPAP_PressureMax, CPAP_Ramp, CPAP_RampTime, CPAP_RampPressure, CPAP_Obstructive, diff --git a/oscar/SleepLib/schema.cpp b/oscar/SleepLib/schema.cpp index e967a3d1..0c371687 100644 --- a/oscar/SleepLib/schema.cpp +++ b/oscar/SleepLib/schema.cpp @@ -139,6 +139,8 @@ void init() schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAPLo = 0x111C, WAVEFORM, MT_CPAP, SESSION, "EPAPLo", STR_TR_EPAPLo, QObject::tr("Lower Expiratory Pressure"), STR_TR_EPAPLo, STR_UNIT_CMH2O, DEFAULT, QColor("light blue"))); schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAPHi = 0x111D, WAVEFORM, MT_CPAP, SESSION, "EPAPHi", STR_TR_EPAPHi, QObject::tr("Higher Expiratory Pressure"), STR_TR_EPAPHi, STR_UNIT_CMH2O, DEFAULT, QColor("aqua"))); schema::channel.add(GRP_CPAP, new Channel(CPAP_EEPAP = 0x11A7, WAVEFORM, MT_CPAP, SESSION, "EEPAP", STR_TR_EEPAP, QObject::tr("End Expiratory Pressure"), STR_TR_EEPAP, STR_UNIT_CMH2O, DEFAULT, QColor("purple"))); + schema::channel.add(GRP_CPAP, new Channel(CPAP_EEPAPLo = 0x11A8, WAVEFORM, MT_CPAP, SESSION, "EEPAPLo", STR_TR_EEPAPLo, QObject::tr("Lower End Expiratory Pressure"), STR_TR_EEPAPLo, STR_UNIT_CMH2O, DEFAULT, QColor("orange"))); + schema::channel.add(GRP_CPAP, new Channel(CPAP_EEPAPHi = 0x11A9, WAVEFORM, MT_CPAP, SESSION, "EEPAPHi", STR_TR_EEPAPHi, QObject::tr("Higher End Expiratory Pressure"), STR_TR_EEPAPHi, STR_UNIT_CMH2O, DEFAULT, QColor("light blue"))); schema::channel.add(GRP_CPAP, new Channel(CPAP_PS = 0x110F, WAVEFORM, MT_CPAP, SESSION, "PS", STR_TR_PS, QObject::tr("Pressure Support"), STR_TR_PS, STR_UNIT_CMH2O, DEFAULT, QColor("grey"))); schema::channel.add(GRP_CPAP, new Channel(CPAP_PSMin = 0x111A, SETTING, MT_CPAP, SESSION, "PSMin", QObject::tr("PS Min") , QObject::tr("Pressure Support Minimum"), QObject::tr("PS Min"), STR_UNIT_CMH2O, DEFAULT, QColor("dark cyan"))); schema::channel.add(GRP_CPAP, new Channel(CPAP_PSMax = 0x111B, SETTING, MT_CPAP, SESSION, "PSMax", QObject::tr("PS Max"), QObject::tr("Pressure Support Maximum"), QObject::tr("PS Max"), STR_UNIT_CMH2O, DEFAULT, QColor("dark magenta"))); diff --git a/oscar/welcome.cpp b/oscar/welcome.cpp index 35fe5f8e..efd82ae0 100644 --- a/oscar/welcome.cpp +++ b/oscar/welcome.cpp @@ -247,6 +247,9 @@ QString Welcome::GenerateCPAPHTML() if (day->channelHasData(CPAP_EPAPSet)) { epapDataChanID = CPAP_EPAPSet; } + if (day->channelHasData(CPAP_EEPAP)) { + epapDataChanID = CPAP_EEPAP; + } if (pressChanID == NoChannel) { qWarning() << "Unable to find pressure channel for welcome summary!"; @@ -296,6 +299,12 @@ QString Welcome::GenerateCPAPHTML() html += tr("Your EPAP pressure was under %1 %2 for %3% of the time.").arg(epap).arg(schema::channel[epapDataChanID].units()).arg(perc)+"
"; html += tr("Your IPAP pressure was under %1 %2 for %3% of the time.").arg(ipap).arg(schema::channel[pressChanID].units()).arg(perc); + } else if (cpapmode == MODE_TRILEVEL_AUTO_VARIABLE_PDIFF){ + EventDataType ipap = day->percentile(pressChanID, perc/100.0); + EventDataType eepap = day->percentile(epapDataChanID, perc/100.0); + + html += tr("Your EEPAP pressure was under %1 %2 for %3% of the time.").arg(eepap).arg(schema::channel[epapDataChanID].units()).arg(perc)+"
"; + html += tr("Your IPAP pressure was under %1 %2 for %3% of the time.").arg(ipap).arg(schema::channel[pressChanID].units()).arg(perc); } html += "
";