Index: leahi.qrc
===================================================================
diff -u -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8
--- leahi.qrc (.../leahi.qrc) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c)
+++ leahi.qrc (.../leahi.qrc) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -253,6 +253,7 @@
sources/gui/qml/pages/treatment/TreatmentBloodPrime.qml
sources/gui/qml/pages/treatment/TreatmentSection.qml
sources/gui/qml/pages/treatment/TreatmentSectionHeader.qml
+ sources/gui/qml/pages/treatment/TreatmentHeparin.qml
sources/gui/qml/pages/treatment/sections/TreatmentFlows.qml
@@ -261,7 +262,6 @@
sources/gui/qml/pages/treatment/sections/TreatmentUltrafiltration.qml
sources/gui/qml/pages/treatment/sections/TreatmentTime.qml
sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml
- sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml
sources/gui/qml/pages/treatment/sections/TreatmentPressureComponent.qml
sources/gui/qml/pages/treatment/sections/TreatmentFlowsComponent.qml
Index: sources/gui/qml/components/HeaderBar.qml
===================================================================
diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8
--- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343)
+++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -8,7 +8,7 @@
property alias menuHidden : _headerMenu.hidden
property alias headerMenuIndex : _headerMenu.index
readonly property int currentScreen : _headerMenu.currentScreen
- property alias statusColor : _headerMenu.heparinStatusColor
+ property alias statusColor : _headerMenu.statusColor
width : Variables.applicationWidth
height : Variables.headerHeight
@@ -95,7 +95,7 @@
bottomMargin: hidden || disable ? height * -1 : 0
}
height : parent.height
- width : parent.width / 2
+ width : parent.width / 2 // gives the width of the headerbar menu
hidden : true
titlePixelSize : 32
backgroundColor : Colors.transparent
Index: sources/gui/qml/components/IdleTimer.qml
===================================================================
diff -u -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8
--- sources/gui/qml/components/IdleTimer.qml (.../IdleTimer.qml) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c)
+++ sources/gui/qml/components/IdleTimer.qml (.../IdleTimer.qml) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -5,14 +5,18 @@
* 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 BaseComboBox.qml
+ * \file IdleTimer.qml
* \author (last) Nico Ramirez
* \date (last) 2-Dec-2025
* \author (original) Nico Ramirez
* \date (original) 2-Dec-2025
*
*/
+// Description: File is used as a idle timer for any UI Page. Waits for any user interaction to reset.
+// If timer timesout then idle signal is emitted. Used to move out of a page for any given idle time.
+
+
// Qt
import QtQuick 2.15
Index: sources/gui/qml/components/MainMenu.qml
===================================================================
diff -u -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8
--- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c)
+++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -35,7 +35,7 @@
property bool isMainMenu : false
property bool isMainTreatment : false
readonly property int currentScreen : isMainTreatment ? _mainTreatmentModel.get(index).screen : 0
- property color heparinStatusColor: Colors.transparent
+ property color statusColor : Colors.transparent
width : parent.width
height : Variables.mainMenuHeight
@@ -132,7 +132,7 @@
width : height
radius : height
visible : _root.isMainTreatment && model.screen === MainMenu.Heparin
- color : _root.heparinStatusColor
+ color : _root.statusColor
}
onPressed: {
Index: sources/gui/qml/globals/Variables.qml
===================================================================
diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8
--- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343)
+++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -290,8 +290,8 @@
readonly property string unitTextUltrafiltrationVolume : unitTextVolume
// - Duration/Interval
readonly property string unitTextDuration : qsTr("min")
- readonly property string unitTextHrs : qsTr("hrs")
- readonly property string unitTextMins : qsTr("mins")
+ readonly property string unitTextHrs : qsTr("hr")
+ readonly property string unitTextMins : qsTr("min")
// - Flows
readonly property string unitTextFlowRate : qsTr("mL/min")
readonly property string unitTextDispensingRate : qsTr("mL/hr")
Index: sources/gui/qml/pages/treatment/TreatmentHeparin.qml
===================================================================
diff -u
--- sources/gui/qml/pages/treatment/TreatmentHeparin.qml (revision 0)
+++ sources/gui/qml/pages/treatment/TreatmentHeparin.qml (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -0,0 +1,355 @@
+/*!
+ *
+ * Copyright (c) 2025-2025 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 BaseComboBox.qml
+ * \author (last) Nico Ramirez
+ * \date (last) 2-Dec-2025
+ * \author (original) Nico Ramirez
+ * \date (original) 2-Dec-2025
+ *
+ */
+
+// Qt
+import QtQuick 2.12
+
+// Project
+
+// Qml imports
+import "qrc:/globals"
+import "qrc:/components"
+import "qrc:/compounds"
+import "qrc:/pages/treatment"
+
+/*!
+ * \brief Treatment Screen Heparin Management section
+ */
+ScreenItem { id: _root
+ readonly property bool isOff : vTDTreatmentStates.hpOff
+ readonly property bool isStopped : vTDTreatmentStates.hpStopped
+ readonly property bool isPaused : vTDTreatmentStates.hpPaused
+ readonly property bool isBolus : vTDTreatmentStates.hpInitial_bolus
+ readonly property bool isDispensing : vTDTreatmentStates.hpDispensing
+ readonly property bool isCompleted : vTDTreatmentStates.hpCompleted
+ readonly property bool isEmpty : vTDTreatmentStates.hpEmpty
+ readonly property bool isRejected : vTreatmentAdjustmentHeparin.adjustment_Accepted
+ readonly property bool isTxRunning : vTDTreatmentStates.txDialysis
+
+ readonly property color heparinColor : _root.deliveryOff ? Colors.transparent :
+ isDispensing ? Colors.heparinActive :
+ isPaused ? Colors.heparinPaused :
+ isCompleted ? Colors.heparinComplete : Colors.transparent
+ readonly property bool deliveryOff : vTreatmentCreate.heparinDispensingRate === 0
+ readonly property string buttonText : isDispensing ? qsTr("Pause") :
+ isPaused ? qsTr("Resume") : qsTr("Pause")
+
+ readonly property string statusText : isDispensing ? qsTr("Active") :
+ isPaused ? qsTr("Pause") :
+ isCompleted ? qsTr("Complete") : qsTr("Active")
+
+ readonly property var titles : [ qsTr("Heparin Type"), qsTr("Dispensing Rate"), qsTr("Bolus Volume"), qsTr("Stop Time") ]
+ readonly property var units : [ Variables.unitHeparinType, Variables.unitTextDispensingRate, Variables.unitTextDispensingRate, Variables.unitTextDuration ]
+ readonly property var values : [ vTreatmentRanges.heparinTypeOptions[vTreatmentCreate.heparinType], vTreatmentCreate.heparinDispensingRate, vTreatmentCreate.heparinBolusVolume, vTreatmentCreate.heparinStopTime ]
+
+ readonly property real cumulative : vTreatmentHeparin.cumulative
+ readonly property real target : vTreatmentHeparin.target
+ readonly property string timeRemaining : vTreatmentHeparin.timeRemaining
+
+ signal idleTimeout()
+
+ onHeparinColorChanged : _headerBar.statusColor = heparinColor
+
+ enum HeparinPrescription{
+ HeparinType,
+ DispensingRate,
+ BolusVolume,
+ StopTime
+ }
+
+ component HeparinContainer: TreatmentSection { id: _heparinContainer
+ color : Colors.panelBackgroundColor
+ header.color : Colors.heparinSectionHeader
+ enableDropShadow: false
+ header {
+ showEdit : false
+ titleLeftMargin: Variables.defaultMargin * 3
+ }
+ contentArea.anchors {
+ topMargin : 0
+ leftMargin : Variables.defaultMargin * 2
+ rightMargin : Variables.defaultMargin * 2
+ }
+ border {
+ width: 1
+ color: Colors.heparinPanelBorderColor
+ }
+ header.border {
+ width: 1
+ color: Colors.heparinPanelBorderColor
+ }
+ }
+
+ Connections { target: vTreatmentAdjustmentHeparin
+ function onAdjustmentTriggered ( vValue ) {
+ _notification.text = vTreatmentAdjustmentHeparin.adjustment_Accepted ? "" :
+ vTreatmentAdjustmentHeparin.adjustment_ReasonText
+ }
+ }
+
+ IdleTimer {id: _idleTimer
+ anchors.fill : parent
+
+ onIdle: {
+ _root.idleTimeout()
+ }
+ }
+
+ Row { id: _row
+ objectName : "_row"
+ spacing : Variables.defaultMargin * 5
+
+ anchors {
+ fill : parent
+ topMargin : Variables.defaultMargin * 5
+ leftMargin : Variables.defaultMargin * 5
+ rightMargin : Variables.defaultMargin * 5
+ }
+
+ readonly property int cellWidth : width / 2 - ( spacing / 2 ) // 2 items for the row and subtract spacing for widths
+ readonly property int cellHeight : height / 2
+ readonly property int prescriptionCount : _root.titles.length
+
+ HeparinContainer { id: _heparinPrescription
+ objectName : "_heparinPrescription"
+ header.title : qsTr("Heparin Prescription" )
+ width : _row.cellWidth
+ height : _row.cellHeight
+
+ contentItem : Column { id :_heparinPrescriptionContent
+ Repeater {
+ model: _row.prescriptionCount
+ delegate: LabelUnitContainer {
+ width : parent.width
+ height : parent.height / _row.prescriptionCount
+ border.width : 0
+ color : Colors.transparent
+ text : _root.titles[index]
+ unitText : _root.units[index]
+ titleFontSize : Fonts.fontPixelContainerTitleSmall
+ unitFontSize : Fonts.fontPixelContainerUnitSmall
+
+ contentItem : Text{ id: _value
+ anchors.centerIn: parent
+ color : Colors.offWhite
+ font.pixelSize : Fonts.fontPixelHeparin
+ text : _root.deliveryOff ? "OFF" : index === TreatmentHeparin.DispensingRate ||
+ index === TreatmentHeparin.BolusVolume ? _root.values[index].toFixed(Variables.heparinPrecision) :
+ _root.values[index]
+ }
+ // Bottom border, except for last item
+ Rectangle { id: _separator
+ anchors {
+ left : parent.left
+ leftMargin : Variables.defaultMargin
+ right : parent.right
+ rightMargin : Variables.defaultMargin
+ bottom : parent.bottom
+ }
+ height : 1
+ color : Colors.panelBorderColor
+ visible : index < titles.length - 1 // hide for last item
+ }
+ }
+ }
+ }
+ }
+
+ HeparinContainer { id: _heparinDelivery
+ objectName : "_heparinDelivery"
+ header.title : qsTr("Heparin Delivery" )
+ width : _row.cellWidth
+ height : _row.cellHeight
+
+ contentItem : Item { id: _content
+ anchors.fill : parent
+
+ TouchRect { id: _heparinButton
+ anchors {
+ left : parent.left
+ leftMargin : Variables.defaultMargin
+ bottom : parent.bottom
+ bottomMargin : Variables.defaultMargin * 1.5
+ }
+
+ width : Variables.defaultButtonWidth
+ height : Variables.defaultButtonHeight
+ radius : 9
+ text.textFormat : Text.RichText
+ text.text : _root.buttonText
+ isDefault : true
+ visible : ! _root.deliveryOff && ( _root.isDispensing || _root.isPaused )
+ text.font.weight: Font.DemiBold
+
+ onPressed : {
+ if ( _root.isPaused ) vTreatmentAdjustmentHeparin.doResume()
+ if ( _root.isDispensing ) vTreatmentAdjustmentHeparin.doPause ()
+ _idleTimer.reset()
+ }
+ }
+
+ Rectangle { id: _status
+ anchors {
+ top : parent.top
+ topMargin : Variables.defaultMargin * 1.5
+ right : parent.right
+ }
+ visible : ! _root.deliveryOff && ( _root.isDispensing || _root.isPaused || _root.isCompleted )
+ width : 100
+ height : 30
+ radius : height
+ color : _root.heparinColor
+ Text { id: _statusText
+ anchors.centerIn: parent
+ text : _root.statusText
+ color : Colors.white
+ font.pixelSize : Fonts.fontPixelContainerUnitSmall
+ font.weight : Font.DemiBold
+ }
+ }
+
+ Item {
+ anchors {
+ top : parent.top
+ topMargin : Variables.defaultMargin * 1.5
+ left : parent.left
+ leftMargin : Variables.defaultMargin
+ }
+
+ Text { id: _timeRemainingTitle
+ anchors {
+ top : parent.top
+ left : parent.left
+ }
+ text : qsTr("Time Remaining")
+ color : Colors.white
+ font.pixelSize : Fonts.fontPixelHeparin
+ font.weight : Font.Medium
+ }
+
+ Text { id: _timeRemaining
+ anchors {
+ top : _timeRemainingTitle.bottom
+ topMargin : _root.deliveryOff ? Variables.defaultMargin : Variables.defaultMargin / 2
+ left : parent.left
+ }
+ text : _root.deliveryOff ? ("%1 : %2").arg(Variables.emptyEntry).arg(Variables.emptyEntry) : _root.timeRemaining
+ color : _root.deliveryOff ? Colors.white : _root.isPaused ? Colors.heparinPaused : Colors.white
+ font.pixelSize : _root.deliveryOff ? Fonts.fontPixelHeparin : Fonts.fontPixelHeparinTime
+ font.weight : Font.DemiBold
+ }
+
+ Text { id: _hrsMinsText
+ anchors {
+ top : _timeRemaining.bottom
+ left : parent.left
+ leftMargin : 5
+ }
+ width : 70
+ text : Variables.unitTextHrs
+ color : Colors.white
+ font.pixelSize : Fonts.fontPixelContainerUnit
+ font.weight : Font.Thin
+ }
+
+ Text { id: _hrsMinsText1
+ anchors {
+ top : _timeRemaining.bottom
+ left : _hrsMinsText.right
+ leftMargin : 5
+ }
+ width : _timeRemaining.contentWidth / 2
+ text : Variables.unitTextMins
+ color : Colors.white
+ font.pixelSize : Fonts.fontPixelContainerUnit
+ font.weight : Font.Thin
+ }
+ }
+
+ Column { id: _deliveryColumn
+ anchors {
+ right: parent.right
+ top : parent.top
+ }
+ topPadding : Variables.defaultMargin * 9.5
+ width : parent.width * 0.7
+ height : _content.height * 0.7
+
+ ProgressBar { id: _progressbar
+ width : parent.width
+ height : 20
+ decimal : Variables.heparinDeliveryPrecision
+ minimum : 0
+ maximum : _root.deliveryOff ? 0 : _root.target
+ value : _root.deliveryOff ? 0 : _root.cumulative
+ unitText : Variables.unitTextFluid
+ color : _root.isPaused ? Colors.heparinPaused : Colors.progressBarUltrafiltration
+ radius : height
+ showMarker : false
+ progress.opacity: _root.isPaused ? 0.5 : 1
+
+ minText.color: "#818181"
+ minText.font {
+ pixelSize : 18
+ weight : Font.Normal
+ }
+
+ maxText.color: "#818181"
+ maxText.font {
+ pixelSize : 18
+ weight : Font.Normal
+ }
+
+ Text { id: _valueText
+ anchors {
+ bottom : parent.top
+ bottomMargin: Variables.defaultMargin
+ right : parent.right
+ }
+ text : ("%1 %2").arg(_root.deliveryOff ? Variables.emptyEntry :
+ _root.cumulative.toFixed(Variables.heparinDeliveryPrecision)).arg(qsTr(Variables.unitTextFluid))
+ color : _root.deliveryOff ? Colors.white : _root.isPaused ? Colors.heparinPaused : Colors.white
+ font.pixelSize : Fonts.fontPixelHeparin
+ font.weight : Font.DemiBold
+ }
+
+ Text { id: _heparinDeliveredText
+ anchors {
+ top : parent.bottom
+ topMargin : Variables.defaultMargin * 2.5
+ right : parent.right
+ }
+ text : qsTr("Heparin Delivered")
+ color : Colors.textTextRectLabel
+ font.pixelSize : 20
+ font.weight : Font.Medium
+ }
+ }
+ }
+ }
+ }
+ }
+
+ NotificationBarSmall { id: _notification
+ visible : text
+ color : Colors.transparent
+ textColor : Colors.white
+ imageSource : ""
+ text : ""
+ anchors.bottomMargin: _root.notificationMargin
+ }
+
+
+}
Index: sources/gui/qml/pages/treatment/TreatmentStack.qml
===================================================================
diff -u -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8
--- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c)
+++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -22,7 +22,6 @@
import "qrc:/dialogs"
import "qrc:/globals"
import "qrc:/pages/treatment/adjustments"
-import "qrc:/pages/treatment/sections"
/*!
* \brief TreatmentStack is the screen
Fisheye: Tag bce1e6f584c921c9fa6945204ed1e1d38021fbc8 refers to a dead (removed) revision in file `sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml'.
Fisheye: No comparison available. Pass `N' to diff?
Index: sources/view/hd/data/treatment/VTreatmentHeparinData.cpp
===================================================================
diff -u -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8
--- sources/view/hd/data/treatment/VTreatmentHeparinData.cpp (.../VTreatmentHeparinData.cpp) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c)
+++ sources/view/hd/data/treatment/VTreatmentHeparinData.cpp (.../VTreatmentHeparinData.cpp) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8)
@@ -24,8 +24,8 @@
cumulative (vData.mCumulative );
target (vData.mTarget );
- int hours = vData.mTimeRemaining / 3600;
- int minutes = (vData.mTimeRemaining % 3600) / 60;
+ int hours = vData.mTimeRemaining / 3600 ;
+ int minutes = ( vData.mTimeRemaining % 3600 ) / 60 ;
timeRemaining (QString("%1:%2") .arg(hours, 2, 10, QChar('0'))
.arg(minutes, 2, 10, QChar('0')) );
}