Index: sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml =================================================================== diff -u -rdf0c8b4fa51d4f5ef0216eb2c3f6f5dfc97bf12e -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml (.../TreatmentHeparin.qml) (revision df0c8b4fa51d4f5ef0216eb2c3f6f5dfc97bf12e) +++ sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml (.../TreatmentHeparin.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file TreatmentHeparin.qml - * \author (last) Behrouz NematiPour - * \date (last) 17-Nov-2020 + * \file TreatmentHeparin.qml + * \author (last) Vy + * \date (last) 17-May-2023 * \author (original) Behrouz NematiPour - * \date (original) 17-Nov-2020 + * \date (original) 20-Nov-2020 * */ @@ -28,55 +28,86 @@ */ TreatmentFluid { id: _root readonly property bool isOff : vHDTreatmentStates.hpOff + readonly property bool isStopped : vHDTreatmentStates.hpStopped readonly property bool isPaused : vHDTreatmentStates.hpPaused readonly property bool isBolus : vHDTreatmentStates.hpInitial_bolus readonly property bool isDispensing : vHDTreatmentStates.hpDispensing readonly property bool isCompleted : vHDTreatmentStates.hpCompleted readonly property bool isEmpty : vHDTreatmentStates.hpEmpty + readonly property bool isRejected : vTreatmentAdjustmentHeparin.adjustment_Accepted + readonly property bool displayReason : _private.displayReason - readonly property bool isTxRunning : vHDTreatmentStates.txDialysis_Running + readonly property bool isTxRunning : vHDTreatmentStates.txDialysis QtObject { id: _private readonly property string textHeparin : qsTr("HEPARIN DELIVERY") - readonly property string textPause : qsTr("PAUSE DELIVERY") + readonly property string textOff : qsTr("OFF") + readonly property string textPause : qsTr("PAUSE HEPARIN") readonly property string textResume : qsTr("RESUME DELIVERY") + readonly property string textComplete : qsTr("OFF") readonly property string textVolumeTarget : "(" + valueTarget + unit + ")" - readonly property string mesgBolus : qsTr("Heparin bolus is active") - readonly property string mesgCompleted : qsTr("Maximum cumulative heparin volume delivered") - readonly property string mesgEmpty : qsTr("Heparin syringe empty") - readonly property string mesgOff : qsTr("Heparin delivery Off") + readonly property string mesgCompleted : qsTr("Maximum Cumulative Heparin Volume Delivered") + readonly property string mesgBolus : qsTr("Bolus Active") + readonly property string mesgEmpty : qsTr("Syringe Empty") + readonly property string mesgOff : qsTr("") // it is redundant since the button text is now display OFF + readonly property string mesgStopped : qsTr("Delivery Stopped") + readonly property string mesgPaused : qsTr("Delivery Paused") + readonly property string mesgDispensing : qsTr("Dispensing Active") + + property bool displayReason : false readonly property string mesgRejectReason : vTreatmentAdjustmentHeparin.adjustment_ReasonText } title : qsTr("HEPARIN") - cumulativeVisible: false + cumulativeVisible : false + targetVisible : false + progressBarVisible : false - hasArrow : false - targetVisible: false - progressBarVisible: false + hasArrow : false + isTouchable : false + buttonEnabled : ! (isOff || isStopped || isBolus || isEmpty + || isCompleted // decided to not to enable user to resume the heparin while completed (1/Apr/2021 - I,Sean,Nick) + ) && ! isSBInProgress && isTxRunning + buttonText : ! isTxRunning ? _private.textHeparin : + isDispensing ? _private.textPause : + isPaused ? _private.textResume : + isCompleted ? _private.textComplete : // decided to not to enable user to resume the heparin while completed (1/Apr/2021 - I,Sean,Nick) + isOff ? _private.textOff : + _private.textHeparin + unit : Variables.unitTextSaline - isTouchable : ! (isOff || isBolus || isEmpty) && ! isSBInProgress && isTxRunning - buttonText : ! isTxRunning ? _private.textHeparin : - isDispensing ? _private.textPause : - isPaused ? _private.textResume : - isCompleted ? _private.textResume : - _private.textHeparin - unit : Variables.unitTextSaline + valueDecimal : Variables.heparinPrecision + valueDelivered : vTreatmentHeparin.cumulative // this is the cumulative volume of the Heparin bolus and despensing. - valueDelivered: vTreatmentHeparin.cumulative.toFixed(1) // this is the cumulative volume of the Heparin bolus and despensing. - VTreatmentHeparin { id: vTreatmentHeparin } onClicked: { - vTreatmentAdjustmentHeparin.doAdjustment() + // if ( isCompleted ) vTreatmentAdjustmentHeparin.doResume() // decided to not to enable user to resume the heparin while completed (1/Apr/2021 - I,Sean,Nick) + if ( isPaused ) vTreatmentAdjustmentHeparin.doResume() + if ( isDispensing ) vTreatmentAdjustmentHeparin.doPause () } + Connections { target: vTreatmentAdjustmentHeparin + function onAdjustmentTriggered ( vValue ) { + _private.displayReason = ! vTreatmentAdjustmentHeparin.adjustment_Accepted + } + } + Connections { target: vHDTreatmentStates + function onHeparinChanged ( vValue ) { + _private.displayReason = false + } + + } + notification { visible : true - text : isBolus ? _private.mesgBolus : + text : displayReason ? _private.mesgRejectReason : + isBolus ? _private.mesgBolus : isOff ? _private.mesgOff : + isStopped ? _private.mesgStopped : + isPaused ? _private.mesgPaused : isCompleted ? _private.mesgCompleted : isEmpty ? _private.mesgEmpty : - _private.mesgRejectReason + isDispensing ? _private.mesgDispensing : "" } }