Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -rc16cfee6212ad1ba9f788c41d4a4c916daa43c9c -r277c22276bf6f02a2fe28107b48ffe4b6995e734 --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision c16cfee6212ad1ba9f788c41d4a4c916daa43c9c) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 277c22276bf6f02a2fe28107b48ffe4b6995e734) @@ -218,70 +218,63 @@ * Initializing the model for the constant values. * \param vData - the response model data. */ -void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID, bool vHeparinBolusVolumeOff, bool vHeparinDispensingRateOff) +void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID, const QString &vSecondaryPatientID) { // Formatted values QString mStrText = "%1"; - // DEBUG: qDebug() << _Settings.groups(); - // SRSUI910 : PRS178 : Clinical - Data - Order - bool isHeparinOff = vHeparinBolusVolumeOff && vHeparinDispensingRateOff; - Q_UNUSED(isHeparinOff); + QString mTreatmentDuration = QString::number(vData.mTreatmentDuration / 60 ); // Converted seconds to minutes. + QString mActualTreatmentDuration = QString::number(vData.mTreatmentDurationActual / 60 ); // Converted seconds to minutes. + QString mTreatmentStartDateTime = Format::fromEpoch( vData.mTreatmentStartEpoch , _datetimeFormat); + QString mTreatmentEndDateTime = Format::fromEpoch( vData.mTreatmentEndEpoch , _datetimeFormat); - // TODO LDT-2500 or LDT-2506 -// QString mTreatmentDurationFmt = QTime (0, 0).addSecs(int(vData.mTreatmentDuration )).toString(_timeFormat); -// QString mActualTreatmentDurationFmt = QTime (0, 0).addSecs(int(vData.mActualTreatmentDuration )).toString(_timeFormat); -// QString mTreatmentDuration = QString::number(vData.mTreatmentDuration / 60 ); // Converted seconds to minutes. -// QString mActualTreatmentDuration = QString::number(vData.mActualTreatmentDuration / 60 ); // Converted seconds to minutes. -// QString mTreatmentStartDateTime = Format::fromEpoch( vData.mTreatmentStartEpoch , _datetimeFormat); -// QString mTreatmentEndDateTime = Format::fromEpoch( vData.mTreatmentEndEpoch , _datetimeFormat); + // TODO : The settings needs modification not only to define the category and groups in a common header but also the settings itself needs some mods. + // - the category shall become as part of the group + // - the structure of the settings should become horizontal which vertical now. + QString mCategory = Storage::Settings_Category_DataList; + QString mAcidConcentrateType = _Settings.key(mCategory, "Acid Concentrate Options" , vData.mAcidConcentrateType ); + QString mBicarbonateConcentrateType = _Settings.key(mCategory, "Bicarbonate Concentrate Options" , vData.mBicarbonateCartridgeSize ); + QString mDialyzerType = _Settings.key(mCategory, "Dialyzer Type Options" , vData.mDialyzerType ); + QString mHeparinType = _Settings.key(mCategory, "Heparin Type Options" , vData.mHeparinType ); + bool isHeparinOff = vData.mHeparinBolusVolume == 0; + bool isHeparinDispensingRateOff = vData.mHeparinDispenseRate == 0; -// // TODO : The settings needs modification not only to define the category and groups in a common header but also the settings itself needs some mods. -// // - the category shall become as part of the group -// // - the structure of the settings should become horizontal which vertical now. -// QString mCategory = Storage::Settings_Category_DataList; -// QString mAcidConcentrateType = _Settings.key(mCategory, "Acid Concentrate Options" , vData.mAcidConcentrateType ); -// QString mBicarbonateConcentrateType = _Settings.key(mCategory, "Bicarbonate Concentrate Options" , vData.mBicarbonateCartridgeSize ); -// QString mDialyzerType = _Settings.key(mCategory, "Dialyzer Type Options" , vData.mDialyzerType ); -// QString mHeparinType = _Settings.key(mCategory, "Heparin Type Options" , vData.mHeparinType ); -// QString mWaterSampleTestResult = _Settings.key(mCategory, "Water Sample Result" , vData.mWaterSampleTestResult ); - - // init/fill/clear the _values clearModel(); // TODO in treatment log story LDT-2500 or LDT-2506 + // LEAHI-PRS-143 _values[ePatientID ] = vPatientID.trimmed() ; + _values[eSecondaryPatientID ] = vSecondaryPatientID.trimmed() ; _values[eBloodFlowRate ] = mStrText.arg(vData.mBloodFlowRate ); -// _values[eDialysateFlowRate ] = mStrText.arg(vData.mDialysateFlowRate ); -// _values[eTreatmentDuration ] = mTreatmentDuration ; -// _values[eActualTreatmentDuration ] = mActualTreatmentDuration ; -// _values[eAcidConcentrateType ] = mAcidConcentrateType ; -// _values[eBicarbonateConcentrateType ] = mBicarbonateConcentrateType ; -// _values[ePotassiumConcentration ] = mStrText.arg(vData.mPotassiumConcentration ); -// _values[eCalciumConcentration ] = mStrText.arg(vData.mCalciumConcentration ); -// _values[eBicarbonateConcentration ] = mStrText.arg(vData.mBicarbonateConcentration ); -// _values[eSodiumConcentration ] = mStrText.arg(vData.mSodiumConcentration ); -// _values[eDialysateTemperature ] = mStrText.arg(vData.mDialysateTemperature ,FLOAT3 ); -// _values[eDialyzerType ] = mDialyzerType ; -// _values[eTreatmentStartDateTime ] = mTreatmentStartDateTime ; -// _values[eTreatmentEndDateTime ] = mTreatmentEndDateTime ; -// _values[eWaterSampleTestResult ] = mWaterSampleTestResult ; -// _values[eDialysateVolumeUsed ] = mStrText.arg(vData.mDialysateVolumeUsed ,FLOAT3 ); -// _values[eOriginUFVolume ] = mStrText.arg(vData.mOriginUFVolume ,FLOAT3 ); -// _values[eTargetUFVolume ] = mStrText.arg(vData.mTargetUFVolume ,FLOAT3 ); -// _values[eActualUFVolume ] = mStrText.arg(vData.mActualUFVolume ,FLOAT3 ); -// _values[eOriginUFRate ] = mStrText.arg(vData.mOriginUFRate ,FLOAT3 ); -// _values[eTargetUFRate ] = mStrText.arg(vData.mTargetUFRate ,FLOAT3 ); -// _values[eActualUFRate ] = mStrText.arg(vData.mActualUFRate ,FLOAT3 ); -// _values[eSalineBolusVolume ] = mStrText.arg(vData.mSalineBolusVolume ); + _values[eDialysateFlowRate ] = mStrText.arg(vData.mDialysateFlowRate ); + _values[eTreatmentDuration ] = mTreatmentDuration ; + _values[eActualTreatmentDuration ] = mActualTreatmentDuration ; + _values[eAcidConcentrateType ] = mAcidConcentrateType ; + _values[eBicarbonateConcentrateType ] = mBicarbonateConcentrateType ; + _values[ePotassiumConcentration ] = mStrText.arg(vData.mPotassiumConcentration ); + _values[eCalciumConcentration ] = mStrText.arg(vData.mCalciumConcentration ); + _values[eBicarbonateConcentration ] = mStrText.arg(vData.mBicarbonateConcentration ); + _values[eSodiumConcentration ] = mStrText.arg(vData.mSodiumConcentration ); + _values[eDialysateTemperature ] = mStrText.arg(vData.mDialysateTemperature ,FLOAT3 ); + _values[eDialyzerType ] = mDialyzerType ; + _values[eTreatmentStartDateTime ] = mTreatmentStartDateTime ; + _values[eTreatmentEndDateTime ] = mTreatmentEndDateTime ; + _values[eWaterSampleTestResult ] = mStrText.arg(vData.mWaterSampleTestResult ); + _values[eDialysateVolumeUsed ] = mStrText.arg(vData.mDialysateVolumeUsed ,FLOAT3 ); + _values[eOriginUFVolume ] = mStrText.arg(vData.mUFVolume ,FLOAT3 ); + _values[eTargetUFVolume ] = mStrText.arg(vData.mUFVolumeTarget ,FLOAT3 ); + _values[eActualUFVolume ] = mStrText.arg(vData.mUFVolumeActual ,FLOAT3 ); + _values[eOriginUFRate ] = mStrText.arg(vData.mUFRate ,FLOAT3 ); + _values[eTargetUFRate ] = mStrText.arg(vData.mUFRateTarget ,FLOAT3 ); + _values[eActualUFRate ] = mStrText.arg(vData.mUFRateActual ,FLOAT3 ); + _values[eFluidBolusVolume ] = mStrText.arg(vData.mFluidBolusVolume ); + _values[eHeparinBolusVolume ] = mStrText.arg(vData.mHeparinBolusVolume ,FLOAT3 ); -// _values[eHeparinType ] = isHeparinOff ? tr("NONE") : mHeparinType ; -//// _values[eHeparinConcentration ] = isHeparinOff ? tr("NONE") : mStrText.arg(vData.mHeparinConcentration ); -// _values[eHeparinBolusVolume ] = vHeparinBolusVolumeOff ? tr("OFF" ) : mStrText.arg(vData.mHeparinBolusVolume ,FLOAT3 ); -// _values[eHeparinDispenseRate ] = vHeparinDispensingRateOff ? tr("OFF" ) : mStrText.arg(vData.mHeparinDispenseRate ,FLOAT3 ); -//// _values[eHeparinStop ] = vHeparinDispensingRateOff ? tr("OFF" ) : mStrText.arg(vData.mHeparinStop ); -// _values[eHeparinDeliveredVolume ] = isHeparinOff ? tr("OFF" ) : mStrText.arg(vData.mHeparinDeliveredVolume ,FLOAT3 ); + _values[eHeparinType ] = isHeparinOff ? tr("NONE") : mHeparinType ; + _values[eHeparinDispenseRate ] = isHeparinDispensingRateOff ? tr("OFF" ) : mStrText.arg(vData.mHeparinDispenseRate ,FLOAT3 ); + _values[eHeparinDeliveryDuration ] = isHeparinDispensingRateOff ? tr("OFF" ) : mStrText.arg(vData.mHeparinDeliveryDuration ); + _values[eHeparinDeliveredVolume ] = isHeparinOff ? tr("OFF" ) : mStrText.arg(vData.mHeparinDeliveredVolume ,FLOAT3 ); emit didTxCodeReceive(""); } @@ -370,12 +363,13 @@ uint index = 0 ; QString txCode = "%1,%2," ; - ADDTITLE("Title"); + ADDTITLE("Patient Information"); ADDALINE(txCode .arg(_txCodeKey).arg(_gTxCode) ); - ADDTOLOG_MT( ePatientID, _emptyPatinetID ); + ADDTOLOG_MT( ePatientID, _emptyPatinetID ); + ADDTOLOG_MT( eSecondaryPatientID, _emptyPatinetID ); - ADDTITLE("Treatment Parameters" ); + ADDTITLE("Treatment Prescription" ); ADDTOLOG( eTreatmentDuration ); ADDTOLOG( eBloodFlowRate ); ADDTOLOG( eDialysateFlowRate ); @@ -388,40 +382,37 @@ ADDTOLOG( eDialysateTemperature ); ADDTOLOG( eDialyzerType ); ADDTOLOG( eHeparinType ); - ADDTOLOG( eHeparinConcentration ); ADDTOLOG( eHeparinBolusVolume ); ADDTOLOG( eHeparinDispenseRate ); - ADDTOLOG( eHeparinStop ); + ADDTOLOG( eHeparinDeliveryDuration ); - ADDTITLE("Treatment Time" ); + ADDTITLE("Treatment Report" ); ADDTOLOG( eTreatmentStartDateTime ); ADDTOLOG( eTreatmentEndDateTime ); ADDTOLOG( eActualTreatmentDuration ); - ADDTITLE("Device Treatment Data" ); ADDTOLOG( eDialysateVolumeUsed ); ADDTOLOG( eOriginUFVolume ); ADDTOLOG( eTargetUFVolume ); ADDTOLOG( eActualUFVolume ); ADDTOLOG( eOriginUFRate ); ADDTOLOG( eTargetUFRate ); ADDTOLOG( eActualUFRate ); - ADDTOLOG( eSalineBolusVolume ); + ADDTOLOG( eFluidBolusVolume ); ADDTOLOG( eHeparinDeliveredVolume ); - - ADDTITLE("Extra" ); ADDTOLOG( eWaterSampleTestResult ); - ADDTITLE("Treatment Data" ); + ADDTITLE("Measured Parameters" ); for ( const TreatmentLogAvrgeData &item : _treatmentLogAvrgeData ) { QString line; line += csv.arg(item.mTimeStamp ); -// line += csv.arg(NONE ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. line += csv.arg(item.mBloodFlowRate ,FLOAT3 ); line += csv.arg(item.mDialysateFlowRate ,FLOAT3 ); line += csv.arg(item.mUFRate ,FLOAT3 ); line += csv.arg(item.mArterialPressure ,FLOAT3 ); line += csv.arg(item.mVenousPressure ,FLOAT3 ); + line += csv.arg(item.mTMPPressure ,FLOAT3 ); + line += csv.arg(item.mDialysateTemp ,FLOAT3 ); line += csv.arg(item.mSystolic ); line += csv.arg(item.mDiastolic ); line += end.arg(item.mHeartRate ); @@ -431,7 +422,7 @@ ADDTITLE("Treatment Alarms" ); for ( const TreatmentLogAlarmData &item : _treatmentLogAlarmData ) { QString line; - // TODO : QString alarmText = Model::MAlarmStatus::toText(static_cast(item.mAlarmID)); +// TODO : QString alarmText = Model::MAlarmStatus::toText(static_cast(item. )); line += csv.arg( item.mTimeStamp ); line += csv.arg( alarmTitle(item.mAlarmID )); line += csv.arg( item.mParam1 );