/*! * * Copyright (c) 2020-2022 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) 19-Jul-2022 * \author (original) Peter Lucia * \date (original) 22-Sep-2020 * */ #pragma once // Qt #include #include #include #include #include #include // Project #include "MPreTreatmentAdjustParametersValidationResponse.h" #include "GuiController.h" #include "StorageGlobals.h" #include "VView.h" // forward declaration class tst_views; using namespace Storage; using namespace Gui; using namespace Model; #define UNSET 9999 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; VALUESET(quint32 , bloodFlowRate , 0) VALUESET(quint32 , dialysateFlowRate , 0) VALUESET(quint32 , treatmentDuration , 0) VALUESET(float , heparinDispensingRate , 0) VALUESET(float , heparinBolusVolume , 0) VALUESET(quint32 , heparinStopTime , 0) VALUESET(quint32 , salineBolusVolume , 0) VALUESET(quint32 , heparinType , 0) VALUESET(quint32 , acidConcentrate , 0) VALUESET(quint32 , bicarbonateConcentrate , 0) VALUESET(quint32 , dialyzerType , 0) VALUESET(qreal , dialysateTemp , 0) VALUESET(qint32 , arterialPressureLimitLow , 0) VALUESET(qint32 , arterialPressureLimitHigh , 0) VALUESET(qint32 , venousPressureLimitLow , 0) VALUESET(qint32 , venousPressureLimitHigh , 0) VALUESET(quint32 , bloodPressureMeasureInterval , 0) VALUESET(quint32 , rinsebackFlowRate , 0) VALUESET(QString , patientID ,"") VALUESET(bool , continueEnabled , 0) VIEW_DEC_CLASS(VTreatmentCreate) VIEW_DEC_SLOT(AdjustParametersValidationResponseData) private: QString enumToString(GuiRequestReasons vEnum); signals: void didAdjustment(const AdjustParametersValidationRequestData &data); void didAdjustment(const AdjustParametersConfirmRequestData &data); void fwValidationFailed(QString reason); void fwValidationSuccess(); void scrollToParameter(QString parameter); public slots: void doValidation (); void doConfirm (); void doCancel (); QStringList doGetPrescriptionParameterValues(); QStringList doGetOperatingParameterValues(); }; }