mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 19:20:45 +00:00
VPAP progress.. (still more, but fixes a startup bug)
This commit is contained in:
parent
98912a3e9b
commit
c01ed2c5c0
@ -340,7 +340,7 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
|
|
||||||
if (i.key()=="PCD") { // Lookup Product Code for real model string
|
if (i.key()=="PCD") { // Lookup Product Code for real model string
|
||||||
bool ok;
|
bool ok;
|
||||||
int j=i.value().toInt();
|
int j=i.value().toInt(&ok);
|
||||||
if (ok) m->properties[STR_PROP_Model]=RMS9ModelMap[j];
|
if (ok) m->properties[STR_PROP_Model]=RMS9ModelMap[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -386,16 +386,16 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
qint64 duration=stredf.GetNumDataRecords()*stredf.GetDuration();
|
qint64 duration=stredf.GetNumDataRecords()*stredf.GetDuration();
|
||||||
int days=duration/86400000L;
|
int days=duration/86400000L;
|
||||||
|
|
||||||
QDateTime dt1=QDateTime::fromTime_t(stredf.startdate/1000L);
|
//QDateTime dt1=QDateTime::fromTime_t(stredf.startdate/1000L);
|
||||||
QDateTime dt2=QDateTime::fromTime_t(stredf.enddate/1000L);
|
//QDateTime dt2=QDateTime::fromTime_t(stredf.enddate/1000L);
|
||||||
QDate dd1=dt1.date();
|
//QDate dd1=dt1.date();
|
||||||
QDate dd2=dt2.date();
|
//QDate dd2=dt2.date();
|
||||||
|
|
||||||
for (int s=0;s<stredf.GetNumSignals();s++) {
|
// for (int s=0;s<stredf.GetNumSignals();s++) {
|
||||||
EDFSignal & es=*stredf.edfsignals[s];
|
// EDFSignal & es=*stredf.edfsignals[s];
|
||||||
long recs=es.nr*stredf.GetNumDataRecords();
|
// long recs=es.nr*stredf.GetNumDataRecords();
|
||||||
//qDebug() << "STREDF:" << es.label << recs;
|
// //qDebug() << "STREDF:" << es.label << recs;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Process STR.edf and find first and last time for each day
|
// Process STR.edf and find first and last time for each day
|
||||||
|
|
||||||
@ -561,12 +561,12 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
if (!dayused[dn]) continue; // Skip days with loadable data.
|
if (!dayused[dn]) continue; // Skip days with loadable data.
|
||||||
|
|
||||||
if (!daystarttimes.contains(dn)) continue;
|
if (!daystarttimes.contains(dn)) continue;
|
||||||
int j=0;
|
int j;
|
||||||
int scnt=daystarttimes[dn].size();
|
int scnt=daystarttimes[dn].size();
|
||||||
|
|
||||||
sess=NULL;
|
sess=NULL;
|
||||||
// For each mask on/off segment.
|
// For each mask on/off segment.
|
||||||
for (j;j<scnt;j++) {
|
for (j=0;j<scnt;j++) {
|
||||||
st=daystarttimes[dn].at(j);
|
st=daystarttimes[dn].at(j);
|
||||||
|
|
||||||
// Skip if session already exists
|
// Skip if session already exists
|
||||||
@ -579,7 +579,13 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
sess=new Session(m,st);
|
sess=new Session(m,st);
|
||||||
sess->really_set_first(qint64(st)*1000L);
|
sess->really_set_first(qint64(st)*1000L);
|
||||||
sess->really_set_last(qint64(et)*1000L);
|
sess->really_set_last(qint64(et)*1000L);
|
||||||
|
sess->SetChanged(true);
|
||||||
|
m->AddSession(sess,profile);
|
||||||
|
|
||||||
|
}
|
||||||
|
// Add the actual data to the last session
|
||||||
|
EventDataType tmp,dur;
|
||||||
|
if (sess) {
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// CPAP Mode
|
// CPAP Mode
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
@ -619,32 +625,78 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
}
|
}
|
||||||
} else { // VPAP or Auto
|
} else { // VPAP or Auto
|
||||||
if (mode>5) {
|
if (mode>5) {
|
||||||
sess->settings[CPAP_Mode]=MODE_BIPAP;
|
if (mode>=7)
|
||||||
|
sess->settings[CPAP_Mode]=MODE_ASV;
|
||||||
|
else
|
||||||
|
sess->settings[CPAP_Mode]=MODE_BIPAP;
|
||||||
|
|
||||||
|
EventDataType tmp,epap=0,ipap=0;
|
||||||
|
if (stredf.lookup.contains("EPAP")) {
|
||||||
|
sig=stredf.lookup["EPAP"];
|
||||||
|
epap=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_EPAP]=epap;
|
||||||
|
sess->setMin(CPAP_EPAP,epap);
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("IPAP")) {
|
||||||
|
sig=stredf.lookup["IPAP"];
|
||||||
|
ipap=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_IPAP]=ipap;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("PS")) {
|
||||||
|
sig=stredf.lookup["PS"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PS]=tmp; // technically this is IPAP-EPAP
|
||||||
|
if (!ipap) {
|
||||||
|
// not really possible. but anyway, just in case..
|
||||||
|
sess->settings[CPAP_IPAP]=epap+tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Min PS")) {
|
||||||
|
sig=stredf.lookup["Min PS"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PSMin]=tmp;
|
||||||
|
sess->settings[CPAP_IPAPLo]=epap+tmp;
|
||||||
|
sess->setMin(CPAP_IPAP,epap+tmp);
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Max PS")) {
|
||||||
|
sig=stredf.lookup["Max PS"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PSMax]=tmp;
|
||||||
|
sess->settings[CPAP_IPAPHi]=epap+tmp;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("RR")) { // Is this a setting to force respiratory rate on S/T machines?
|
||||||
|
sig=stredf.lookup["RR"];
|
||||||
|
tmp=sig->data[dn];
|
||||||
|
sess->settings[CPAP_RespRate]=tmp*sig->gain;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stredf.lookup.contains("Easy-Breathe")) {
|
||||||
|
sig=stredf.lookup["Easy-Breathe"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
|
||||||
|
sess->settings[CPAP_PresReliefSet]=tmp;
|
||||||
|
sess->settings[CPAP_PresReliefType]=(int)PR_EASYBREATHE;
|
||||||
|
sess->settings[CPAP_PresReliefMode]=(int)PM_FullTime;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sess->settings[CPAP_Mode]=MODE_APAP;
|
sess->settings[CPAP_Mode]=MODE_APAP;
|
||||||
|
sig=stredf.lookupSignal(CPAP_PressureMin);
|
||||||
|
if (sig) {
|
||||||
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PressureMin]=pressure;
|
||||||
|
sess->setMin(CPAP_Pressure,pressure);
|
||||||
|
}
|
||||||
|
sig=stredf.lookupSignal(CPAP_PressureMax);
|
||||||
|
if (sig) {
|
||||||
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PressureMax]=pressure;
|
||||||
|
sess->setMax(CPAP_Pressure,pressure);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
sig=stredf.lookupSignal(CPAP_PressureMin);
|
|
||||||
if (sig) {
|
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
|
||||||
sess->settings[CPAP_PressureMin]=pressure;
|
|
||||||
sess->setMin(CPAP_Pressure,pressure);
|
|
||||||
}
|
|
||||||
sig=stredf.lookupSignal(CPAP_PressureMax);
|
|
||||||
if (sig) {
|
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
|
||||||
sess->settings[CPAP_PressureMax]=pressure;
|
|
||||||
sess->setMax(CPAP_Pressure,pressure);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sess->SetChanged(true);
|
|
||||||
m->AddSession(sess,profile);
|
|
||||||
|
|
||||||
}
|
|
||||||
// Add the remainder to the last session
|
|
||||||
EventDataType tmp,dur;
|
|
||||||
if (sess) {
|
|
||||||
EventDataType valmed=0,valmax=0,val95=0;
|
EventDataType valmed=0,valmax=0,val95=0;
|
||||||
|
|
||||||
if (stredf.lookup.contains("Leak Med")) {
|
if (stredf.lookup.contains("Leak Med")) {
|
||||||
@ -667,6 +719,108 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
sess->m_valuesummary[CPAP_Leak][valmax]=5;
|
sess->m_valuesummary[CPAP_Leak][valmax]=5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stredf.lookup.contains("Min Vent Med")) {
|
||||||
|
sig=stredf.lookup["Min Vent Med"];
|
||||||
|
valmed=sig->data[dn];
|
||||||
|
sess->setMedian(CPAP_MinuteVent,valmed*sig->gain);
|
||||||
|
sess->m_gain[CPAP_MinuteVent]=sig->gain;
|
||||||
|
sess->m_valuesummary[CPAP_MinuteVent][valmed]=50;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Min Vent 95")) {
|
||||||
|
sig=stredf.lookup["Min Vent 95"];
|
||||||
|
val95=sig->data[dn];
|
||||||
|
sess->set95p(CPAP_MinuteVent,val95*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_MinuteVent][val95]=45;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Min Vent Max")) {
|
||||||
|
sig=stredf.lookup["Min Vent Max"];
|
||||||
|
valmax=sig->data[dn];
|
||||||
|
sess->setMax(CPAP_MinuteVent,valmax*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_MinuteVent][valmax]=5;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("RR Med")) {
|
||||||
|
sig=stredf.lookup["RR Med"];
|
||||||
|
valmed=sig->data[dn];
|
||||||
|
sess->setMedian(CPAP_RespRate,valmed*sig->gain);
|
||||||
|
sess->m_gain[CPAP_RespRate]=sig->gain;
|
||||||
|
sess->m_valuesummary[CPAP_RespRate][valmed]=50;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("RR 95")) {
|
||||||
|
sig=stredf.lookup["RR 95"];
|
||||||
|
val95=sig->data[dn];
|
||||||
|
sess->set95p(CPAP_RespRate,val95*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_RespRate][val95]=45;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("RR Max")) {
|
||||||
|
sig=stredf.lookup["RR Max"];
|
||||||
|
valmax=sig->data[dn];
|
||||||
|
sess->setMax(CPAP_RespRate,valmax*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_RespRate][valmax]=5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stredf.lookup.contains("Tid Vol Med")) {
|
||||||
|
sig=stredf.lookup["Tid Vol Med"];
|
||||||
|
valmed=sig->data[dn];
|
||||||
|
sess->setMedian(CPAP_TidalVolume,valmed*sig->gain);
|
||||||
|
sess->m_gain[CPAP_TidalVolume]=sig->gain;
|
||||||
|
sess->m_valuesummary[CPAP_TidalVolume][valmed]=50;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Tid Vol 95")) {
|
||||||
|
sig=stredf.lookup["Tid Vol 95"];
|
||||||
|
val95=sig->data[dn];
|
||||||
|
sess->set95p(CPAP_TidalVolume,val95*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_TidalVolume][val95]=45;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Tid Vol Max")) {
|
||||||
|
sig=stredf.lookup["Tid Vol Max"];
|
||||||
|
valmax=sig->data[dn];
|
||||||
|
sess->setMax(CPAP_TidalVolume,valmax*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_TidalVolume][valmax]=5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stredf.lookup.contains("Targ Vent Med")) {
|
||||||
|
sig=stredf.lookup["Targ Vent Med"];
|
||||||
|
valmed=sig->data[dn];
|
||||||
|
sess->setMedian(CPAP_TgMV,valmed*sig->gain);
|
||||||
|
sess->m_gain[CPAP_TgMV]=sig->gain;
|
||||||
|
sess->m_valuesummary[CPAP_TgMV][valmed]=50;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Targ Vent 95")) {
|
||||||
|
sig=stredf.lookup["Targ Vent 95"];
|
||||||
|
val95=sig->data[dn];
|
||||||
|
sess->set95p(CPAP_TgMV,val95*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_TgMV][val95]=45;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Targ Vent Max")) {
|
||||||
|
sig=stredf.lookup["Targ Vent Max"];
|
||||||
|
valmax=sig->data[dn];
|
||||||
|
sess->setMax(CPAP_TgMV,valmax*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_TgMV][valmax]=5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (stredf.lookup.contains("I:E Med")) {
|
||||||
|
sig=stredf.lookup["I:E Med"];
|
||||||
|
valmed=sig->data[dn];
|
||||||
|
sess->setMedian(CPAP_IE,valmed*sig->gain);
|
||||||
|
sess->m_gain[CPAP_IE]=sig->gain;
|
||||||
|
sess->m_valuesummary[CPAP_IE][valmed]=50;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("I:E 95")) {
|
||||||
|
sig=stredf.lookup["I:E 95"];
|
||||||
|
val95=sig->data[dn];
|
||||||
|
sess->set95p(CPAP_IE,val95*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_IE][val95]=45;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("I:E Max")) {
|
||||||
|
sig=stredf.lookup["I:E Max"];
|
||||||
|
valmax=sig->data[dn];
|
||||||
|
sess->setMax(CPAP_IE,valmax*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_IE][valmax]=5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (stredf.lookup.contains("Mask Pres Med")) {
|
if (stredf.lookup.contains("Mask Pres Med")) {
|
||||||
sig=stredf.lookup["Mask Pres Med"];
|
sig=stredf.lookup["Mask Pres Med"];
|
||||||
valmed=sig->data[dn];
|
valmed=sig->data[dn];
|
||||||
@ -687,6 +841,44 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
sess->m_valuesummary[CPAP_Pressure][valmax]=5;
|
sess->m_valuesummary[CPAP_Pressure][valmax]=5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stredf.lookup.contains("Insp Pres Med")) {
|
||||||
|
sig=stredf.lookup["Insp Pres Med"];
|
||||||
|
valmed=sig->data[dn];
|
||||||
|
sess->setMedian(CPAP_IPAP,valmed*sig->gain);
|
||||||
|
sess->m_gain[CPAP_IPAP]=sig->gain;
|
||||||
|
sess->m_valuesummary[CPAP_IPAP][valmed]=50;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Insp Pres 95")) {
|
||||||
|
sig=stredf.lookup["Insp Pres 95"];
|
||||||
|
val95=sig->data[dn];
|
||||||
|
sess->set95p(CPAP_IPAP,val95*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_IPAP][val95]=45;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Insp Pres Max")) {
|
||||||
|
sig=stredf.lookup["Insp Pres Max"];
|
||||||
|
valmax=sig->data[dn];
|
||||||
|
sess->setMax(CPAP_IPAP,valmax*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_IPAP][valmax]=5;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Exp Pres Med")) {
|
||||||
|
sig=stredf.lookup["Exp Pres Med"];
|
||||||
|
valmed=sig->data[dn];
|
||||||
|
sess->setMedian(CPAP_EPAP,valmed*sig->gain);
|
||||||
|
sess->m_gain[CPAP_EPAP]=sig->gain;
|
||||||
|
sess->m_valuesummary[CPAP_EPAP][valmed]=50;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Exp Pres 95")) {
|
||||||
|
sig=stredf.lookup["Exp Pres 95"];
|
||||||
|
val95=sig->data[dn];
|
||||||
|
sess->set95p(CPAP_EPAP,val95*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_EPAP][val95]=45;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Exp Pres Max")) {
|
||||||
|
sig=stredf.lookup["Exp Pres Max"];
|
||||||
|
valmax=sig->data[dn];
|
||||||
|
sess->setMax(CPAP_EPAP,valmax*sig->gain);
|
||||||
|
sess->m_valuesummary[CPAP_EPAP][valmax]=5;
|
||||||
|
}
|
||||||
|
|
||||||
if (stredf.lookup.contains("Mask Dur")) {
|
if (stredf.lookup.contains("Mask Dur")) {
|
||||||
sig=stredf.lookup["Mask Dur"];
|
sig=stredf.lookup["Mask Dur"];
|
||||||
@ -798,20 +990,70 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
sess->settings[CPAP_PresReliefSet]=sig->data[dn];
|
sess->settings[CPAP_PresReliefSet]=sig->data[dn];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mode==0) {
|
if (mode==0) {
|
||||||
sess->settings[CPAP_Mode]=MODE_CPAP;
|
sess->settings[CPAP_Mode]=MODE_CPAP;
|
||||||
sig=stredf.lookupSignal(RMS9_SetPressure); // ?? What's meant by Set Pressure?
|
sig=stredf.lookupSignal(RMS9_SetPressure); // ?? What's meant by Set Pressure?
|
||||||
if (sig) {
|
if (sig) {
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
sess->settings[CPAP_PressureMin]=pressure;
|
sess->settings[CPAP_Pressure]=pressure;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (mode>5) {
|
||||||
if (mode>5) {
|
if (mode>=7)
|
||||||
|
sess->settings[CPAP_Mode]=MODE_ASV;
|
||||||
|
else
|
||||||
sess->settings[CPAP_Mode]=MODE_BIPAP;
|
sess->settings[CPAP_Mode]=MODE_BIPAP;
|
||||||
} else {
|
|
||||||
sess->settings[CPAP_Mode]=MODE_APAP;
|
|
||||||
|
|
||||||
|
EventDataType tmp,epap=0,ipap=0;
|
||||||
|
if (stredf.lookup.contains("EPAP")) {
|
||||||
|
sig=stredf.lookup["EPAP"];
|
||||||
|
epap=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_EPAP]=epap;
|
||||||
}
|
}
|
||||||
|
if (stredf.lookup.contains("IPAP")) {
|
||||||
|
sig=stredf.lookup["IPAP"];
|
||||||
|
ipap=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_IPAP]=ipap;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("PS")) {
|
||||||
|
sig=stredf.lookup["PS"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PS]=tmp; // technically this is IPAP-EPAP
|
||||||
|
if (!ipap) {
|
||||||
|
// not really possible. but anyway, just in case..
|
||||||
|
sess->settings[CPAP_IPAP]=epap+tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Min PS")) {
|
||||||
|
sig=stredf.lookup["Min PS"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PSMin]=tmp;
|
||||||
|
sess->settings[CPAP_IPAPLo]=epap+tmp;
|
||||||
|
sess->setMin(CPAP_IPAP,epap+tmp);
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("Max PS")) {
|
||||||
|
sig=stredf.lookup["Max PS"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
sess->settings[CPAP_PSMax]=tmp;
|
||||||
|
sess->settings[CPAP_IPAPHi]=epap+tmp;
|
||||||
|
}
|
||||||
|
if (stredf.lookup.contains("RR")) { // Is this a setting to force respiratory rate on S/T machines?
|
||||||
|
sig=stredf.lookup["RR"];
|
||||||
|
tmp=sig->data[dn];
|
||||||
|
sess->settings[CPAP_RespRate]=tmp*sig->gain;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stredf.lookup.contains("Easy-Breathe")) {
|
||||||
|
sig=stredf.lookup["Easy-Breathe"];
|
||||||
|
tmp=sig->data[dn]*sig->gain;
|
||||||
|
|
||||||
|
sess->settings[CPAP_PresReliefSet]=tmp;
|
||||||
|
sess->settings[CPAP_PresReliefType]=(int)PR_EASYBREATHE;
|
||||||
|
sess->settings[CPAP_PresReliefMode]=(int)PM_FullTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
sess->settings[CPAP_Mode]=MODE_APAP;
|
||||||
sig=stredf.lookupSignal(CPAP_PressureMin);
|
sig=stredf.lookupSignal(CPAP_PressureMin);
|
||||||
if (sig) {
|
if (sig) {
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
@ -824,8 +1066,8 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
sess->settings[CPAP_PressureMax]=pressure;
|
sess->settings[CPAP_PressureMax]=pressure;
|
||||||
sess->setMax(CPAP_Pressure,pressure);
|
sess->setMax(CPAP_Pressure,pressure);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -879,7 +1121,7 @@ bool ResmedLoader::LoadEVE(Session *sess,EDFParser &edf)
|
|||||||
bool sign,ok;
|
bool sign,ok;
|
||||||
double d;
|
double d;
|
||||||
double tt;
|
double tt;
|
||||||
ChannelID code;
|
//ChannelID code;
|
||||||
//Event *e;
|
//Event *e;
|
||||||
//totaldur=edf.GetNumDataRecords()*edf.GetDuration();
|
//totaldur=edf.GetNumDataRecords()*edf.GetDuration();
|
||||||
|
|
||||||
@ -961,7 +1203,7 @@ bool ResmedLoader::LoadEVE(Session *sess,EDFParser &edf)
|
|||||||
}
|
}
|
||||||
EL[2]->AddEvent(tt,duration);
|
EL[2]->AddEvent(tt,duration);
|
||||||
} else if (t=="central apnea") {
|
} else if (t=="central apnea") {
|
||||||
code=CPAP_ClearAirway;
|
//code=CPAP_ClearAirway;
|
||||||
if (!EL[3]) {
|
if (!EL[3]) {
|
||||||
if (!(EL[3]=sess->AddEventList(CPAP_ClearAirway,EVL_Event))) return false;
|
if (!(EL[3]=sess->AddEventList(CPAP_ClearAirway,EVL_Event))) return false;
|
||||||
}
|
}
|
||||||
|
@ -450,7 +450,7 @@ CPAP_RERA, CPAP_PressurePulse, CPAP_FlowLimit, CPAP_FlowRate, CPAP_MaskPressure,
|
|||||||
CPAP_RespEvent, CPAP_Snore, CPAP_MinuteVent, CPAP_RespRate, CPAP_TidalVolume, CPAP_PTB, CPAP_Leak,
|
CPAP_RespEvent, CPAP_Snore, CPAP_MinuteVent, CPAP_RespRate, CPAP_TidalVolume, CPAP_PTB, CPAP_Leak,
|
||||||
CPAP_LeakMedian, CPAP_LeakTotal, CPAP_MaxLeak, CPAP_FLG, CPAP_IE, CPAP_Te, CPAP_Ti, CPAP_TgMV,
|
CPAP_LeakMedian, CPAP_LeakTotal, CPAP_MaxLeak, CPAP_FLG, CPAP_IE, CPAP_Te, CPAP_Ti, CPAP_TgMV,
|
||||||
CPAP_UserFlag1, CPAP_UserFlag2, CPAP_BrokenSummary, CPAP_BrokenWaveform, CPAP_RDI,
|
CPAP_UserFlag1, CPAP_UserFlag2, CPAP_BrokenSummary, CPAP_BrokenWaveform, CPAP_RDI,
|
||||||
CPAP_PresReliefSet, CPAP_PresReliefMode, CPAP_PresReliefType;
|
CPAP_PresReliefSet, CPAP_PresReliefMode, CPAP_PresReliefType, CPAP_PSMin, CPAP_PSMax;
|
||||||
|
|
||||||
|
|
||||||
ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRSet, RMS9_SetPressure;
|
ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRSet, RMS9_SetPressure;
|
||||||
|
@ -61,7 +61,7 @@ enum CPAPMode//:short
|
|||||||
*/
|
*/
|
||||||
enum PRTypes//:short
|
enum PRTypes//:short
|
||||||
{
|
{
|
||||||
PR_UNKNOWN=0,PR_NONE,PR_CFLEX,PR_CFLEXPLUS,PR_AFLEX,PR_BIFLEX,PR_EPR,PR_SMARTFLEX
|
PR_UNKNOWN=0,PR_NONE,PR_CFLEX,PR_CFLEXPLUS,PR_AFLEX,PR_BIFLEX,PR_EPR,PR_SMARTFLEX,PR_EASYBREATHE
|
||||||
};
|
};
|
||||||
enum PRModes//:short
|
enum PRModes//:short
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ CPAP_RERA, CPAP_PressurePulse, CPAP_FlowLimit, CPAP_FlowRate, CPAP_MaskPressure,
|
|||||||
CPAP_RespEvent, CPAP_Snore, CPAP_MinuteVent, CPAP_RespRate, CPAP_TidalVolume, CPAP_PTB, CPAP_Leak,
|
CPAP_RespEvent, CPAP_Snore, CPAP_MinuteVent, CPAP_RespRate, CPAP_TidalVolume, CPAP_PTB, CPAP_Leak,
|
||||||
CPAP_LeakMedian, CPAP_LeakTotal, CPAP_MaxLeak, CPAP_FLG, CPAP_IE, CPAP_Te, CPAP_Ti, CPAP_TgMV,
|
CPAP_LeakMedian, CPAP_LeakTotal, CPAP_MaxLeak, CPAP_FLG, CPAP_IE, CPAP_Te, CPAP_Ti, CPAP_TgMV,
|
||||||
CPAP_UserFlag1, CPAP_UserFlag2, CPAP_BrokenSummary, CPAP_BrokenWaveform, CPAP_RDI,
|
CPAP_UserFlag1, CPAP_UserFlag2, CPAP_BrokenSummary, CPAP_BrokenWaveform, CPAP_RDI,
|
||||||
CPAP_PresReliefSet, CPAP_PresReliefMode, CPAP_PresReliefType;
|
CPAP_PresReliefSet, CPAP_PresReliefMode, CPAP_PresReliefType, CPAP_PSMin, CPAP_PSMax;
|
||||||
|
|
||||||
extern ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRSet, RMS9_SetPressure;
|
extern ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRSet, RMS9_SetPressure;
|
||||||
extern ChannelID INTP_SmartFlex;
|
extern ChannelID INTP_SmartFlex;
|
||||||
|
@ -904,6 +904,7 @@ QDate Profile::LastGoodDay(MachineType mt)
|
|||||||
return FirstDay();
|
return FirstDay();
|
||||||
QDate d=LastDay(mt);
|
QDate d=LastDay(mt);
|
||||||
QDate f=FirstDay(mt);
|
QDate f=FirstDay(mt);
|
||||||
|
if (!(d.isValid() && f.isValid())) return QDate();
|
||||||
do {
|
do {
|
||||||
if (GetGoodDay(d,mt)!=NULL) return d;
|
if (GetGoodDay(d,mt)!=NULL) return d;
|
||||||
d=d.addDays(-1);
|
d=d.addDays(-1);
|
||||||
|
@ -69,6 +69,8 @@ void init()
|
|||||||
CPAP_EPAP=schema::channel["EPAP"].id();
|
CPAP_EPAP=schema::channel["EPAP"].id();
|
||||||
CPAP_Pressure=schema::channel["Pressure"].id();
|
CPAP_Pressure=schema::channel["Pressure"].id();
|
||||||
CPAP_PS=schema::channel["PS"].id();
|
CPAP_PS=schema::channel["PS"].id();
|
||||||
|
CPAP_PSMin=schema::channel["PSMin"].id();
|
||||||
|
CPAP_PSMax=schema::channel["PSMax"].id();
|
||||||
CPAP_Mode=schema::channel["PAPMode"].id();
|
CPAP_Mode=schema::channel["PAPMode"].id();
|
||||||
CPAP_BrokenSummary=schema::channel["BrokenSummary"].id();
|
CPAP_BrokenSummary=schema::channel["BrokenSummary"].id();
|
||||||
CPAP_PressureMin=schema::channel["PressureMin"].id();
|
CPAP_PressureMin=schema::channel["PressureMin"].id();
|
||||||
|
34
daily.cpp
34
daily.cpp
@ -761,12 +761,34 @@ void Daily::Load(QDate date)
|
|||||||
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
|
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
|
||||||
html+="<tr><td colspan=4 align=center>Mode: ";
|
html+="<tr><td colspan=4 align=center>Mode: ";
|
||||||
|
|
||||||
EventDataType min=cpap->settings_min(CPAP_PressureMin);
|
if (mode==MODE_CPAP) {
|
||||||
EventDataType max=cpap->settings_max(CPAP_PressureMax);
|
EventDataType min=cpap->settings_min(CPAP_PressureMin);
|
||||||
if (mode==MODE_CPAP) html+=tr("CPAP")+" "+QString::number(min)+STR_UNIT_CMH2O;
|
html+=tr("CPAP")+" "+QString::number(min)+STR_UNIT_CMH2O;
|
||||||
else if (mode==MODE_APAP) html+=tr("APAP")+" "+QString::number(min)+"-"+QString::number(max)+STR_UNIT_CMH2O;
|
} else if (mode==MODE_APAP) {
|
||||||
else if (mode==MODE_BIPAP) html+=tr("Bi-Level");
|
EventDataType min=cpap->settings_min(CPAP_PressureMin);
|
||||||
else if (mode==MODE_ASV) html+=tr("ASV");
|
EventDataType max=cpap->settings_max(CPAP_PressureMax);
|
||||||
|
html+=tr("APAP")+" "+QString::number(min)+"-"+QString::number(max)+STR_UNIT_CMH2O;
|
||||||
|
} else if (mode==MODE_BIPAP) {
|
||||||
|
EventDataType epap=cpap->settings_min(CPAP_EPAP);
|
||||||
|
EventDataType ipap=cpap->settings_max(CPAP_IPAP);
|
||||||
|
EventDataType ps=cpap->settings_max(CPAP_PS);
|
||||||
|
html+=tr("Bi-Level")+QString("<br/>EPAP: %1 IPAP: %2 %3<br/> PS: %4")
|
||||||
|
.arg(epap,0,'f',1).arg(ipap,0,'f',1).arg(STR_UNIT_CMH2O).arg(ps,0,'f',1);
|
||||||
|
}
|
||||||
|
else if (mode==MODE_ASV) {
|
||||||
|
EventDataType epap=cpap->settings_min(CPAP_EPAP);
|
||||||
|
EventDataType low=cpap->settings_min(CPAP_IPAPLo);
|
||||||
|
EventDataType high=cpap->settings_max(CPAP_IPAPHi);
|
||||||
|
EventDataType psl=cpap->settings_min(CPAP_PSMin);
|
||||||
|
EventDataType psh=cpap->settings_max(CPAP_PSMax);
|
||||||
|
html+=tr("ASV")+QString("<br/>EPAP: %1 IPAP: %2 - %3 %4<br/> PS: %5 / %6")
|
||||||
|
.arg(epap,0,'f',1)
|
||||||
|
.arg(low,0,'f',1)
|
||||||
|
.arg(high,0,'f',1)
|
||||||
|
.arg(STR_UNIT_CMH2O)
|
||||||
|
.arg(psl,0,'f',1)
|
||||||
|
.arg(psh,0,'f',1);
|
||||||
|
}
|
||||||
else html+=tr("Unknown");
|
else html+=tr("Unknown");
|
||||||
html+="</td></tr>\n";
|
html+="</td></tr>\n";
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@ Important: One id code per item, DO NOT CHANGE ID NUMBERS!!!
|
|||||||
<channel id="0x1117" class="data" name="LeakTotal" details="Total Leak Rate" label="Total Leaks" unit="L/min" color="dark green"/>
|
<channel id="0x1117" class="data" name="LeakTotal" details="Total Leak Rate" label="Total Leaks" unit="L/min" color="dark green"/>
|
||||||
<channel id="0x1118" class="data" name="LeakMedian" details="Median Leak Rate" label="Median Leaks" unit="L/min" color="dark green"/>
|
<channel id="0x1118" class="data" name="LeakMedian" details="Median Leak Rate" label="Median Leaks" unit="L/min" color="dark green"/>
|
||||||
<channel id="0x1119" class="data" name="RDI" details="Respiratory Disturbance Index" label="RDI" unit="events/hr" color="dark red"/>
|
<channel id="0x1119" class="data" name="RDI" details="Respiratory Disturbance Index" label="RDI" unit="events/hr" color="dark red"/>
|
||||||
|
<channel id="0x111a" class="setting" name="PSMin" details="Pressure Support Min" label="PS Min" unit="cmH20" color="dark cyan"/>
|
||||||
|
<channel id="0x111b" class="setting" name="PSMax" details="Pressure Support Max" label="PS Max" unit="cmH20" color="dark magenta"/>
|
||||||
|
|
||||||
<channel id="0x1150" class="data" name="PRS1_00" details="Unknown 00" label="U00" unit="?" color="black"/>
|
<channel id="0x1150" class="data" name="PRS1_00" details="Unknown 00" label="U00" unit="?" color="black"/>
|
||||||
<channel id="0x1151" class="data" name="PRS1_01" details="Unknown 01" label="U01" unit="?" color="black"/>
|
<channel id="0x1151" class="data" name="PRS1_01" details="Unknown 01" label="U01" unit="?" color="black"/>
|
||||||
@ -92,6 +94,7 @@ Important: One id code per item, DO NOT CHANGE ID NUMBERS!!!
|
|||||||
<Option id="5" value="Bi-Flex"/>
|
<Option id="5" value="Bi-Flex"/>
|
||||||
<Option id="6" value="EPR"/>
|
<Option id="6" value="EPR"/>
|
||||||
<Option id="7" value="SmartFlex"/>
|
<Option id="7" value="SmartFlex"/>
|
||||||
|
<Option id="8" value="Easy-Breathe"/>
|
||||||
</channel>
|
</channel>
|
||||||
<channel id="0x1202" class="setting" scope="!session" name="PresRelMode" details="Pressure Relief Mode" label="Pres. Rel. Mode" type="integer">
|
<channel id="0x1202" class="setting" scope="!session" name="PresRelMode" details="Pressure Relief Mode" label="Pres. Rel. Mode" type="integer">
|
||||||
<Option id="0" value=""/>
|
<Option id="0" value=""/>
|
||||||
|
Loading…
Reference in New Issue
Block a user