Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentSetPoints.qml =================================================================== diff -u -rf7f4a55f5476526408708722bad1367c4db79936 -r5601274da6b6a67a1887c3994640a47549ae9e26 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentSetPoints.qml (.../TreatmentAdjustmentSetPoints.qml) (revision f7f4a55f5476526408708722bad1367c4db79936) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentSetPoints.qml (.../TreatmentAdjustmentSetPoints.qml) (revision 5601274da6b6a67a1887c3994640a47549ae9e26) @@ -40,6 +40,15 @@ readonly property alias bicarbConcentrate : _bicarbConcentrateComboBox.currentIndex readonly property alias sodium : _sodium.value readonly property alias bicarbonate : _bicarbonate.value + readonly property bool isValid : _treatmentModality .valid && + _bloodFlowRate .valid && + _dialysateFlowRate .valid && + _dialysateTemperature .valid && + _hepatitusStatus .valid && + _acidConcentrate .valid && + _bicarbConcentrate .valid && + _sodium .valid && + _bicarbonate width : 1540 height : 865 @@ -102,7 +111,8 @@ LabelUnitContainer { id: _treatmentModality text : qsTr("Treatment Modality") - width : _private.containerWidth + width : _private.containerWidth + valid : ! vTreatmentAdjustmentSetPoints.treatmentModalityRejectionReason contentItem : BaseComboBox { id: _treatmentModalityComboBox anchors.rightMargin : Variables.defaultMargin * 2 @@ -113,6 +123,7 @@ currentIndex : vTreatmentCreate.treatmentModality model : vTreatmentRanges.treatmentModalityOptions centerHorizontally : true + onActivated : if ( ! _treatmentModality.valid ) { vTreatmentAdjustmentSetPoints.treatmentModalityRejectionReason = Variables.noRejectReason } } } @@ -128,8 +139,12 @@ minimum : vTreatmentRanges.bloodFlowRateMin maximum : vTreatmentRanges.bloodFlowRateMax step : vTreatmentRanges.bloodFlowRateRes + valid : ! vTreatmentAdjustmentSetPoints.bloodFlowRateRejectionReason - onDidChange : function(vValue) { value = vValue } + onDidChange : function(vValue) { + if ( ! _bloodFlowRate.valid ) { vTreatmentAdjustmentSetPoints.bloodFlowRateRejectionReason = Variables.noRejectReason } + value = vValue + } } LabelUnitValueAdjuster { id: _dialysateFlowRate @@ -145,8 +160,12 @@ maximum : vTreatmentRanges.dialysateFlowRateMax step : vTreatmentRanges.dialysateFlowRateRes canOff : true + valid : ! vTreatmentAdjustmentSetPoints.dialysateFlowRateRejectionReason - onDidChange : function(vValue) { value = vValue } + onDidChange : function(vValue) { + if ( ! _dialysateFlowRate.valid ) { vTreatmentAdjustmentSetPoints.dialysateFlowRateRejectionReason = Variables.noRejectReason } + value = vValue + } } LabelUnitValueAdjuster { id: _dialysateTemperature @@ -161,18 +180,24 @@ minimum : vTreatmentRanges.dialysateTempMin maximum : vTreatmentRanges.dialysateTempMax step : vTreatmentRanges.dialysateTempRes + valid : ! vTreatmentAdjustmentSetPoints.dialysateTemperatureRejectionReason - onDidChange : function(vValue) { value = vValue } + onDidChange : function(vValue) { + if ( ! _dialysateTemperature.valid ) { vTreatmentAdjustmentSetPoints.dialysateTemperatureRejectionReason = Variables.noRejectReason } + value = vValue + } } LabelUnitContainer { id: _hepatitusStatus text : qsTr("Hepatitus Status") - width : _private.containerWidth + width : _private.containerWidth + valid : ! vTreatmentAdjustmentSetPoints.hepatitusRejectionReason contentItem : ValueAdjusterCustom { id: _hepatitusStatusControl value : vTreatmentCreate.hepatitusBStatus defaultValue : vTreatmentCreate.hepatitusBStatus model : vTreatmentRanges.hepatitisStatus + onDidChange : function(vValue) { if ( ! _hepatitusStatus.valid ) { vTreatmentAdjustmentSetPoints.hepatitusRejectionReason = Variables.noRejectReason } } } } } @@ -190,6 +215,7 @@ unitFontSize : _private.unitFontPixelSize // showEdit : _root.editingEnabled // Hide 👋📋 TODO Phase 2 onEditClicked : _acidConcentrateAdjustment.open() + valid : ! vTreatmentAdjustmentSetPoints.acidConcentrateRejectionReason && ! vTreatmentAdjustmentSetPoints.acidConcentrateConversionFactorRejectionReason contentItem: BaseComboBox { id: _acidConcentrateComboBox objectName : "_acidConcentrateComboBox" @@ -203,6 +229,9 @@ isActive : true currentIndex : vTreatmentCreate.acidConcentrate model : vTreatmentRanges.acidConcentrateOptions + + onActivated : if ( ! _acidConcentrate.valid ) { vTreatmentAdjustmentSetPoints.acidConcentrateRejectionReason = Variables.noRejectReason; + vTreatmentAdjustmentSetPoints.acidConcentrateConversionFactorRejectionReason = Variables.noRejectReason } } } @@ -213,6 +242,7 @@ text : qsTr("Bicarbonate Concentrate Size") titleFontSize : _private.titleFontPixelSize unitFontSize : _private.unitFontPixelSize + valid : ! vTreatmentAdjustmentSetPoints.bicarbConcentrateRejectionReason contentItem: BaseComboBox { id: _bicarbConcentrateComboBox objectName : "_bicarbConcentrateComboBox" @@ -226,6 +256,8 @@ isActive : true currentIndex : vTreatmentCreate.dryBicarbCartSize model : vTreatmentRanges.dryBicabCartridgeSizeOptions + + onActivated : if ( ! _bicarbConcentrate.valid ) { vTreatmentAdjustmentSetPoints.bicarbConcentrateRejectionReason = Variables.noRejectReason } } } @@ -239,8 +271,12 @@ defaultValue : vTreatmentRanges.dialysateSodiumDef value : vTreatmentCreate.sodium isActive : true + valid : ! vTreatmentAdjustmentSetPoints.sodiumRejectionReason - onDidChange : function(vValue) { value = vValue } + onDidChange : function(vValue) { + if ( ! _sodium.valid ) { vTreatmentAdjustmentSetPoints.sodiumRejectionReason = Variables.noRejectReason } + value = vValue + } } LabelUnitValueAdjuster { id: _bicarbonate @@ -253,8 +289,12 @@ defaultValue : vTreatmentRanges.dialysateBicarbonateDef value : vTreatmentCreate.bicarbonate isActive : true + valid : ! vTreatmentAdjustmentSetPoints.bicarbonateRejectionReason - onDidChange : function(vValue) { value = vValue } + onDidChange : function(vValue) { + if ( ! _bicarbonate.valid ) { vTreatmentAdjustmentSetPoints.bicarbonateRejectionReason = Variables.noRejectReason } + value = vValue + } } } } @@ -274,6 +314,7 @@ font.weight : Font.Medium } isDefault : true + enabled : _root.isValid onClicked : { _root.confirmClicked() } }