Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -r24f141c96bdd5d4043e6ff05ea7ad962f63faabc -r93b7d7da5dea9e0392e139b59117eb0315d6c343 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 24f141c96bdd5d4043e6ff05ea7ad962f63faabc) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) @@ -26,10 +26,11 @@ Item { id: _root readonly property int cellWidth : width / 2 - ( rowSpacing / 2 ) - readonly property int cellHeight : ( _contentRow.height ) / 7 - ( columnSpacing ) + readonly property int cellHeight : ( _contentGrid.height ) / 7 - ( columnSpacing ) readonly property int rowSpacing : Variables.defaultMargin * 3 readonly property int columnSpacing : 15 readonly property bool isValidated : vTreatmentCreate.parametersValidated + readonly property bool heparinFeatured: true // TODO: vSettings.heparinSyringePump readonly property string editRx : qsTr( "Edit Rx" ) readonly property string selectRx : qsTr( "Select Rx" ) @@ -196,376 +197,375 @@ } } - Row { id: _contentRow + Grid { id: _contentGrid anchors { top : _prescriptionTitle.bottom topMargin : Variables.defaultMargin * 2 left : _root.left right : _root.right bottom : parent.bottom } - spacing : _root.rowSpacing + // Flow intentially set o keep top row aligned. To organize with Heparin Defeature + flow : Grid.LeftToRight + rows : _root.heparinFeatured ? 7 : 6 + columns : 2 + rowSpacing :_root.columnSpacing + columnSpacing : _root.rowSpacing - Column { id: _leftColumn - spacing : _root.columnSpacing + Item { id: _patientIDItem + height : _root.cellHeight + width : _root.cellWidth - Item { id: _patientIDItem - height : cellHeight - width : cellWidth + LabelUnitContainer { id: _patientID + anchors.verticalCenter : parent.verticalCenter + text : qsTr("Patient ID") + height : cellHeight - Variables.defaultMargin + contentArea.anchors.leftMargin : 120 - LabelUnitContainer { id: _patientID - anchors.verticalCenter : parent.verticalCenter - text : qsTr("Patient ID") - height : cellHeight - Variables.defaultMargin - contentArea.anchors.leftMargin : 120 + contentItem : TextEntry { id: _pretreatmentPatientIDEntry + clip : true + textInput.width : parent.width - Variables.defaultMargin * 4 + text : vTreatmentCreate.patientID + anchors.centerIn : parent + textInput.maximumLength : 20 // LEAHI-PRS-236 + textInput.rightPadding : Variables.defaultMargin + textInput.leftPadding : Variables.defaultMargin * 14 + textInput.inputMethodHints : Qt.ImhPreferLowercase + textInput.echoMode : TextInput.Normal + textInput.validator : RegExpValidator { regExp: Variables.regExp_PatientID } + line.visible : false + enabled : _root.editingEnabled + onEditingFinished : vTreatmentCreate.patientID = text - contentItem : TextEntry { id: _pretreatmentPatientIDEntry - clip : true - textInput.width : parent.width - Variables.defaultMargin * 4 - text : vTreatmentCreate.patientID - anchors.centerIn : parent - textInput.maximumLength : 20 // LEAHI-PRS-236 - textInput.rightPadding : Variables.defaultMargin - textInput.leftPadding : Variables.defaultMargin * 14 - textInput.inputMethodHints : Qt.ImhPreferLowercase - textInput.echoMode : TextInput.Normal - textInput.validator : RegExpValidator { regExp: Variables.regExp_PatientID } - line.visible : false - enabled : _root.editingEnabled - onEditingFinished : vTreatmentCreate.patientID = text - - Text { id: _patientIDPlaceHolderText - text : Variables.emptyEntry - anchors.fill : parent - rightPadding : 125 - horizontalAlignment : Text.AlignRight - font.pixelSize : Fonts.fontPixelValueControl - color : Colors.offWhite - visible : _pretreatmentPatientIDEntry.textInput.text.length === 0 && - ! _pretreatmentPatientIDEntry.textInput.activeFocus - } + Text { id: _patientIDPlaceHolderText + text : Variables.emptyEntry + anchors.fill : parent + rightPadding : 125 + horizontalAlignment : Text.AlignRight + font.pixelSize : Fonts.fontPixelValueControl + color : Colors.offWhite + visible : _pretreatmentPatientIDEntry.textInput.text.length === 0 && + ! _pretreatmentPatientIDEntry.textInput.activeFocus } } } + } - LabelUnitContainer { id: _bloodFlowRate - text : qsTr("Blood Flow Rate") - unitText : Variables.unitTextFlowRate - valid : ! vTreatmentCreate.bloodFlowRateRejectReason + Row { id: _qrRow + height : _root.cellHeight + spacing : Variables.defaultMargin - contentItem : ValueAdjuster { id: _bloodFlowRateControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.bloodFlowRateMin - maximum : vTreatmentRanges.bloodFlowRateMax - step : vTreatmentRanges.bloodFlowRateRes - defaultValue : vTreatmentRanges.bloodFlowRateDef - value : vTreatmentCreate.bloodFlowRate - isActive : vTreatmentCreate.bloodFlowRateSet - onDidActiveChange: function(vState) { vTreatmentCreate.bloodFlowRateSet = vState } - onDidChange : function(vValue) { - if ( ! _bloodFlowRate.valid ) { vTreatmentCreate.bloodFlowRateRejectReason = Variables.noRejectReason } - vTreatmentCreate.bloodFlowRate = vValue - } - } + QRCode { id: _qrCode + anchors.verticalCenter : parent.verticalCenter + anchors.verticalCenterOffset: -5 + qrcode : vTreatmentCreate.txCode + clear : ! _root.visible } - LabelUnitContainer { id: _dialysateFlowRate - text : qsTr("Dialysate Flow Rate") - unitText : Variables.unitTextFlowRate - valid : ! vTreatmentCreate.dialysateFlowRateRejectReason + Text { id: _txCode + anchors.bottom : _qrCode.bottom + text : vTreatmentCreate.txCode ? qsTr("Tx Code: ") + vTreatmentCreate.txCode : " " + color : "#DBE9FA" + font.pixelSize : Fonts.fontPixelButton + } + } - contentItem : ValueAdjuster { id: _dialysateFlowRateControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.dialysateFlowRateMin - maximum : vTreatmentRanges.dialysateFlowRateMax - step : vTreatmentRanges.dialysateFlowRateRes - defaultValue : vTreatmentRanges.dialysateFlowRateDef - value : vTreatmentCreate.dialysateFlowRate - isActive : vTreatmentCreate.dialysateFlowRateSet - onDidActiveChange: function(vState) { vTreatmentCreate.dialysateFlowRateSet = vState } - onDidChange : function(vValue) { - if ( ! _dialysateFlowRate.valid ) { vTreatmentCreate.dialysateFlowRateRejectReason = Variables.noRejectReason } - vTreatmentCreate.dialysateFlowRate = vValue - } + LabelUnitContainer { id: _bloodFlowRate + text : qsTr("Blood Flow Rate") + unitText : Variables.unitTextFlowRate + valid : ! vTreatmentCreate.bloodFlowRateRejectReason + + contentItem : ValueAdjuster { id: _bloodFlowRateControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.bloodFlowRateMin + maximum : vTreatmentRanges.bloodFlowRateMax + step : vTreatmentRanges.bloodFlowRateRes + defaultValue : vTreatmentRanges.bloodFlowRateDef + value : vTreatmentCreate.bloodFlowRate + isActive : vTreatmentCreate.bloodFlowRateSet + onDidActiveChange: function(vState) { vTreatmentCreate.bloodFlowRateSet = vState } + onDidChange : function(vValue) { + if ( ! _bloodFlowRate.valid ) { vTreatmentCreate.bloodFlowRateRejectReason = Variables.noRejectReason } + vTreatmentCreate.bloodFlowRate = vValue } } + } - LabelUnitContainer { id: _duration - text : qsTr("Duration") - unitText : Variables.unitTextDuration - valid : ! vTreatmentCreate.treatmentDurationRejectReason + LabelUnitContainer { id: _acidConcentrate + text : qsTr("Acid Concentrate") + showEdit : _root.editingEnabled + onEditClicked : _acidConcentrateAdjustment.open() + valid : ! vTreatmentCreate.acidConcentrateRejectReason - contentItem : ValueAdjuster { id: _durationControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.treatmentDurationMin - maximum : vTreatmentRanges.treatmentDurationMax - step : vTreatmentRanges.treatmentDurationRes - defaultValue : vTreatmentRanges.treatmentDurationDef - value : vTreatmentCreate.treatmentDuration - isActive : vTreatmentCreate.treatmentDurationSet - onDidActiveChange: function(vState) { vTreatmentCreate.treatmentDurationSet = vState } - onDidChange : function(vValue) { - if ( ! _duration.valid ) { vTreatmentCreate.treatmentDurationRejectReason = Variables.noRejectReason } - vTreatmentCreate.treatmentDuration = vValue + contentItem : BaseComboBox { id: _acidConcentrateComboBox + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + isActive : vTreatmentCreate.acidConcentrateSet + enabled : _root.editingEnabled + currentIndex : vTreatmentCreate.acidConcentrate + model : vTreatmentRanges.acidConcentrateOptions + onClear : { + vTreatmentRanges.doClearAcidConcentrate(vTreatmentCreate.acidConcentrateSet) + vTreatmentCreate.acidConcentrateSet = false + } - // set heparin time to clear when set - if ( _heparinStopTimeControl.enabled ) { _heparinStopTimeControl.clear() } - } + onActivated : { + if ( ! _acidConcentrate.valid ) { vTreatmentCreate.acidConcentrateRejectReason = Variables.noRejectReason } + vTreatmentCreate.acidConcentrate = _acidConcentrateComboBox.currentIndex + vTreatmentCreate.acidConcentrateSet = true } } + } - LabelUnitContainer { id: _heparinBolusVolume - text : qsTr("Heparin Bolus Volume") - unitText : Variables.unitTextFluid - valid : ! vTreatmentCreate.heparinBolusVolumeRejectReason + LabelUnitContainer { id: _dialysateFlowRate + text : qsTr("Dialysate Flow Rate") + unitText : Variables.unitTextFlowRate + valid : ! vTreatmentCreate.dialysateFlowRateRejectReason - contentItem : ValueAdjuster { id: _heparinBolusVolumeControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.heparinBolusVolumeMin - maximum : vTreatmentRanges.heparinBolusVolumeMax - step : vTreatmentRanges.heparinBolusVolumeRes - defaultValue : vTreatmentRanges.heparinBolusVolumeDef - value : vTreatmentCreate.heparinBolusVolume - decimal : Variables.heparinPrecision - canOff : true - isActive : vTreatmentCreate.heparinBolusVolumeSet - onDidActiveChange: function(vState) { vTreatmentCreate.heparinBolusVolumeSet = vState } - onDidChange : function(vValue) { - if ( ! _heparinBolusVolume.valid ) { vTreatmentCreate.heparinBolusVolumeRejectReason = Variables.noRejectReason } - vTreatmentCreate.heparinBolusVolume = vValue - } + contentItem : ValueAdjuster { id: _dialysateFlowRateControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.dialysateFlowRateMin + maximum : vTreatmentRanges.dialysateFlowRateMax + step : vTreatmentRanges.dialysateFlowRateRes + defaultValue : vTreatmentRanges.dialysateFlowRateDef + value : vTreatmentCreate.dialysateFlowRate + isActive : vTreatmentCreate.dialysateFlowRateSet + onDidActiveChange: function(vState) { vTreatmentCreate.dialysateFlowRateSet = vState } + onDidChange : function(vValue) { + if ( ! _dialysateFlowRate.valid ) { vTreatmentCreate.dialysateFlowRateRejectReason = Variables.noRejectReason } + vTreatmentCreate.dialysateFlowRate = vValue } } + } - LabelUnitContainer { id: _heparinDispensingRate - text : qsTr("Heparin Dispensing Rate") - unitText : Variables.unitTextDispensingRate - valid : ! vTreatmentCreate.heparinDispensingRateRejectReason + LabelUnitContainer { id: _bicarbonateConcentrate + text : qsTr("Bicarbonate Concentrate") + valid : ! vTreatmentCreate.bicarbonateConcentrateRejectReason - contentItem : ValueAdjuster { id: _heparinDispensingRateControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.heparinDispensingRateMin - maximum : vTreatmentRanges.heparinDispensingRateMax - step : vTreatmentRanges.heparinDispensingRateRes - defaultValue : vTreatmentRanges.heparinDispensingRateDef - value : vTreatmentCreate.heparinDispensingRate - decimal : Variables.heparinPrecision - canOff : true - isActive : vTreatmentCreate.heparinDispensingRateSet - onDidActiveChange: function(vState) { vTreatmentCreate.heparinDispensingRateSet = vState } - onDidChange : function(vValue) { - if ( ! _heparinDispensingRate.valid ) { vTreatmentCreate.heparinDispensingRateRejectReason = Variables.noRejectReason } - // set heparin time to clear when set OFF to value - if ( ! vTreatmentCreate.heparinDispensingRate && vValue ) { _heparinStopTimeControl.clear() } + contentItem : BaseComboBox { id: _bicarbonateConcentrateComboBox + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + isActive : vTreatmentCreate.bicarbonateConcentrateSet + enabled : _root.editingEnabled + currentIndex : vTreatmentCreate.bicarbonateConcentrate + model : vTreatmentRanges.bicarbonateConcentrateOptions + onClear : vTreatmentCreate.bicarbonateConcentrateSet = false + onActivated : { + if ( ! _bicarbonateConcentrate.valid ) { vTreatmentCreate.bicarbonateConcentrateRejectReason = Variables.noRejectReason } + vTreatmentCreate.bicarbonateConcentrate = _bicarbonateConcentrateComboBox.currentIndex + vTreatmentCreate.bicarbonateConcentrateSet = true + } + } + } - vTreatmentCreate.heparinDispensingRate = vValue + LabelUnitContainer { id: _duration + text : qsTr("Duration") + unitText : Variables.unitTextDuration + valid : ! vTreatmentCreate.treatmentDurationRejectReason - // if set to OFF set heparin stop time 0 - if ( ! vTreatmentCreate.heparinDispensingRate ) { - vTreatmentCreate.heparinStopTimeSet = true - vTreatmentCreate.heparinStopTime = 0 - } - } + contentItem : ValueAdjuster { id: _durationControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.treatmentDurationMin + maximum : vTreatmentRanges.treatmentDurationMax + step : vTreatmentRanges.treatmentDurationRes + defaultValue : vTreatmentRanges.treatmentDurationDef + value : vTreatmentCreate.treatmentDuration + isActive : vTreatmentCreate.treatmentDurationSet + onDidActiveChange: function(vState) { vTreatmentCreate.treatmentDurationSet = vState } + onDidChange : function(vValue) { + if ( ! _duration.valid ) { vTreatmentCreate.treatmentDurationRejectReason = Variables.noRejectReason } + vTreatmentCreate.treatmentDuration = vValue - onIsActiveChanged: { - if ( ! vTreatmentCreate.heparinDispensingRate && isActive ) { - vTreatmentCreate.heparinStopTimeSet = true - vTreatmentCreate.heparinStopTime = 0 - } - } + // set heparin time to clear when set + if ( _heparinStopTimeControl.enabled ) { _heparinStopTimeControl.clear() } } } + } - LabelUnitContainer { id: _heparinStopTime - text : qsTr("Heparin Stop Time") - unitText : Variables.unitTextDuration - valid : ! vTreatmentCreate.heparinStopTimeRejectReason + LabelUnitContainer { id: _dialyzerType + text : qsTr("Dialyzer Type") + valid : ! vTreatmentCreate.dialyzerTypeRejectReason - contentItem : ValueAdjuster { id: _heparinStopTimeControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.heparinStopTimeMin - maximum : _durationControl.value - step : _durationControl.step - defaultValue : _durationControl.value - value : vTreatmentCreate.heparinStopTime - enabled : vTreatmentCreate.heparinDispensingRate - canOff : true - isActive : vTreatmentCreate.heparinStopTimeSet - onDidActiveChange: function(vState) { vTreatmentCreate.heparinStopTimeSet = vState } - onDidChange : function(vValue) { - if ( ! _heparinStopTime.valid ) { vTreatmentCreate.heparinStopTimeRejectReason = Variables.noRejectReason } - vTreatmentCreate.heparinStopTime = vValue - } + contentItem : BaseComboBox { id: _dialyzerTypeComboBox + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + isActive : vTreatmentCreate.dialyzerTypeSet + enabled : _root.editingEnabled + currentIndex : vTreatmentCreate.dialyzerType + model : vTreatmentRanges.dialyzerTypeOptions + onClear : vTreatmentCreate.dialyzerTypeSet = false + onActivated : { + if ( ! _dialyzerType.valid ) { vTreatmentCreate.dialyzerTypeRejectReason = Variables.noRejectReason } + vTreatmentCreate.dialyzerType = _dialyzerTypeComboBox.currentIndex + vTreatmentCreate.dialyzerTypeSet = true } } } - Column { id: _rightColumn - spacing : _root.columnSpacing + LabelUnitContainer { id: _heparinBolusVolume + text : qsTr("Heparin Bolus Volume") + unitText : Variables.unitTextFluid + valid : ! vTreatmentCreate.heparinBolusVolumeRejectReason + visible : _root.heparinFeatured - Row { id: _qrRow - height : _root.cellHeight - spacing : Variables.defaultMargin - anchors.left : parent.left - - QRCode { id: _qrCode - anchors.verticalCenter : parent.verticalCenter - anchors.verticalCenterOffset: -5 - qrcode : vTreatmentCreate.txCode - clear : ! _root.visible + contentItem : ValueAdjuster { id: _heparinBolusVolumeControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.heparinBolusVolumeMin + maximum : vTreatmentRanges.heparinBolusVolumeMax + step : vTreatmentRanges.heparinBolusVolumeRes + defaultValue : vTreatmentRanges.heparinBolusVolumeDef + value : vTreatmentCreate.heparinBolusVolume + decimal : Variables.heparinPrecision + canOff : true + isActive : vTreatmentCreate.heparinBolusVolumeSet + onDidActiveChange: function(vState) { vTreatmentCreate.heparinBolusVolumeSet = vState } + onDidChange : function(vValue) { + if ( ! _heparinBolusVolume.valid ) { vTreatmentCreate.heparinBolusVolumeRejectReason = Variables.noRejectReason } + vTreatmentCreate.heparinBolusVolume = vValue } - - Text { id: _txCode - anchors.bottom : _qrCode.bottom - text : vTreatmentCreate.txCode ? qsTr("Tx Code: ") + vTreatmentCreate.txCode : " " - color : "#DBE9FA" - font.pixelSize : Fonts.fontPixelButton - } } + } - LabelUnitContainer { id: _acidConcentrate - text : qsTr("Acid Concentrate") - showEdit : _root.editingEnabled - onEditClicked : _acidConcentrateAdjustment.open() - valid : ! vTreatmentCreate.acidConcentrateRejectReason + LabelUnitContainer { id: _bpMeasurementInterval + text : qsTr("Vitals Interval") + unitText : Variables.unitTextDuration + valid : ! vTreatmentCreate.bloodPressureMeasureIntervalRejectReason - contentItem : BaseComboBox { id: _acidConcentrateComboBox - anchors.rightMargin : Variables.defaultMargin * 2 - anchors.leftMargin : anchors.rightMargin - anchors.topMargin : Variables.defaultMargin / 2 - anchors.bottomMargin: anchors.topMargin - isActive : vTreatmentCreate.acidConcentrateSet - enabled : _root.editingEnabled - currentIndex : vTreatmentCreate.acidConcentrate - model : vTreatmentRanges.acidConcentrateOptions - onClear : { - vTreatmentRanges.doClearAcidConcentrate(vTreatmentCreate.acidConcentrateSet) - vTreatmentCreate.acidConcentrateSet = false - } + contentItem : BaseComboBox { id: _bpMeasurementIntervalControl + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + isActive : vTreatmentCreate.bloodPressureMeasureIntervalSet + enabled : _root.editingEnabled + currentIndex : vTreatmentRanges.bloodPressureMeasureInterval.indexOf(vTreatmentCreate.bloodPressureMeasureInterval.toString()) + model : vTreatmentRanges.bloodPressureMeasureInterval + canOff : true + centerHorizontally : true - onActivated : { - if ( ! _acidConcentrate.valid ) { vTreatmentCreate.acidConcentrateRejectReason = Variables.noRejectReason } - vTreatmentCreate.acidConcentrate = _acidConcentrateComboBox.currentIndex - vTreatmentCreate.acidConcentrateSet = true + onClear : { + vTreatmentCreate.bloodPressureMeasureIntervalSet = false + } + + onActivated : { + if ( ! _bpMeasurementInterval.valid ) { + vTreatmentCreate.bloodPressureMeasureIntervalRejectReason = Variables.noRejectReason } + vTreatmentCreate.bloodPressureMeasureInterval = vTreatmentRanges.bloodPressureMeasureInterval[_bpMeasurementIntervalControl.currentIndex] + vTreatmentCreate.bloodPressureMeasureIntervalSet = true } } + } - LabelUnitContainer { id: _bicarbonateConcentrate - text : qsTr("Bicarbonate Concentrate") - valid : ! vTreatmentCreate.bicarbonateConcentrateRejectReason + LabelUnitContainer { id: _heparinDispensingRate + text : qsTr("Heparin Dispensing Rate") + unitText : Variables.unitTextDispensingRate + valid : ! vTreatmentCreate.heparinDispensingRateRejectReason + visible : _root.heparinFeatured - contentItem : BaseComboBox { id: _bicarbonateConcentrateComboBox - anchors.rightMargin : Variables.defaultMargin * 2 - anchors.leftMargin : anchors.rightMargin - anchors.topMargin : Variables.defaultMargin / 2 - anchors.bottomMargin: anchors.topMargin - isActive : vTreatmentCreate.bicarbonateConcentrateSet - enabled : _root.editingEnabled - currentIndex : vTreatmentCreate.bicarbonateConcentrate - model : vTreatmentRanges.bicarbonateConcentrateOptions - onClear : vTreatmentCreate.bicarbonateConcentrateSet = false - onActivated : { - if ( ! _bicarbonateConcentrate.valid ) { vTreatmentCreate.bicarbonateConcentrateRejectReason = Variables.noRejectReason } - vTreatmentCreate.bicarbonateConcentrate = _bicarbonateConcentrateComboBox.currentIndex - vTreatmentCreate.bicarbonateConcentrateSet = true + contentItem : ValueAdjuster { id: _heparinDispensingRateControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.heparinDispensingRateMin + maximum : vTreatmentRanges.heparinDispensingRateMax + step : vTreatmentRanges.heparinDispensingRateRes + defaultValue : vTreatmentRanges.heparinDispensingRateDef + value : vTreatmentCreate.heparinDispensingRate + decimal : Variables.heparinPrecision + canOff : true + isActive : vTreatmentCreate.heparinDispensingRateSet + onDidActiveChange: function(vState) { vTreatmentCreate.heparinDispensingRateSet = vState } + onDidChange : function(vValue) { + if ( ! _heparinDispensingRate.valid ) { vTreatmentCreate.heparinDispensingRateRejectReason = Variables.noRejectReason } + // set heparin time to clear when set OFF to value + if ( ! vTreatmentCreate.heparinDispensingRate && vValue ) { _heparinStopTimeControl.clear() } + + vTreatmentCreate.heparinDispensingRate = vValue + + // if set to OFF set heparin stop time 0 + if ( ! vTreatmentCreate.heparinDispensingRate ) { + vTreatmentCreate.heparinStopTimeSet = true + vTreatmentCreate.heparinStopTime = 0 } } - } - LabelUnitContainer { id: _dialyzerType - text : qsTr("Dialyzer Type") - valid : ! vTreatmentCreate.dialyzerTypeRejectReason - - contentItem : BaseComboBox { id: _dialyzerTypeComboBox - anchors.rightMargin : Variables.defaultMargin * 2 - anchors.leftMargin : anchors.rightMargin - anchors.topMargin : Variables.defaultMargin / 2 - anchors.bottomMargin: anchors.topMargin - isActive : vTreatmentCreate.dialyzerTypeSet - enabled : _root.editingEnabled - currentIndex : vTreatmentCreate.dialyzerType - model : vTreatmentRanges.dialyzerTypeOptions - onClear : vTreatmentCreate.dialyzerTypeSet = false - onActivated : { - if ( ! _dialyzerType.valid ) { vTreatmentCreate.dialyzerTypeRejectReason = Variables.noRejectReason } - vTreatmentCreate.dialyzerType = _dialyzerTypeComboBox.currentIndex - vTreatmentCreate.dialyzerTypeSet = true + onIsActiveChanged: { + if ( ! vTreatmentCreate.heparinDispensingRate && isActive ) { + vTreatmentCreate.heparinStopTimeSet = true + vTreatmentCreate.heparinStopTime = 0 } } } + } - LabelUnitContainer { id: _bpMeasurementInterval - text : qsTr("Vitals Interval") - unitText : Variables.unitTextDuration - valid : ! vTreatmentCreate.bloodPressureMeasureIntervalRejectReason + LabelUnitContainer { id: _dialysateTemperature + text : qsTr("Dialysate Temperature") + unitText : Variables.unitTextTemperature + valid : ! vTreatmentCreate.dialysateTempRejectReason - contentItem : BaseComboBox { id: _bpMeasurementIntervalControl - anchors.rightMargin : Variables.defaultMargin * 2 - anchors.leftMargin : anchors.rightMargin - anchors.topMargin : Variables.defaultMargin / 2 - anchors.bottomMargin: anchors.topMargin - isActive : vTreatmentCreate.bloodPressureMeasureIntervalSet - enabled : _root.editingEnabled - currentIndex : vTreatmentRanges.bloodPressureMeasureInterval.indexOf(vTreatmentCreate.bloodPressureMeasureInterval.toString()) - model : vTreatmentRanges.bloodPressureMeasureInterval - canOff : true - centerHorizontally : true - - onClear : { - vTreatmentCreate.bloodPressureMeasureIntervalSet = false - } - - onActivated : { - if ( ! _bpMeasurementInterval.valid ) { - vTreatmentCreate.bloodPressureMeasureIntervalRejectReason = Variables.noRejectReason - } - vTreatmentCreate.bloodPressureMeasureInterval = vTreatmentRanges.bloodPressureMeasureInterval[_bpMeasurementIntervalControl.currentIndex] - vTreatmentCreate.bloodPressureMeasureIntervalSet = true - } + contentItem : ValueAdjuster { id: _dialysateTemperatureControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.dialysateTempMin + maximum : vTreatmentRanges.dialysateTempMax + step : vTreatmentRanges.dialysateTempRes + defaultValue : vTreatmentRanges.dialysateTempDef + value : vTreatmentCreate.dialysateTemp + decimal : Variables.dialysateTempPrecision + isActive : vTreatmentCreate.dialysateTempSet + onDidActiveChange: function(vState) { vTreatmentCreate.dialysateTempSet = vState } + onDidChange : function(vValue) { + if ( ! _dialysateTemperature.valid ) { vTreatmentCreate.dialysateTempRejectReason = Variables.noRejectReason } + vTreatmentCreate.dialysateTemp = vValue } } + } - LabelUnitContainer { id: _dialysateTemperature - text : qsTr("Dialysate Temperature") - unitText : Variables.unitTextTemperature - valid : ! vTreatmentCreate.dialysateTempRejectReason + LabelUnitContainer { id: _heparinStopTime + text : qsTr("Heparin Stop Time") + unitText : Variables.unitTextDuration + valid : ! vTreatmentCreate.heparinStopTimeRejectReason + visible : _root.heparinFeatured - contentItem : ValueAdjuster { id: _dialysateTemperatureControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.dialysateTempMin - maximum : vTreatmentRanges.dialysateTempMax - step : vTreatmentRanges.dialysateTempRes - defaultValue : vTreatmentRanges.dialysateTempDef - value : vTreatmentCreate.dialysateTemp - decimal : Variables.dialysateTempPrecision - isActive : vTreatmentCreate.dialysateTempSet - onDidActiveChange: function(vState) { vTreatmentCreate.dialysateTempSet = vState } - onDidChange : function(vValue) { - if ( ! _dialysateTemperature.valid ) { vTreatmentCreate.dialysateTempRejectReason = Variables.noRejectReason } - vTreatmentCreate.dialysateTemp = vValue - } + contentItem : ValueAdjuster { id: _heparinStopTimeControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.heparinStopTimeMin + maximum : _durationControl.value + step : _durationControl.step + defaultValue : _durationControl.value + value : vTreatmentCreate.heparinStopTime + enabled : vTreatmentCreate.heparinDispensingRate + canOff : true + isActive : vTreatmentCreate.heparinStopTimeSet + onDidActiveChange: function(vState) { vTreatmentCreate.heparinStopTimeSet = vState } + onDidChange : function(vValue) { + if ( ! _heparinStopTime.valid ) { vTreatmentCreate.heparinStopTimeRejectReason = Variables.noRejectReason } + vTreatmentCreate.heparinStopTime = vValue } } + } - LabelUnitContainer { id: _salineBolusVolume - text : qsTr("Saline Bolus Volume") - unitText : Variables.unitTextFluid - valid : ! vTreatmentCreate.salineBolusVolumeRejectReason + LabelUnitContainer { id: _salineBolusVolume + text : qsTr("Saline Bolus Volume") + unitText : Variables.unitTextFluid + valid : ! vTreatmentCreate.salineBolusVolumeRejectReason - contentItem : ValueAdjuster { id: _salineBolusVolumeControl - editable : _root.editingEnabled - minimum : vTreatmentRanges.salineBolusVolumeMin - maximum : vTreatmentRanges.salineBolusVolumeMax - step : vTreatmentRanges.salineBolusVolumeRes - defaultValue : vTreatmentRanges.salineBolusVolumeDef - value : vTreatmentCreate.salineBolusVolume - isActive : vTreatmentCreate.salineBolusVolumeSet - onDidActiveChange: function(vState) { vTreatmentCreate.salineBolusVolumeSet = vState } - onDidChange : function(vValue) { - if ( ! _salineBolusVolume.valid ) { vTreatmentCreate.salineBolusVolumeRejectReason = Variables.noRejectReason } - vTreatmentCreate.salineBolusVolume = vValue - } + contentItem : ValueAdjuster { id: _salineBolusVolumeControl + editable : _root.editingEnabled + minimum : vTreatmentRanges.salineBolusVolumeMin + maximum : vTreatmentRanges.salineBolusVolumeMax + step : vTreatmentRanges.salineBolusVolumeRes + defaultValue : vTreatmentRanges.salineBolusVolumeDef + value : vTreatmentCreate.salineBolusVolume + isActive : vTreatmentCreate.salineBolusVolumeSet + onDidActiveChange: function(vState) { vTreatmentCreate.salineBolusVolumeSet = vState } + onDidChange : function(vValue) { + if ( ! _salineBolusVolume.valid ) { vTreatmentCreate.salineBolusVolumeRejectReason = Variables.noRejectReason } + vTreatmentCreate.salineBolusVolume = vValue } } }