Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -r13d6a4fae2f910ab6e289ac9280258a94f734405 -r1c18f738693756ca1f0342c2cc158e32bc28f90b --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 13d6a4fae2f910ab6e289ac9280258a94f734405) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 1c18f738693756ca1f0342c2cc158e32bc28f90b) @@ -29,8 +29,7 @@ #define FLOAT3 0,'f',3 #define ADDTITLE(vTITLE) logContent += QString("[%1]\n").arg(vTITLE) #define ADDALINE(vTEXT ) logContent += QString("%1\n" ).arg(vTEXT ) -#define ADDTOLOG(vINDEX) index = vINDEX; logContent += _titles[index] + sep + _values[index] + sep + _units[index] + "\n"; - +#define ADDTOLOG(vINDEX) index = vINDEX; logContent += title(index) + sep + value(index) + sep + unit(index) + "\n"; /*! * \brief TreatmentLog::TreatmentLog * The constructor to initial the Treatment Log @@ -69,8 +68,8 @@ QString mTreatmentDuration = QTime (0, 0).addSecs(vData.mTreatmentDuration ).toString(_timeFormat); QString mActualTreatmentDuration = QTime (0, 0).addSecs(vData.mActualTreatmentDuration ).toString(_timeFormat); - QString mTreatmentDateTime = Format::fromEpoch( vData.mTreatmentDateTime , _datetimeFormat); - quint32 mHeparinConcentration = 1000; // vData.mHeparinConcentration + 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 @@ -86,9 +85,7 @@ _values.clear(); for (int i = 0; i < eTreatmentLogIndexCount; i++) _values << ""; - _values[eDeviceID ] = mStrText.arg(vData.mDeviceID ); - _values[eBloodFlowRate ] = mStrText.arg(vData.mBloodFlowRate ); _values[eDialysateFlowRate ] = mStrText.arg(vData.mDialysateFlowRate ); _values[eTreatmentDuration ] = mTreatmentDuration ; @@ -102,12 +99,13 @@ _values[eDialysateTemperature ] = mStrText.arg(vData.mDialysateTemperature ,FLOAT3 ); _values[eDialyzerType ] = mDialyzerType ; _values[eHeparinType ] = mHeparinType ; - _values[eHeparinConcentration ] = mStrText.arg(mHeparinConcentration ); // Decided to be removed, but has to be here until it is actually removed from the message + _values[eHeparinConcentration ] = mStrText.arg(vData.mHeparinConcentration ); _values[eHeparinBolusVolume ] = mStrText.arg(vData.mHeparinBolusVolume ,FLOAT3 ); _values[eHeparinDispenseRate ] = mStrText.arg(vData.mHeparinDispenseRate ,FLOAT3 ); _values[eHeparinStop ] = mStrText.arg(vData.mHeparinStop ); _values[eHeparinDeliveredVolume ] = mStrText.arg(vData.mHeparinDeliveredVolume ,FLOAT3 ); - _values[eTreatmentDateTime ] = mTreatmentDateTime ; + _values[eTreatmentStartDateTime ] = mTreatmentStartDateTime ; + _values[eTreatmentEndDateTime ] = mTreatmentEndDateTime ; _values[eWaterSampleTestResult ] = mWaterSampleTestResult ; _values[eDialysateVolumeUsed ] = mStrText.arg(vData.mDialysateVolumeUsed ,FLOAT3 ); _values[eTargetUFVolume ] = mStrText.arg(vData.mTargetUFVolume ,FLOAT3 ); @@ -120,7 +118,6 @@ _values[eAverageDialysateTemp ] = mStrText.arg(vData.mAverageDialysateTemp ,FLOAT3 ); _values[eAverageArterialPressure ] = mStrText.arg(vData.mAverageArterialPressure ,FLOAT3 ); _values[eAverageVenousPressure ] = mStrText.arg(vData.mAverageVenousPressure ,FLOAT3 ); - _values[eEndTreatmentEarlyAlarm ] = mStrText.arg(vData.mEndTreatmentEarlyAlarm ); } /*! @@ -209,7 +206,6 @@ ADDTITLE("Title"); ADDALINE(csv.arg(tr("Patient Name")) + NONE); ADDALINE(csv.arg(tr("Patient ID" )) + NONE); - ADDTOLOG( eTreatmentDateTime ); ADDTOLOG( eDeviceID ); ADDTITLE("Treatment Prescription" ); @@ -231,8 +227,8 @@ ADDTOLOG( eHeparinStop ); ADDTITLE("Treatment Parameters" ); - ADDALINE(csv.arg(tr("Start Time")) + NONE); - ADDALINE(csv.arg(tr("End Time" )) + NONE); + ADDTOLOG( eTreatmentStartDateTime ); + ADDTOLOG( eTreatmentEndDateTime ); ADDTOLOG( eTreatmentDuration ); ADDTITLE("Post-Treatment Data" ); @@ -251,7 +247,6 @@ ADDTOLOG( eAverageDialysateTemp ); ADDTOLOG( eAverageArterialPressure ); ADDTOLOG( eAverageVenousPressure ); - ADDTOLOG( eEndTreatmentEarlyAlarm ); ADDTITLE("Treatment Data" ); for ( const TreatmentLogAvrgeData &item : _treatmentLogAvrgeData ) { @@ -290,7 +285,7 @@ } ADDALINE(""); - QString mDateTime = _values[eTreatmentDateTime]; + QString mDateTime = _values[eTreatmentStartDateTime]; mDateTime.replace("/", "" ); // remove date separator mDateTime.replace(":", "" ); // remove time separator mDateTime.replace(" ", "_"); // replace spaces