Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml =================================================================== diff -u -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 -r3b323bd6a1a03429c2321a889049de1c3b11302f --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml (.../PreTreatmentCreateStack.qml) (revision 821bf955d0ba7e028bccfee7c04ca77cf80a0bd4) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml (.../PreTreatmentCreateStack.qml) (revision 3b323bd6a1a03429c2321a889049de1c3b11302f) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file PreTreatmentCreateStack.qml * \author (last) Behrouz NematiPour - * \date (last) 28-Feb-2021 + * \date (last) 13-Mar-2024 * \author (original) Behrouz NematiPour - * \date (original) 28-Feb-2021 + * \date (original) 12-Mar-2021 * */ @@ -20,6 +20,7 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages/pretreatment" import "qrc:/pages/pretreatment/create" /*! * \brief the pre treatment parameters create stack screen @@ -31,6 +32,64 @@ property int stackStepIndex : 0 + property alias patientID: _pretreatmentPatientIDEntry.text + + function setPatientID(vPatientID) { + vTreatmentCreate .patientID = vPatientID // in case it needs to be displayed on Pre-Treatment Confirm Screen + vPostTreatmentAdjustmentTreatmentLog.patientID = vPatientID // store for the TreatmentLog + } + + function pagePatientID( vCondition ) { + if ( vCondition !== undefined && vCondition === false ) { + _keyboard.setVisible(false) + return + } + + _pretreatmentPatientID.clear () + page( _pretreatmentPatientID ) + _pretreatmentPatientID.setFocus() + } + + function clear(vValue) { + if ( ! vValue ) return // delete only if asked to. // is used on state enter, and not done on exiting. + _pretreatmentPatientID.clear() + _pretreatmentCreate.clear() + } + + PreTreatmentBase { id: _pretreatmentPatientID + function clear() { + vTreatmentCreate.patientID = "" + } + + function setFocus() { + _pretreatmentPatientIDEntry.textInput.forceActiveFocus() + _keyboard.setVisible(true) + } + + title.text : qsTr("Patient ID") + header.backVisible : true + header.confirmVisible : true + header.confirmText.text : _pretreatmentPatientIDEntry.text ? qsTr("CONTINUE") : qsTr("SKIP") + TextEntry { id : _pretreatmentPatientIDEntry + property int topMarginContent : 200 + + clip : true + hasCursor : true + textInput .width : 450 + text : vTreatmentCreate.patientID + anchors { + top : parent.top + topMargin : topMarginContent + 120 // moved a little down to be more on center and close to keyboard top edge. + horizontalCenter: parent.horizontalCenter + } + textInput.inputMethodHints : Qt.ImhPreferLowercase + textInput.echoMode : TextInput.Normal + textInput.validator : RegExpValidator { + regExp: Variables.regExp_PatientID + } + } + } + PreTreatmentCreate { id: _pretreatmentCreate header.backVisible : true header.confirmVisible : true @@ -45,22 +104,37 @@ } Connections { target: vHDOperationMode - onValidateParametersChanged : { page( _pretreatmentCreate , vvalidateParameters )} + function onValidateParametersChanged ( vValue ) { pagePatientID ( vValue )} } - Connections { target: vTreatmentCreate - onFwValidationSuccess : { page( _pretreatmentConfirm )} + Connections { target: _pretreatmentPatientID + function onBackClicked ( ) { vPreTreatmentAdjustmentInitTreatment.doCancel ()} + function onConfirmClicked ( ) { setPatientID ( _root.patientID ) + page( _pretreatmentCreate )} } Connections { target: _pretreatmentCreate - onBackClicked : { vPreTreatmentAdjustmentInitTreatment.doCancel ()} - onConfirmClicked : { vTreatmentCreate.doValidation ()} + function onBackClicked ( ) { pagePatientID ()} + function onConfirmClicked ( ) { + 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.rinsebackFlowRate = vTreatmentRanges.rinsebackFlowRateDef // these parameters don't have a user option on create treatment, so sending the default. + vTreatmentCreate.doValidation ( ) + } } + Connections { target: vTreatmentCreate + function onDidValidationPass ( vValue ) { page( _pretreatmentConfirm ) + vPostTreatmentAdjustmentTreatmentLog.heparinDispensingRateOff = vTreatmentCreate.heparinDispensingRateOff + vPostTreatmentAdjustmentTreatmentLog.heparinBolusVolumeOff = vTreatmentCreate.heparinBolusVolumeOff + } + } + Connections { target: _pretreatmentConfirm - onBackClicked : { vTreatmentCreate.doCancel () - page( _pretreatmentCreate )} - onConfirmClicked : { vTreatmentCreate.doConfirm ()} + function onBackClicked ( ) { vTreatmentCreate.doCancel () + page( _pretreatmentCreate )} + function onConfirmClicked ( ) { vTreatmentCreate.doConfirm ()} } onVisibleChanged: {