Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreatePatientPrescription.qml =================================================================== diff -u -r4a7dd11138d2321f1ab8d324b3bd25f02eaefe84 -r1132f049e169cc87a059261f72fca0ceb7d739f1 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreatePatientPrescription.qml (.../PreTreatmentCreatePatientPrescription.qml) (revision 4a7dd11138d2321f1ab8d324b3bd25f02eaefe84) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreatePatientPrescription.qml (.../PreTreatmentCreatePatientPrescription.qml) (revision 1132f049e169cc87a059261f72fca0ceb7d739f1) @@ -9,17 +9,85 @@ import "qrc:/compounds" -Grid { id: _root +Row { id: _root readonly property int cellWidth : Variables.createRxLabelUnitContainerWidth readonly property int cellHeight : Variables.createRxLabelUnitContainerHeight + property bool editingEnabled : true + property int columnSpacing : 15 + spacing : Variables.defaultMargin * 3 - property bool editingEnabled : true + function setPresetParameters () { + vTreatmentCreate.sodium = vTreatmentRanges.dialysateSodiumDef + vTreatmentCreate.bicarbonate = vTreatmentRanges.dialysateBicarbonateDef + } - flow : Grid.LeftToRight - rows : 7 - columns : 2 - rowSpacing : Variables.defaultMargin * 3 - columnSpacing : Variables.defaultMargin * 3 + function refreshAll () { + _sodium .refresh() + _bicarbonate .refresh() + } + + function clear () { + + _sodium .clear() + _bicarbonate .clear() + clearErrors() + canEdit (true) + } + + function ready () { + return _sodium .isActive && _sodium .valid && + _bicarbonate .isActive && _bicarbonate .valid + } + + Column { id: _leftColumn + spacing : _root.columnSpacing + + LabelUnitValueAdjuster { id: _sodium + text : qsTr("Sodium (Na)") + unitText : Variables.unitTextConcentration + valid : ! vTreatmentCreate.sodiumRejectReason + width : _root.cellWidth + height : _root.cellHeight + editable : _root.editingEnabled + minimum : vTreatmentRanges.dialysateSodiumMin + maximum : vTreatmentRanges.dialysateSodiumMax + step : vTreatmentRanges.dialysateSodiumRes + defaultValue : vTreatmentRanges.dialysateSodiumDef + value : vTreatmentCreate.sodium + isActive : true // PRS-215 + + onDidChange : function(vValue) { + if ( ! _sodium.valid ) { vTreatmentCreate.sodiumRejectReason = Variables.noRejectReason } + vTreatmentCreate.sodium = vValue + } + } + + LabelUnitValueAdjuster { id: _bicarbonate + text : qsTr("Bicarbonate") + unitText : Variables.unitTextConcentration + valid : ! vTreatmentCreate.bicarbonateRejectReason + width : _root.cellWidth + height : _root.cellHeight + editable : _root.editingEnabled + minimum : vTreatmentRanges.dialysateBicarbonateMin + maximum : vTreatmentRanges.dialysateBicarbonateMax + step : vTreatmentRanges.dialysateBicarbonateRes + defaultValue : vTreatmentRanges.dialysateBicarbonateDef + value : vTreatmentCreate.bicarbonate + isActive : true // PRS-215 + + onDidChange : function(vValue) { + if ( ! _sodium.valid ) { vTreatmentCreate.bicarbonateRejectReason = Variables.noRejectReason } + vTreatmentCreate.bicarbonate = vValue + } + } + + } + + Column { id: _rightColumn + spacing : _root.columnSpacing + + } }