Index: sources/gui/qml/components/GridSelection.qml =================================================================== diff -u -r2dd4e9c952d65e68f1c81a1cfc13d1f96b0d7d43 -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision 2dd4e9c952d65e68f1c81a1cfc13d1f96b0d7d43) +++ sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -49,6 +49,11 @@ signal clicked(int vIndex) + function reset() { + _root.curIndex = -1 + _root.active = false + } + Text { id : _title text : "" color : _root.valid ? Colors.textMain : Colors.createTreatmentInvalidParam @@ -72,10 +77,7 @@ height : _root.optionHeight width : _root.optionWidth radius : Variables.dialogRadius - Binding on selected { - when : _root.curIndex > -1 - value : index === _root.curIndex - } + selected : _root.curIndex > -1 ? index === _root.curIndex : false onClicked: { _root.curIndex = index _root.clicked ( index ) Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r4b7b6f9506d7c7ad4f611b8c417ed37d5f9a48ac -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 4b7b6f9506d7c7ad4f611b8c417ed37d5f9a48ac) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -406,10 +406,9 @@ onClicked :{vTreatmentCreate.heparinType = curIndex ; vTreatmentCreate.heparinTypeSet = true; } enabled : _heparinDispensingRateSwitch.checked || _heparinBolusVolumeSwitch.checked onEnabledChanged: { - if (!enabled) { - // set disabled value - vTreatmentCreate.heparinType = -1 + if ( ! enabled ) { vTreatmentCreate.heparinTypeSet = false + reset() } } Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml =================================================================== diff -u -r4b7b6f9506d7c7ad4f611b8c417ed37d5f9a48ac -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml (.../PreTreatmentCreateStack.qml) (revision 4b7b6f9506d7c7ad4f611b8c417ed37d5f9a48ac) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml (.../PreTreatmentCreateStack.qml) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -116,16 +116,16 @@ } Connections { target: vTreatmentCreate - function onDidValidationPass ( vValue ) { page( _pretreatmentConfirm )} + function onDidValidationPass ( vValue ) { page( _pretreatmentConfirm ) + vPostTreatmentAdjustmentTreatmentLog.heparinDispensingRateOff = vTreatmentCreate.heparinDispensingRateOff + vPostTreatmentAdjustmentTreatmentLog.heparinBolusVolumeOff = vTreatmentCreate.heparinBolusVolumeOff + } } Connections { target: _pretreatmentConfirm function onBackClicked ( ) { vTreatmentCreate.doCancel () page( _pretreatmentCreate )} - function onConfirmClicked ( ) { vTreatmentCreate.doConfirm () - vPostTreatmentAdjustmentTreatmentLog.heparinDispensingRateOff = vTreatmentCreate.heparinDispensingRateOff - vPostTreatmentAdjustmentTreatmentLog.heparinBolusVolumeOff = vTreatmentCreate.heparinBolusVolumeOff - } + function onConfirmClicked ( ) { vTreatmentCreate.doConfirm ()} } onVisibleChanged: { Index: sources/gui/qml/pages/treatment/TreatmentHome.qml =================================================================== diff -u -r159f2bb0317c7c3c0336e4cb80c7fef3f87e329a -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision 159f2bb0317c7c3c0336e4cb80c7fef3f87e329a) +++ sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -59,7 +59,7 @@ sectionVitalsClicked() } notification.text: qsTr("Interval:" ) - + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("off")) + + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) + " , " + qsTr("Last Read:") + " " + vTreatmentVitals.lastRead Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -rd26aff743bca7eceb609ce5b30cea7cbfa39748f -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision d26aff743bca7eceb609ce5b30cea7cbfa39748f) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -180,13 +180,14 @@ * Initializing the model for the constant values. * \param vData - the response model data. */ -void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID, bool vIsHeparinOff) +void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID, bool vHeparinBolusVolumeOff, bool vHeparinDispensingRateOff) { // Formatted values QString mStrText = "%1"; // DEBUG: qDebug() << _Settings.groups(); // SRSUI910 : PRS178 : Clinical - Data - Order + bool isHeparinOff = vHeparinBolusVolumeOff && vHeparinDispensingRateOff; QString mTreatmentDurationFmt = QTime (0, 0).addSecs(int(vData.mTreatmentDuration )).toString(_timeFormat); QString mActualTreatmentDurationFmt = QTime (0, 0).addSecs(int(vData.mActualTreatmentDuration )).toString(_timeFormat); @@ -207,53 +208,41 @@ // init/fill/clear the _values - _valuesLog.clear(); - for (int i = 0; i < eTreatmentLogIndexCount; i++) _valuesLog << ""; + clearModel(); - _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 ); + _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[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 ); - //https://diality.atlassian.net/browse/DEN-15911 - _valuesGui = _valuesLog; - if ( ! vIsHeparinOff ) goto lOut; + _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 ); - _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 */ + emit didTxCodeReceive(""); } /*! @@ -330,7 +319,7 @@ bool TreatmentLog::saveLog() { _lastTxInfo.clear(); - bool ok = (unsigned)_valuesLog.count() >= eTreatmentLogIndexCount; + bool ok = (unsigned)_values.count() >= eTreatmentLogIndexCount; if (!ok) return false; @@ -420,13 +409,13 @@ } ADDALINE(""); - _lastTxInfo.mDateTime = _valuesLog[eTreatmentStartDateTime]; + _lastTxInfo.mDateTime = _values[eTreatmentStartDateTime]; _lastTxInfo.mDateTime.replace("/", "" ); // remove date separator _lastTxInfo.mDateTime.replace(":", "" ); // remove time separator _lastTxInfo.mDateTime.replace(" ", "_"); // replace spaces _lastTxInfo.mDeviceID = _deviceID; - _lastTxInfo.mPatientID = _valuesLog[ePatientID]; + _lastTxInfo.mPatientID = _values[ePatientID]; _lastTxInfo.mFileName = QString("%1%2_%3.%4") .arg(_treatmentLogPath) .arg(_lastTxInfo.mDateTime) Index: sources/storage/TreatmentLog.h =================================================================== diff -u -rd3b9893be260817e12327d144d4e798b5ac2f99d -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision d3b9893be260817e12327d144d4e798b5ac2f99d) +++ sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -210,14 +210,12 @@ } QString title(quint8 vIndex) const { return string(vIndex, _titles );} - QString value(quint8 vIndex) const { return string(vIndex, _valuesLog );} + QString value(quint8 vIndex) const { return string(vIndex, _values );} QString unit (quint8 vIndex) const { return string(vIndex, _units );} // Lists - QStringList _valuesLog; + QStringList _values; - QStringList _valuesGui; - QList _treatmentLogAvrgeData; QList _treatmentLogAlarmData; QList _treatmentLogEventData; @@ -251,12 +249,15 @@ void timerEvent(QTimerEvent *) override; public: - void initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID, bool vIsHeparinOff); + void initModel(const AdjustTreatmentLogResponseData &vData, const QString &vPatientID, bool vHeparinBolusVolumeOff, bool vHeparinDispensingRateOff); + void clearModel() { + _values.clear(); + for (int i = 0; i < eTreatmentLogIndexCount; i++) _values << ""; + } const QStringList titles () const { return _titles ; } const QStringList units () const { return _units ; } - const QStringList valuesLog () const { return _valuesLog; } - const QStringList valuesGui () const { return _valuesGui; } + const QStringList values () const { return _values ; } void append(const TreatmentLogAvrgeData &vData); void append(const TreatmentLogAlarmData &vData); Index: sources/view/VTreatmentCreate.cpp =================================================================== diff -u -r87b082e1323c0fb59a1ecc85acfce2a5f77d677b -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 87b082e1323c0fb59a1ecc85acfce2a5f77d677b) +++ sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -164,15 +164,14 @@ * \details Gets a list of the prescription parameter values * \return (QStringList) The list of parameter values with units */ -QStringList VTreatmentCreate::doGetPrescriptionParameterValues() -{ - return QStringList() << QString("%0 mL/min").arg(_bloodFlowRate) - << QString("%0 mL/min").arg(_dialysateFlowRate) - << QString("%0 min").arg(_treatmentDuration) - << ( _heparinDispensingRate ? QString("%0 mL/hr").arg(_heparinDispensingRate) : tr("OFF") ) - << ( _heparinBolusVolume ? QString("%0 mL" ).arg(_heparinBolusVolume ) : tr("OFF") ) - << QString("%0 min").arg(_heparinStopTime) - << QString("%0 mL").arg(_salineBolusVolume); +QStringList VTreatmentCreate::doGetPrescriptionParameterValues() { + return QStringList() << QString("%1 mL/min" ).arg(_bloodFlowRate ) + << QString("%1 mL/min" ).arg(_dialysateFlowRate ) + << QString("%1 min" ).arg(_treatmentDuration ) + << ( _heparinDispensingRate ? QString("%1 mL/hr" ).arg(_heparinDispensingRate) : tr("OFF") ) + << ( _heparinBolusVolume ? QString("%1 mL" ).arg(_heparinBolusVolume ) : tr("OFF") ) + << ( _heparinDispensingRate ? QString("%1 min" ).arg(_heparinStopTime ) : tr("OFF") ) + << QString("%1 mL" ).arg(_salineBolusVolume ) ; } /*! @@ -194,7 +193,7 @@ QString mCategory = Storage::Settings_Category_ConfigurationsDataList; - if ( heparinTypeSet () ) { + if ( heparinTypeSet () ) { // this is managed on UI with heparinTypeSet() // && ( _heparinDispensingRate || _heparinBolusVolume ) mHeparinTypeOptions = _Settings.keys(mCategory, "Heparin Type Options" ); if ((int) _heparinType < mHeparinTypeOptions .length()) mHeparinType = mHeparinTypeOptions .at( _heparinType ); } else { mHeparinType = tr("NONE"); } Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp =================================================================== diff -u -rf9e747f0f28df1cc6a33179f0bc78bfc03d486fc -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp (.../VPostTreatmentAdjustTreatmentLog.cpp) (revision f9e747f0f28df1cc6a33179f0bc78bfc03d486fc) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp (.../VPostTreatmentAdjustTreatmentLog.cpp) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) @@ -52,6 +52,9 @@ * \details the invocable slot to send user's treatment log request */ void View::VPostTreatmentAdjustmentTreatmentLog::doRequest() { + _TreatmentLog.clearModel(); + parametersText ( {} ); + AdjustTreatmentLogRequestData data; emit didAdjustment(data); } @@ -75,8 +78,7 @@ adjustment_Reason ( vData.mReason ); // init the TreatmentLog model - bool isHeparinOff = heparinBolusVolumeOff() && heparinDispensingRateOff(); - _TreatmentLog.initModel ( vData, _patientID.trimmed(), isHeparinOff); + _TreatmentLog.initModel ( vData, _patientID.trimmed(), heparinBolusVolumeOff(), heparinDispensingRateOff()); if ( vData.mAccepted ) { //TODO Commented out for now // It is needed to display NONE for the heparin items if the heparin set to off on Create Treatment Parameters screen. @@ -87,7 +89,7 @@ // Look for the https://diality.atlassian.net/browse/DEN-15911 // to know were to update for full model the view update. // When the model updated the valueGui() can be removed and valuesLog() can be used. - parametersText ( _TreatmentLog.valuesGui() ); + parametersText ( _TreatmentLog.values() ); } else { parametersText ( {} ); }