/*! * * Copyright (c) 2020-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 VTreatmentCreate.h * \author (last) Behrouz NematiPour * \date (last) 24-Jan-2024 * \author (original) Peter Lucia * \date (original) 22-Sep-2020 * */ #pragma once // Qt #include #include #include #include #include #include // Project #include "MPreTreatmentAdjustParametersValidationResponse.h" #include "MAdjustHDSerialNumberResponse.h" #include "GuiController.h" #include "StorageGlobals.h" #include "VView.h" // forward declaration class tst_views; using namespace Storage; using namespace Gui; using namespace Model; namespace View { /*! * \brief The VCreateTreatment class * * The Create Treatment View manages the pre-treatment parameter selection entry and validation. * * \details The Create Treatment View manages data display and translation between the user interface * and treatment parameter and treatment parameter response models. * * Upon HD messaging with confirmation of the current parameter selection, * the Create Treatment View segues to the Create Treatment confirmation screen. * * Upon HD messaging with a list of one or more invalid parameters, the Create Treatment View * will signal the invalid parameters to the GUI so the user can make adjustments. * * The Create Treatment View replicates the validation function used by FW to mitigate * incompatible parameter selection situations. * * When a user modifies treatment parameters: * - The treatment parameters model is populated with the data * - The data is validated for correctness and compatibility * - The continue button is enabled upon success so FW can validate the parameter selection * * \sa Model::MAdjustParametersValidationResponse * \sa Model::MAdjustParametersConfirmReq * \sa Model::MInitTreatmentReq * \sa Model::MConfirmTreatmentReq * \sa Model::MAdjustInitTreatmentResponse */ class VTreatmentCreate : public QObject { Q_OBJECT // friends friend class::tst_views; QString _HDSerialNumber = ""; PROPERTY(bool , heparinDispensingRateOff , true) PROPERTY(bool , heparinBolusVolumeOff , true) VALUESET(quint32 , bloodFlowRate , 0) VALUESET(quint32 , dialysateFlowRate , 0) VALUESET(quint32 , treatmentDuration , 0) VALUESET(quint32 , salineBolusVolume , 0) VALUESET(quint32 , heparinStopTime , 0) VALUESET(quint32 , heparinType , 0) VALUESET(quint32 , acidConcentrate , 0) VALUESET(quint32 , bicarbonateConcentrate , 0) VALUESET(quint32 , dialyzerType , 0) VALUESET(quint32 , bloodPressureMeasureInterval , 0) VALUESET(quint32 , rinsebackFlowRate , 0) VALUESET(quint32 , rinsebackVolume , 0) VALUESET(qint32 , arterialPressureLimitWindow , 0) VALUESET(qint32 , venousPressureLimitWindow , 0) VALUESET(qint32 , venousPressureLimitAsymtrc , 0) VALUESET(qint32 , trancembrncPressureLimitWindow , 0) VALUESET(float , dialysateTemp , 0) VALUESET(float , heparinDispensingRate , 0) VALUESET(float , heparinBolusVolume , 0) VALUESET(QString , patientID ,"") VALUESET(bool , continueEnabled , 0) PROPERTY(QString , txCode ,"") TRIGGER(quint32 , bloodFlowRateRejectReason , 0) TRIGGER(quint32 , dialysateFlowRateRejectReason , 0) TRIGGER(quint32 , treatmentDurationRejectReason , 0) TRIGGER(quint32 , heparinDispensingRateRejectReason , 0) TRIGGER(quint32 , heparinBolusVolumeRejectReason , 0) TRIGGER(quint32 , heparinStopTimeRejectReason , 0) TRIGGER(quint32 , salineBolusVolumeRejectReason , 0) TRIGGER(quint32 , heparinTypeRejectReason , 0) TRIGGER(quint32 , acidConcentrateRejectReason , 0) TRIGGER(quint32 , bicarbonateConcentrateRejectReason , 0) TRIGGER(quint32 , dialyzerTypeRejectReason , 0) TRIGGER(quint32 , dialysateTempRejectReason , 0) TRIGGER(quint32 , arterialPressureLimitWindowRejectReason , 0) TRIGGER(quint32 , venousPressureLimitWindowRejectReason , 0) TRIGGER(quint32 , venousPressureLimitAsymtrcRejectReason , 0) TRIGGER(quint32 , bloodPressureMeasureIntervalRejectReason , 0) TRIGGER(quint32 , rinsebackFlowRateRejectReason , 0) TRIGGER(quint32 , rinsebackVolumeRejectReason , 0) TRIGGER(quint32 , trancembrncPressureLimitWindowRejectReason , 0) VIEW_DEC_CLASS(VTreatmentCreate) VIEW_DEC_SLOT(AdjustParametersValidationResponseData) VIEW_DEC_SLOT(AdjustSerialNumberHDResponseData) private: QString enumToString(GuiRequestReasons vEnum); void generateTxCode(); signals: void didAdjustment(const AdjustParametersValidationRequestData &data); void didAdjustment(const AdjustParametersConfirmRequestData &data); void didValidationFail(); void didValidationPass(); public slots: void doValidation (); void doConfirm (); void doCancel (); QStringList doGetPrescriptionParameterValues(); QStringList doGetOperatingParameterValues(); }; }