Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r9c2a4c5abe3a93c3b3a7ed3d6fd9e12f0c161b3c -r5601274da6b6a67a1887c3994640a47549ae9e26 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 9c2a4c5abe3a93c3b3a7ed3d6fd9e12f0c161b3c) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 5601274da6b6a67a1887c3994640a47549ae9e26) @@ -202,14 +202,13 @@ Connections { target: vTreatmentAdjustmentSetPoints function onAdjustmentTriggered ( vValue ) { if (vTreatmentAdjustmentSetPoints.adjustment_Accepted) { - // TODO update setpoints here? - vTreatmentCreate.treatmentModality = _treatmentAdjustmentSetPoints.treatmentModality + vTreatmentCreate.treatmentModality = _treatmentAdjustmentSetPoints.treatmentModality vTreatmentCreate.acidConcentrate = _treatmentAdjustmentSetPoints.acidConcentrate vTreatmentCreate.dryBicarbCartSize = _treatmentAdjustmentSetPoints.bicarbConcentrate vTreatmentCreate.hepatitusBStatus = _treatmentAdjustmentSetPoints.hepatitus vTreatmentCreate.sodium = _treatmentAdjustmentSetPoints.sodium vTreatmentCreate.bicarbonate = _treatmentAdjustmentSetPoints.bicarbonate - _treatmentAdjustmentSetPoints.close() + if ( _treatmentAdjustmentSetPoints.isValid ) { _treatmentAdjustmentSetPoints.close() } } else { _treatmentAdjustmentSetPoints.notification.text = vTreatmentAdjustmentSetPoints.text() 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() } } Index: sources/model/td/adjustment/treatment/MTreatmentAdjustSetPointsResponse.cpp =================================================================== diff -u -r48343520806859178923efdcca8a95f6af8599e9 -r5601274da6b6a67a1887c3994640a47549ae9e26 --- sources/model/td/adjustment/treatment/MTreatmentAdjustSetPointsResponse.cpp (.../MTreatmentAdjustSetPointsResponse.cpp) (revision 48343520806859178923efdcca8a95f6af8599e9) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustSetPointsResponse.cpp (.../MTreatmentAdjustSetPointsResponse.cpp) (revision 5601274da6b6a67a1887c3994640a47549ae9e26) @@ -18,15 +18,33 @@ QVariantList MAdjustSetPointsResponse::parameters() const { return { - _data.mAccepted .value, - _data.mReason .value, + _data.mAccepted .value, + _data.mBloodFlowRateRejectionReason .value, + _data.mDialysateFlowRateRejectionReason .value, + _data.mDialysateTemperatureRejectionReason .value, + _data.mAcidConcentrateRejectionReason .value, + _data.mAcidConcentrateConversionFactorRejectionReason .value, + _data.mBicarbConcentrateRejectionReason .value, + _data.mTreatmentModalityRejectionReason .value, + _data.mHepatitusRejectionReason .value, + _data.mSodiumRejectionReason .value, + _data.mBicarbonateRejectionReason .value, }; } bool MAdjustSetPointsResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position - if ( ! GetValue(vByteArray, index, _data.mAccepted )) goto lError; - if ( ! GetValue(vByteArray, index, _data.mReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mAccepted )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mBloodFlowRateRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mDialysateFlowRateRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mDialysateTemperatureRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mAcidConcentrateRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mAcidConcentrateConversionFactorRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mBicarbConcentrateRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mTreatmentModalityRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mHepatitusRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mSodiumRejectionReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mBicarbonateRejectionReason )) goto lError; return true ; @@ -43,7 +61,16 @@ */ AdjustSetPointsResponseData MAdjustSetPointsResponse::data() const { Data data; - data.mAccepted = _data.mAccepted .value; - data.mReason = _data.mReason .value; + data.mAccepted = _data.mAccepted .value; + data.mBloodFlowRateRejectionReason = _data.mBloodFlowRateRejectionReason .value; + data.mDialysateFlowRateRejectionReason = _data.mDialysateFlowRateRejectionReason .value; + data.mDialysateTemperatureRejectionReason = _data.mDialysateTemperatureRejectionReason .value; + data.mAcidConcentrateRejectionReason = _data.mAcidConcentrateRejectionReason .value; + data.mAcidConcentrateConversionFactorRejectionReason = _data.mAcidConcentrateConversionFactorRejectionReason .value; + data.mBicarbConcentrateRejectionReason = _data.mBicarbConcentrateRejectionReason .value; + data.mTreatmentModalityRejectionReason = _data.mTreatmentModalityRejectionReason .value; + data.mHepatitusRejectionReason = _data.mHepatitusRejectionReason .value; + data.mSodiumRejectionReason = _data.mSodiumRejectionReason .value; + data.mBicarbonateRejectionReason = _data.mBicarbonateRejectionReason .value; return data; } Index: sources/model/td/adjustment/treatment/MTreatmentAdjustSetPointsResponse.h =================================================================== diff -u -r8325066ffcce349e21df74e33bd3d298d3042ef3 -r5601274da6b6a67a1887c3994640a47549ae9e26 --- sources/model/td/adjustment/treatment/MTreatmentAdjustSetPointsResponse.h (.../MTreatmentAdjustSetPointsResponse.h) (revision 8325066ffcce349e21df74e33bd3d298d3042ef3) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustSetPointsResponse.h (.../MTreatmentAdjustSetPointsResponse.h) (revision 5601274da6b6a67a1887c3994640a47549ae9e26) @@ -36,8 +36,17 @@ * * | Payload || * | || - * | #1:(U32) | \ref Data::mAccepted | - * | #2:(U32) | \ref Data::mReason | + * | #1:(U32) | \ref mAccepted | + * | #2:(U32) | \ref mBloodFlowRateRejectionReason | + * | #3:(U32) | \ref mDialysateFlowRateRejectionReason | + * | #4:(U32) | \ref mDialysateTemperatureRejectionReason | + * | #5:(U32) | \ref mAcidConcentrateRejectionReason | + * | #6:(U32) | \ref mAcidConcentrateConversionFactorRejectionReason | + * | #7:(U32) | \ref mBicarbConcentrateRejectionReason | + * | #8:(U32) | \ref mTreatmentModalityRejectionReason | + * | #9:(U32) | \ref mHepatitusRejectionReason | + * | #10:(U32)| \ref mSodiumRejectionReason | + * | #11:(U32)| \ref mBicarbonateRejectionReason | * * \sa Data * \sa MAdjustSetPointsReq : Adjust Set Points Request @@ -59,19 +68,37 @@ QVariantList parameters() const override; struct { - Types::U32 mAccepted ; - Types::U32 mReason ; + Types::U32 mAccepted ; + Types::U32 mBloodFlowRateRejectionReason ; + Types::U32 mDialysateFlowRateRejectionReason ; + Types::U32 mDialysateTemperatureRejectionReason ; + Types::U32 mAcidConcentrateRejectionReason ; + Types::U32 mAcidConcentrateConversionFactorRejectionReason ; + Types::U32 mBicarbConcentrateRejectionReason ; + Types::U32 mTreatmentModalityRejectionReason ; + Types::U32 mHepatitusRejectionReason ; + Types::U32 mSodiumRejectionReason ; + Types::U32 mBicarbonateRejectionReason ; } _data; public: Type_Enum typeText () const override { return Type_Enum::eEvent ; } Unit_Enum unitText () const override { return Unit_Enum::eTD ; } - QString infoText () const override { return QString("AdjustSetPoints") ; } + QString infoText () const override { return QString("AdjustSetPoints") ; } struct Data { - bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ - quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mBloodFlowRateRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mDialysateFlowRateRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mDialysateTemperatureRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mAcidConcentrateRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mAcidConcentrateConversionFactorRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mBicarbConcentrateRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mTreatmentModalityRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mHepatitusRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mSodiumRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mBicarbonateRejectionReason = 0; /*!< Reason value of type quint32 extracted out */ }; MAdjustSetPointsResponse () { } Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentSetPoints.cpp =================================================================== diff -u -rb2db816026524a19086e900eef867d7f5a3aa6f2 -r5601274da6b6a67a1887c3994640a47549ae9e26 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentSetPoints.cpp (.../VTreatmentAdjustmentSetPoints.cpp) (revision b2db816026524a19086e900eef867d7f5a3aa6f2) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentSetPoints.cpp (.../VTreatmentAdjustmentSetPoints.cpp) (revision 5601274da6b6a67a1887c3994640a47549ae9e26) @@ -29,8 +29,18 @@ void VTreatmentAdjustmentSetPoints::onActionReceive(const AdjustSetPointsResponseData &vData) { adjustment_Accepted ( vData.mAccepted ); - adjustment_Reason ( vData.mReason ); + bloodFlowRateRejectionReason (vData.mBloodFlowRateRejectionReason ); + dialysateFlowRateRejectionReason (vData.mDialysateFlowRateRejectionReason ); + dialysateTemperatureRejectionReason (vData.mDialysateTemperatureRejectionReason ); + acidConcentrateRejectionReason (vData.mAcidConcentrateRejectionReason ); + acidConcentrateConversionFactorRejectionReason (vData.mAcidConcentrateConversionFactorRejectionReason ); + bicarbConcentrateRejectionReason (vData.mBicarbConcentrateRejectionReason ); + treatmentModalityRejectionReason (vData.mTreatmentModalityRejectionReason ); + hepatitusRejectionReason (vData.mHepatitusRejectionReason ); + sodiumRejectionReason (vData.mSodiumRejectionReason ); + bicarbonateRejectionReason (vData.mBicarbonateRejectionReason ); + // *** has to be the last to let the information to be set and then emit the signal *** // *** otherwise will use the previous values before being set. *** adjustment ( true ); Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentSetPoints.h =================================================================== diff -u -rb2db816026524a19086e900eef867d7f5a3aa6f2 -r5601274da6b6a67a1887c3994640a47549ae9e26 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentSetPoints.h (.../VTreatmentAdjustmentSetPoints.h) (revision b2db816026524a19086e900eef867d7f5a3aa6f2) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentSetPoints.h (.../VTreatmentAdjustmentSetPoints.h) (revision 5601274da6b6a67a1887c3994640a47549ae9e26) @@ -41,8 +41,19 @@ // The property adjustment_Triggered has to be always true // and to always trigger the change event to work as a notifier for GUI - TRIGGER( bool , adjustment , 0 ) + TRIGGER( bool , adjustment , 0) + TRIGGER(quint32 , bloodFlowRateRejectionReason , 0) + TRIGGER(quint32 , dialysateFlowRateRejectionReason , 0) + TRIGGER(quint32 , dialysateTemperatureRejectionReason , 0) + TRIGGER(quint32 , acidConcentrateRejectionReason , 0) + TRIGGER(quint32 , acidConcentrateConversionFactorRejectionReason , 0) + TRIGGER(quint32 , bicarbConcentrateRejectionReason , 0) + TRIGGER(quint32 , treatmentModalityRejectionReason , 0) + TRIGGER(quint32 , hepatitusRejectionReason , 0) + TRIGGER(quint32 , sodiumRejectionReason , 0) + TRIGGER(quint32 , bicarbonateRejectionReason , 0) + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentSetPoints, AdjustSetPointsResponseData) public slots: