Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateTreatmentSettings.qml =================================================================== diff -u -r56381aae237db191956aff493907cd1f0801216b -r4a7dd11138d2321f1ab8d324b3bd25f02eaefe84 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateTreatmentSettings.qml (.../PreTreatmentCreateTreatmentSettings.qml) (revision 56381aae237db191956aff493907cd1f0801216b) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateTreatmentSettings.qml (.../PreTreatmentCreateTreatmentSettings.qml) (revision 4a7dd11138d2321f1ab8d324b3bd25f02eaefe84) @@ -1,7 +1,249 @@ -import QtQuick 2.0 +// Qt +import QtQuick 2.15 +import QtQuick.Controls 2.15 -Rectangle { - anchors.fill: parent - color: "red" +// Qml +import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" + +Grid { id: _root + readonly property int cellWidth : Variables.createRxLabelUnitContainerWidth + readonly property int cellHeight : Variables.createRxLabelUnitContainerHeight + readonly property bool heparinFeatured : vSettings.heparinSyringePump + readonly property string patientID : _pretreatmentPatientIDEntry.text + property bool isHDFFeatured : vTreatmentCreate.treatmentModality === HeaderBar.Mode_HDF + + property bool editingEnabled : true + + flow : Grid.TopToBottom + rows : _root.isHDFFeatured ? 7 : 5 + columns : 2 + rowSpacing : 15 + columnSpacing : Variables.defaultMargin * 3 + + onIsHDFFeaturedChanged: { + if ( ! isHDFFeatured ) { + vTreatmentCreate.hdfTreatmentMode = 0 + vTreatmentCreate.substitutionFluidVolume = 0 + } + } + + function refreshAll () { + _subFluidVolume .refresh() + + _ufVolume .refresh() + _bloodFlowRate .refresh() + + _dialysateFlowRateControl .refresh() + _durationControl .refresh() + _heparinDispensingRateControl .refresh() + _heparinBolusVolumeControl .refresh() + _heparinDeliveryDurationControl .refresh() + _dialysateTemperatureControl .refresh() + _fluidBolusVolumeControl .refresh() + _bpMeasurementIntervalControl .refresh() + } + + function clear () { + vTreatmentCreate.patientID = "" + _hdfTreatmentModeComboBox .clear() + _subFluidVolume .clear() + + _ufVolume .clear() + _bloodFlowRate .clear() + + + _dialysateFlowRateControl .clear() + _durationControl .clear() + _heparinDispensingRateControl .clear() + _heparinBolusVolumeControl .clear() + _heparinDeliveryDurationControl .clear() + _acidConcentrateComboBox .clear() + _bicarbonateConcentrateComboBox .clear() + _dialyzerTypeComboBox .clear() + _dialysateTemperatureControl .clear() + _fluidBolusVolumeControl .clear() + _bpMeasurementIntervalControl .clear() + clearErrors() + canEdit (true) + } + + function ready () { + return _root.isHDFFeatured ? _hdfTreatmentModeComboBox .isActive && _hdfTreatmentMode.valid && + _subFluidVolume .isActive && _subFluidVolume .valid : true && + _bloodFlowRate .isActive && _bloodFlowRate .valid && + + _ufVolume .isActive && _ufVolume .valid && + + + + _dialysateFlowRateControl .isActive && _dialysateFlowRate .valid && + _durationControl .isActive && _duration .valid && + ( _root.heparinFeatured ? _heparinDispensingRateControl .isActive && _heparinDispensingRate .valid && + _heparinBolusVolumeControl .isActive && _heparinBolusVolume .valid && + _heparinDeliveryDurationControl .isActive && _heparinDeliveryDuration .valid : true ) && + _acidConcentrateComboBox .isActive && + _bicarbonateConcentrateComboBox .isActive && + _dialyzerTypeComboBox .isActive && + _dialysateTemperatureControl .isActive && _dialysateTemperature .valid && + _fluidBolusVolumeControl .isActive && _fluidBolusVolume .valid && + _bpMeasurementIntervalControl .isActive + } + + LabelUnitContainer { id: _patientID + text : qsTr("Patient ID") + 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 + + 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: _treatmentModality + text : qsTr("Treatment Modality") + valid : ! vTreatmentCreate.treatmentModalityRejectReason + + contentItem : BaseComboBox { id: _treatmentModalityComboBox + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + isActive : true // PRS-215 + enabled : _root.editingEnabled + currentIndex : vTreatmentCreate.treatmentModality + model : vTreatmentRanges.treatmentModalityOptions + + onActivated : { + if ( ! _treatmentModality.valid ) { vTreatmentCreate.treatmentModalityRejectReason = Variables.noRejectReason } + vTreatmentCreate.treatmentModality = _treatmentModalityComboBox.currentIndex + } + } + } + + LabelUnitContainer { id: _hdfTreatmentMode + text : qsTr("HDF Operating Mode") + valid : ! vTreatmentCreate.hdfTreatmentModeRejectReason + visible : _root.isHDFFeatured + + contentItem : BaseComboBox { id: _hdfTreatmentModeComboBox + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + isActive : vTreatmentCreate.hdfTreatmentModeSet + enabled : _root.editingEnabled + currentIndex : vTreatmentCreate.hdfTreatmentMode + model : vTreatmentRanges.hdfTreatmentModeOptions + + onClear : vTreatmentCreate.hdfTreatmentModeSet = false + + onActivated : { + if ( ! _hdfTreatmentMode.valid ) { vTreatmentCreate.hdfTreatmentModeRejectReason = Variables.noRejectReason } + vTreatmentCreate.hdfTreatmentModeSet = true + vTreatmentCreate.hdfTreatmentMode = _hdfTreatmentModeComboBox.currentIndex + } + } + } + + LabelUnitValueAdjuster { id: _subFluidVolume + text : qsTr("Substitution Fluid Volume") + visible : _root.isHDFFeatured + width : _root.cellWidth + height : _root.cellHeight + unitText : Variables.unitVolume + valid : ! vTreatmentCreate.substitutionFluidVolumeRejectionReason + editable : _root.editingEnabled + minimum : vTreatmentRanges.substitutionVolumeMin + maximum : vTreatmentRanges.substitutionVolumeMax + step : vTreatmentRanges.substitutionVolumeRes + defaultValue : vTreatmentRanges.substitutionVolumeDef + decimal : Variables.substitutionPrecision + value : vTreatmentCreate.substitutionFluidVolume + isActive : vTreatmentCreate.substitutionFluidVolumeSet + + onDidActiveChange : function(vState) { vTreatmentCreate.substitutionFluidVolumeSet = vState } + onDidChange : function(vValue) { + if ( ! _ufVolume.valid ) { vTreatmentCreate.substitutionFluidVolumeRejectionReason = Variables.noRejectReason } + vTreatmentCreate.substitutionFluidVolume = vValue + } + } + + LabelUnitValueAdjuster { id: _bloodFlowRate + text : qsTr("Blood Flow Rate") + width : _root.cellWidth + height : _root.cellHeight + unitText : Variables.unitTextFlowRate + valid : ! vTreatmentCreate.bloodFlowRateRejectReason + 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 + } + } + + + + LabelUnitValueAdjuster { id: _ufVolume + text : qsTr("Ultrafiltration Volume") + width : _root.cellWidth + height : _root.cellHeight + unitText : Variables.unitVolume + showEdit : true + valid : ! vTreatmentCreate.ultrafiltrationVolumeRejectionReason + editable : _root.editingEnabled + minimum : vTreatmentRanges.ultrafiltrationVolumeMin + maximum : vTreatmentRanges.ultrafiltrationVolumeMax + step : vTreatmentRanges.ultrafiltrationVolumeRes + defaultValue : vTreatmentRanges.ultrafiltrationVolumeDef + decimal : Variables.ultrafiltrationPrecision + value : vTreatmentCreate.ultrafiltrationVolume + isActive : vTreatmentCreate.ultrafiltrationVolumeSet + + onDidActiveChange : function(vState) { vTreatmentCreate.ultrafiltrationVolumeSet = vState } + onDidChange : function(vValue) { + if ( ! _ufVolume.valid ) { vTreatmentCreate.ultrafiltrationVolumeRejectionReason = Variables.noRejectReason } + vTreatmentCreate.ultrafiltrationVolume = vValue + } + } + + + + + + + + }