Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -ra563e719d85e3274b0cd0fa831ef8257032e49bc -r56381aae237db191956aff493907cd1f0801216b --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision a563e719d85e3274b0cd0fa831ef8257032e49bc) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 56381aae237db191956aff493907cd1f0801216b) @@ -36,10 +36,16 @@ readonly property string selectRx : qsTr( "Select Rx" ) readonly property string clearAll : qsTr( "Clear All" ) + property int currentIndex : PreTreatmentCreateContent.PatientPrescription property bool editingEnabled : true onIsValidatedChanged : canEdit ( ! isValidated ) + enum Page { + PatientPrescription , + TreatmentSettings + } + function canEdit (state) { editingEnabled = state && ! vTDOpMode.inTreatment } function activateAndRefresh() { @@ -49,9 +55,9 @@ vTreatmentCreate.treatmentDurationSet = true vTreatmentCreate.heparinDispensingRateSet = true vTreatmentCreate.heparinBolusVolumeSet = true - vTreatmentCreate.heparinStopTimeSet = true + vTreatmentCreate.heparinDeliveryDurationSet = true vTreatmentCreate.dialysateTempSet = true - vTreatmentCreate.salineBolusVolumeSet = true + vTreatmentCreate.fluidBolusVolumeSet = true vTreatmentCreate.bloodPressureMeasureIntervalSet = true vTreatmentCreate.acidConcentrateSet = true vTreatmentCreate.bicarbonateConcentrateSet = true @@ -64,9 +70,9 @@ _durationControl .refresh() _heparinDispensingRateControl .refresh() _heparinBolusVolumeControl .refresh() - _heparinStopTimeControl .refresh() + _heparinDeliveryDurationControl .refresh() _dialysateTemperatureControl .refresh() - _salineBolusVolumeControl .refresh() + _fluidBolusVolumeControl .refresh() _bpMeasurementIntervalControl .refresh() } @@ -77,57 +83,60 @@ _durationControl .clear() _heparinDispensingRateControl .clear() _heparinBolusVolumeControl .clear() - _heparinStopTimeControl .clear() + _heparinDeliveryDurationControl .clear() _acidConcentrateComboBox .clear() _bicarbonateConcentrateComboBox .clear() _dialyzerTypeComboBox .clear() _dialysateTemperatureControl .clear() - _salineBolusVolumeControl .clear() + _fluidBolusVolumeControl .clear() _bpMeasurementIntervalControl .clear() clearErrors() canEdit (true) } function clearErrors() { + vTreatmentCreate.treatmentModalityRejectReason = Variables.noRejectReason + vTreatmentCreate.hDFTreatmentModeRejectReason = Variables.noRejectReason vTreatmentCreate.bloodFlowRateRejectReason = Variables.noRejectReason vTreatmentCreate.dialysateFlowRateRejectReason = Variables.noRejectReason vTreatmentCreate.treatmentDurationRejectReason = Variables.noRejectReason - vTreatmentCreate.heparinDispensingRateRejectReason = Variables.noRejectReason - vTreatmentCreate.heparinBolusVolumeRejectReason = Variables.noRejectReason - vTreatmentCreate.heparinStopTimeRejectReason = Variables.noRejectReason - vTreatmentCreate.acidConcentrateRejectReason = Variables.noRejectReason - vTreatmentCreate.bicarbonateConcentrateRejectReason = Variables.noRejectReason + vTreatmentCreate.heparinDeliveryDurationRejectReason = Variables.noRejectReason + vTreatmentCreate.heparinTypeRejectReason = Variables.noRejectReason + vTreatmentCreate.dryBicarbCartSizeRejectReason = Variables.noRejectReason + vTreatmentCreate.sodiumRejectReason = Variables.noRejectReason + vTreatmentCreate.bicarbonateRejectReason = Variables.noRejectReason vTreatmentCreate.dialyzerTypeRejectReason = Variables.noRejectReason - vTreatmentCreate.dialysateTempRejectReason = Variables.noRejectReason - vTreatmentCreate.salineBolusVolumeRejectReason = Variables.noRejectReason + vTreatmentCreate.fluidBolusVolumeRejectReason = Variables.noRejectReason vTreatmentCreate.bloodPressureMeasureIntervalRejectReason = Variables.noRejectReason + vTreatmentCreate.primeDiscardVolumeRejectReason = Variables.noRejectReason + vTreatmentCreate.rinsebackVolumeRejectReason = Variables.noRejectReason + vTreatmentCreate.hepatitusBStatusRejectReason = Variables.noRejectReason + vTreatmentCreate.substitutionFluidVolumeRejectReason = Variables.noRejectReason + vTreatmentCreate.heparinBolusVolumeRejectReason = Variables.noRejectReason + vTreatmentCreate.heparinDispensingRateRejectReason = Variables.noRejectReason + vTreatmentCreate.dialysateTempRejectReason = Variables.noRejectReason + vTreatmentCreate.potassiumRejectReason = Variables.noRejectReason + vTreatmentCreate.calciumRejectReason = Variables.noRejectReason } function confirmReady () { - return _bloodFlowRateControl .isActive && _bloodFlowRate .valid && - _dialysateFlowRateControl .isActive && _dialysateFlowRate .valid && - _durationControl .isActive && _duration .valid && + return _bloodFlowRateControl .isActive && _bloodFlowRate .valid && + _dialysateFlowRateControl .isActive && _dialysateFlowRate .valid && + _durationControl .isActive && _duration .valid && ( _root.heparinFeatured ? _heparinDispensingRateControl .isActive && _heparinDispensingRate .valid && - _heparinBolusVolumeControl .isActive && _heparinBolusVolume .valid && - _heparinStopTimeControl .isActive && _heparinStopTime .valid : true ) && + _heparinBolusVolumeControl .isActive && _heparinBolusVolume .valid && + _heparinDeliveryDurationControl .isActive && _heparinDeliveryDuration .valid : true ) && _acidConcentrateComboBox .isActive && _bicarbonateConcentrateComboBox .isActive && _dialyzerTypeComboBox .isActive && - _dialysateTemperatureControl .isActive && _dialysateTemperature .valid && - _salineBolusVolumeControl .isActive && _salineBolusVolume .valid && + _dialysateTemperatureControl .isActive && _dialysateTemperature .valid && + _fluidBolusVolumeControl .isActive && _fluidBolusVolume .valid && _bpMeasurementIntervalControl .isActive } function validate () { vTreatmentCreate .patientID = _pretreatmentPatientIDEntry.text vPostTreatmentAdjustmentTreatmentLog.patientID = _pretreatmentPatientIDEntry.text // store for the TreatmentLog - - vTreatmentCreate.arterialPressureLimitWindow = vTreatmentRanges.arterialPressureLimitWindowDef // these parameters don't have a user option on create treatment, so sending the default. - vTreatmentCreate.venousPressureLimitWindow = vTreatmentRanges.venousPressureLimitWindowDef // these parameters don't have a user option on create treatment, so sending the default. - vTreatmentCreate.venousPressureLimitAsymtrc = vTreatmentRanges.venousPressureLimitAsymtrcDef // these parameters don't have a user option on create treatment, so sending the default. - vTreatmentCreate.transmembranePressureLimitWindow = vTreatmentRanges.transmembranePressureLimitWindowDef // these parameters don't have a user option on create treatment, so sending the default. - vTreatmentCreate.rinsebackVolume = vTreatmentRanges.rinsebackVolumeDef // these parameters don't have a user option on create treatment, so sending the default. - vTreatmentCreate.rinsebackFlowRate = vTreatmentRanges.rinsebackFlowRateDef // these parameters don't have a user option on create treatment, so sending the default. vTreatmentCreate.doValidation ( ) } @@ -146,6 +155,7 @@ function onAccepted () { vTreatmentCreate.acidConcentrate = _acidConcentrateComboBox.find(_acidConcentrateAdjustment.adjustment) _acidConcentrateComboBox.currentIndex = vTreatmentCreate.acidConcentrate + vTreatmentCreate.acidConcentrateConversionFactor = vTreatmentRanges.acidConcentrateValues[vTreatmentCreate.acidConcentrate] } } @@ -155,22 +165,44 @@ onClicked : focus = true // grab focus here } - Text { id: _prescriptionTitle + MainMenu { id: _prescriptionMenu anchors { - top : parent.top - topMargin : Variables.defaultMargin - left : parent.left + top : parent.top + topMargin : Variables.defaultMargin + left : parent.left } - text : qsTr("Prescription") - color : Colors.textMain - font.pixelSize : Fonts.fontPixelTitle - font.weight : Font.Medium + + width : _root.width / 2.5 + index : _root.currentIndex + color : Colors.transparent + titlePixelSize : 30 + model : _model + highlightWidth : width / 2.5 + + onItemPressed: function (vIndex) { + _root.currentIndex = vIndex + } + + ListModel { id: _model + ListElement { text: qsTr("Patient Prescription") ; visible: true } + ListElement { text: qsTr("Treatment Settings") ; visible: true } + } } - BaseComboBox { id: _prescriptionMenu + Line { anchors { - left : _prescriptionTitle.right - verticalCenter : _prescriptionTitle.verticalCenter + bottom : _prescriptionMenu.bottom + right : parent.right + left : parent.left + } + + color : Colors.panelBorderColor + } + + BaseComboBox { id: _prescriptionDotMenu + anchors { + left : _prescriptionMenu.right + verticalCenter : _prescriptionMenu.verticalCenter verticalCenterOffset: 5 } @@ -200,9 +232,45 @@ } } + Row { id: _qrRow + height : _root.cellHeight + spacing : Variables.defaultMargin + anchors { + left : parent.left + leftMargin : (_root.width / 2) + (_root.columnSpacing * 2) + verticalCenter : _prescriptionMenu.verticalCenter + verticalCenterOffset: -10 + } + QRCode { id: _qrCode + anchors.verticalCenter : parent.verticalCenter + qrcode : vTreatmentCreate.txCode + clear : ! _root.visible + } + + Text { id: _txCode + anchors.bottom : _qrCode.bottom + text : vTreatmentCreate.txCode ? qsTr("Tx Code: ") + vTreatmentCreate.txCode : " " + color : "#DBE9FA" + font.pixelSize : Fonts.fontPixelButton + } + } + + Item { id: _view + anchors { + top : _prescriptionMenu.bottom + topMargin : Variables.defaultMargin * 2 + left : _root.left + right : _root.right + bottom : parent.bottom + } + + PreTreatmentCreateTreatmentSettings { id: _preTreatmentCreateTreatmentSettings; visible: _root.currentIndex === PreTreatmentCreateContent.PatientPrescription } + PreTreatmentCreatePatientPrescription { id: _preTreatmentCreatePatientPrescription; visible: _root.currentIndex === PreTreatmentCreateContent.TreatmentSettings } + } + Grid { id: _contentGrid anchors { - top : _prescriptionTitle.bottom + top : _prescriptionMenu.bottom topMargin : Variables.defaultMargin * 2 left : _root.left right : _root.right @@ -212,8 +280,8 @@ flow : Grid.LeftToRight rows : _root.heparinFeatured ? 7 : 6 columns : 2 - rowSpacing :_root.columnSpacing - columnSpacing : _root.rowSpacing + rowSpacing : _root.columnSpacing + columnSpacing : _root.rowSpacing Item { id: _patientIDItem height : _root.cellHeight @@ -254,25 +322,8 @@ } } - Row { id: _qrRow - height : _root.cellHeight - spacing : Variables.defaultMargin - QRCode { id: _qrCode - anchors.verticalCenter : parent.verticalCenter - anchors.verticalCenterOffset: -5 - qrcode : vTreatmentCreate.txCode - clear : ! _root.visible - } - Text { id: _txCode - anchors.bottom : _qrCode.bottom - text : vTreatmentCreate.txCode ? qsTr("Tx Code: ") + vTreatmentCreate.txCode : " " - color : "#DBE9FA" - font.pixelSize : Fonts.fontPixelButton - } - } - LabelUnitContainer { id: _bloodFlowRate text : qsTr("Blood Flow Rate") unitText : Variables.unitTextFlowRate @@ -296,7 +347,7 @@ LabelUnitContainer { id: _acidConcentrate text : qsTr("Acid Concentrate") - showEdit : _root.editingEnabled +// showEdit : _root.editingEnabled // Hide 👋📋 TODO Phase 2 onEditClicked : _acidConcentrateAdjustment.open() valid : ! vTreatmentCreate.acidConcentrateRejectReason @@ -318,8 +369,10 @@ if ( ! _acidConcentrate.valid ) { vTreatmentCreate.acidConcentrateRejectReason = Variables.noRejectReason } vTreatmentCreate.acidConcentrate = _acidConcentrateComboBox.currentIndex vTreatmentCreate.acidConcentrateSet = true - vTreatmentRanges.doPopulateAcidConcentrate( vTreatmentCreate.acidConcentrateSet, - vTreatmentCreate.acidConcentrate) +// vTreatmentCreate.acidConcentrateConversionFactor = vTreatmentRanges.acidConcentrateValues[vTreatmentCreate.acidConcentrate] + + print( vTreatmentRanges.acidConcentrateModel.get(vTreatmentCreate.acidConcentrate).value ) + } } } @@ -346,23 +399,23 @@ } LabelUnitContainer { id: _bicarbonateConcentrate - text : qsTr("Bicarbonate Concentrate") - valid : ! vTreatmentCreate.bicarbonateConcentrateRejectReason + text : qsTr("Bicarbonate Concentrate Size") + valid : ! vTreatmentCreate.dryBicarbCartSizeRejectReason 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 + isActive : vTreatmentCreate.dryBicarbCartSizeSet enabled : _root.editingEnabled - currentIndex : vTreatmentCreate.bicarbonateConcentrate - model : vTreatmentRanges.bicarbonateConcentrateOptions - onClear : vTreatmentCreate.bicarbonateConcentrateSet = false + currentIndex : vTreatmentCreate.dryBicarbCartSize + model : vTreatmentRanges.dryBicabCartridgeSizeOptions + onClear : vTreatmentCreate.dryBicarbCartSizeSet = false onActivated : { - if ( ! _bicarbonateConcentrate.valid ) { vTreatmentCreate.bicarbonateConcentrateRejectReason = Variables.noRejectReason } - vTreatmentCreate.bicarbonateConcentrate = _bicarbonateConcentrateComboBox.currentIndex - vTreatmentCreate.bicarbonateConcentrateSet = true + if ( ! _bicarbonateConcentrate.valid ) { vTreatmentCreate.dryBicarbCartSizeRejectReason = Variables.noRejectReason } + vTreatmentCreate.dryBicarbCartSize = _bicarbonateConcentrateComboBox.currentIndex + vTreatmentCreate.dryBicarbCartSizeSet = true } } } @@ -386,7 +439,7 @@ vTreatmentCreate.treatmentDuration = vValue // set heparin time to clear when set - if ( _heparinStopTimeControl.enabled ) { _heparinStopTimeControl.clear() } + if ( _heparinDeliveryDurationControl.enabled ) { _heparinDeliveryDurationControl.clear() } } } } @@ -483,21 +536,21 @@ 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() } + if ( ! vTreatmentCreate.heparinDispensingRate && vValue ) { _heparinDeliveryDurationControl.clear() } vTreatmentCreate.heparinDispensingRate = vValue // if set to OFF set heparin stop time 0 if ( ! vTreatmentCreate.heparinDispensingRate ) { - vTreatmentCreate.heparinStopTimeSet = true - vTreatmentCreate.heparinStopTime = 0 + vTreatmentCreate.heparinDeliveryDurationSet = true + vTreatmentCreate.heparinDeliveryDuration = 0 } } onIsActiveChanged: { if ( ! vTreatmentCreate.heparinDispensingRate && isActive ) { - vTreatmentCreate.heparinStopTimeSet = true - vTreatmentCreate.heparinStopTime = 0 + vTreatmentCreate.heparinDeliveryDurationSet = true + vTreatmentCreate.heparinDeliveryDuration = 0 } } } @@ -525,47 +578,47 @@ } } - LabelUnitContainer { id: _heparinStopTime + LabelUnitContainer { id: _heparinDeliveryDuration text : qsTr("Heparin Delivery Duration") unitText : Variables.unitTextDuration - valid : ! vTreatmentCreate.heparinStopTimeRejectReason + valid : ! vTreatmentCreate.heparinDeliveryDurationRejectReason visible : _root.heparinFeatured - contentItem : ValueAdjuster { id: _heparinStopTimeControl + contentItem : ValueAdjuster { id: _heparinDeliveryDurationControl editable : _root.editingEnabled minimum : vTreatmentRanges.heparinStopTimeMin maximum : _durationControl.value step : _durationControl.step defaultValue : _durationControl.value - value : vTreatmentCreate.heparinStopTime + value : vTreatmentCreate.heparinDeliveryDuration enabled : vTreatmentCreate.heparinDispensingRate canOff : true - isActive : vTreatmentCreate.heparinStopTimeSet - onDidActiveChange: function(vState) { vTreatmentCreate.heparinStopTimeSet = vState } + isActive : vTreatmentCreate.heparinDeliveryDurationSet + onDidActiveChange: function(vState) { vTreatmentCreate.heparinDeliveryDurationSet = vState } onDidChange : function(vValue) { - if ( ! _heparinStopTime.valid ) { vTreatmentCreate.heparinStopTimeRejectReason = Variables.noRejectReason } - vTreatmentCreate.heparinStopTime = vValue + if ( ! _heparinDeliveryDuration.valid ) { vTreatmentCreate.heparinDeliveryDurationRejectReason = Variables.noRejectReason } + vTreatmentCreate.heparinDeliveryDuration = vValue } } } - LabelUnitContainer { id: _salineBolusVolume - text : qsTr("Saline Bolus Volume") + LabelUnitContainer { id: _fluidBolusVolume + text : qsTr("Fluid Bolus Volume") unitText : Variables.unitTextFluid - valid : ! vTreatmentCreate.salineBolusVolumeRejectReason + valid : ! vTreatmentCreate.fluidBolusVolumeRejectReason - contentItem : ValueAdjuster { id: _salineBolusVolumeControl + contentItem : ValueAdjuster { id: _fluidBolusVolumeControl 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 } + value : vTreatmentCreate.fluidBolusVolume + isActive : vTreatmentCreate.fluidBolusVolumeSet + onDidActiveChange: function(vState) { vTreatmentCreate.fluidBolusVolumeSet = vState } onDidChange : function(vValue) { - if ( ! _salineBolusVolume.valid ) { vTreatmentCreate.salineBolusVolumeRejectReason = Variables.noRejectReason } - vTreatmentCreate.salineBolusVolume = vValue + if ( ! _fluidBolusVolume.valid ) { vTreatmentCreate.fluidBolusVolumeRejectReason = Variables.noRejectReason } + vTreatmentCreate.fluidBolusVolume = vValue } } }