Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -31,12 +31,14 @@ readonly property int columnSpacing : 15 readonly property bool isValidated : vTreatmentCreate.parametersValidated readonly property bool heparinFeatured: true // TODO: vSettings.heparinSyringePump + property alias patientIdText: _pretreatmentPatientIDEntry.text readonly property string editRx : qsTr( "Edit Rx" ) readonly property string selectRx : qsTr( "Select Rx" ) readonly property string clearAll : qsTr( "Clear All" ) property bool editingEnabled : true + property bool isRxProfile : false onIsValidatedChanged : canEdit ( ! isValidated ) @@ -71,6 +73,7 @@ function clear () { vTreatmentCreate.patientID = "" + _pretreatmentPatientIDEntry.text = "" _bloodFlowRateControl .clear() _dialysateFlowRateControl .clear() _durationControl .clear() @@ -114,7 +117,8 @@ _dialyzerTypeComboBox .isActive && _dialysateTemperatureControl .isActive && _dialysateTemperature .valid && _salineBolusVolumeControl .isActive && _salineBolusVolume .valid && - _bpMeasurementIntervalControl .isActive + _bpMeasurementIntervalControl .isActive && + (_root.isRxProfile ? _patientID.text != "" : true ) } function validate () { @@ -191,9 +195,11 @@ if ( vTreatmentCreate.parametersValidated ) { vTreatmentCreate.doCancel() } if ( selectedItem === _root.editRx ) { /*All parameters set to edit if parameters are validated */ } - else if ( selectedItem === _root.selectRx ) { print("TODO: Open and Select from Prescription Manager") } + else if ( selectedItem === _root.selectRx ) { print("TODO: Open and Select from Prescription Manager") + _rxManagerDialog.open() } else if ( selectedItem === _root.clearAll ) { _root.clear() } else { /*Unknown state */ } + } } @@ -218,25 +224,28 @@ LabelUnitContainer { id: _patientID anchors.verticalCenter : parent.verticalCenter - text : qsTr("Patient ID") + text :_root.isRxProfile ? qsTr("Profile Name") : qsTr("Patient ID") height : cellHeight - Variables.defaultMargin contentArea.anchors.leftMargin : 120 contentItem : TextEntry { id: _pretreatmentPatientIDEntry - clip : true textInput.width : parent.width - Variables.defaultMargin * 4 + clip : true 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 + inputColor : Colors.textMain onEditingFinished : vTreatmentCreate.patientID = text + textInput.validator : RegExpValidator { regExp: _root.isRxProfile + ? Variables.regExp_RxProfileName + : Variables.regExp_PatientID } Text { id: _patientIDPlaceHolderText text : Variables.emptyEntry anchors.fill : parent @@ -258,13 +267,13 @@ QRCode { id: _qrCode anchors.verticalCenter : parent.verticalCenter anchors.verticalCenterOffset: -5 - qrcode : vTreatmentCreate.txCode + qrcode : _root.isRxProfile ? "" : vTreatmentCreate.txCode clear : ! _root.visible } Text { id: _txCode anchors.bottom : _qrCode.bottom - text : vTreatmentCreate.txCode ? qsTr("Tx Code: ") + vTreatmentCreate.txCode : " " + text : _root.isRxProfile ? " " : (vTreatmentCreate.txCode ? qsTr("Tx Code: ") + vTreatmentCreate.txCode : " ") color : "#DBE9FA" font.pixelSize : Fonts.fontPixelButton }