Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r1d3e80dd50bfe08502c8e52de126a2b809370211 --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 1d3e80dd50bfe08502c8e52de126a2b809370211) @@ -81,7 +81,7 @@ * Initializing the model for the constant values. * \param vData - the response model data. */ -void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID) +void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID, bool vIsHeparinOff) { // Formatted values QString mStrText = "%1"; @@ -108,42 +108,54 @@ // init/fill/clear the _values - _values.clear(); - for (int i = 0; i < eTreatmentLogIndexCount; i++) _values << ""; + _valuesLog.clear(); + for (int i = 0; i < eTreatmentLogIndexCount; i++) _valuesLog << ""; _deviceID = mStrText.arg(vData.mDeviceID ); - _values[ePatientID ] = vPatientID.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[eHeparinType ] = mHeparinType ; - _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[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 ); + _valuesLog[ePatientID ] = vPatientID.trimmed() ; + _valuesLog[eBloodFlowRate ] = mStrText.arg(vData.mBloodFlowRate ); + _valuesLog[eDialysateFlowRate ] = mStrText.arg(vData.mDialysateFlowRate ); + _valuesLog[eTreatmentDuration ] = mTreatmentDuration ; + _valuesLog[eActualTreatmentDuration ] = mActualTreatmentDuration ; + _valuesLog[eAcidConcentrateType ] = mAcidConcentrateType ; + _valuesLog[eBicarbonateConcentrateType ] = mBicarbonateConcentrateType ; + _valuesLog[ePotassiumConcentration ] = mStrText.arg(vData.mPotassiumConcentration ); + _valuesLog[eCalciumConcentration ] = mStrText.arg(vData.mCalciumConcentration ); + _valuesLog[eBicarbonateConcentration ] = mStrText.arg(vData.mBicarbonateConcentration ); + _valuesLog[eSodiumConcentration ] = mStrText.arg(vData.mSodiumConcentration ); + _valuesLog[eDialysateTemperature ] = mStrText.arg(vData.mDialysateTemperature ,FLOAT3 ); + _valuesLog[eDialyzerType ] = mDialyzerType ; + _valuesLog[eHeparinType ] = mHeparinType ; + _valuesLog[eHeparinConcentration ] = mStrText.arg(vData.mHeparinConcentration ); + _valuesLog[eHeparinBolusVolume ] = mStrText.arg(vData.mHeparinBolusVolume ,FLOAT3 ); + _valuesLog[eHeparinDispenseRate ] = mStrText.arg(vData.mHeparinDispenseRate ,FLOAT3 ); + _valuesLog[eHeparinStop ] = mStrText.arg(vData.mHeparinStop ); + _valuesLog[eHeparinDeliveredVolume ] = mStrText.arg(vData.mHeparinDeliveredVolume ,FLOAT3 ); + _valuesLog[eTreatmentStartDateTime ] = mTreatmentStartDateTime ; + _valuesLog[eTreatmentEndDateTime ] = mTreatmentEndDateTime ; + _valuesLog[eWaterSampleTestResult ] = mWaterSampleTestResult ; + _valuesLog[eDialysateVolumeUsed ] = mStrText.arg(vData.mDialysateVolumeUsed ,FLOAT3 ); + _valuesLog[eOriginUFVolume ] = mStrText.arg(vData.mOriginUFVolume ,FLOAT3 ); + _valuesLog[eTargetUFVolume ] = mStrText.arg(vData.mTargetUFVolume ,FLOAT3 ); + _valuesLog[eActualUFVolume ] = mStrText.arg(vData.mActualUFVolume ,FLOAT3 ); + _valuesLog[eOriginUFRate ] = mStrText.arg(vData.mOriginUFRate ,FLOAT3 ); + _valuesLog[eTargetUFRate ] = mStrText.arg(vData.mTargetUFRate ,FLOAT3 ); + _valuesLog[eActualUFRate ] = mStrText.arg(vData.mActualUFRate ,FLOAT3 ); + _valuesLog[eSalineBolusVolume ] = mStrText.arg(vData.mSalineBolusVolume ); + //https://diality.atlassian.net/browse/DEN-15911 + _valuesGui = _valuesLog; + if ( ! vIsHeparinOff ) goto lOut; + + _valuesGui[eHeparinType ] = tr("NONE"); + _valuesGui[eHeparinConcentration ] = tr("NONE"); + _valuesGui[eHeparinBolusVolume ] = tr("NONE"); + _valuesGui[eHeparinDispenseRate ] = tr("NONE"); + _valuesGui[eHeparinStop ] = tr("NONE"); + _valuesGui[eHeparinDeliveredVolume ] = tr("NONE"); + +lOut: emit didTxCodeReceive("..."); /* put ... just to notify user about the wait for data */ } @@ -226,7 +238,7 @@ bool TreatmentLog::saveLog() { _lastTxInfo.clear(); - bool ok = (unsigned)_values.count() >= eTreatmentLogIndexCount; + bool ok = (unsigned)_valuesLog.count() >= eTreatmentLogIndexCount; if (!ok) return false; @@ -314,13 +326,13 @@ } ADDALINE(""); - _lastTxInfo.mDateTime = _values[eTreatmentStartDateTime]; + _lastTxInfo.mDateTime = _valuesLog[eTreatmentStartDateTime]; _lastTxInfo.mDateTime.replace("/", "" ); // remove date separator _lastTxInfo.mDateTime.replace(":", "" ); // remove time separator _lastTxInfo.mDateTime.replace(" ", "_"); // replace spaces _lastTxInfo.mDeviceID = _deviceID; - _lastTxInfo.mPatientID = _values[ePatientID]; + _lastTxInfo.mPatientID = _valuesLog[ePatientID]; _lastTxInfo.mFileName = QString("%1%2_%3.log") .arg(_treatmentLogPath_Pending) .arg(_lastTxInfo.mDateTime)