/*! * * 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 MPreTreatmentAdjustRequests.h * \author (last) Behrouz NematiPour * \date (last) 31-May-2023 * \author (original) Behrouz NematiPour * \date (original) 11-Apr-2021 * */ #pragma once // Qt #include //project #include "MAdjustRequestsBase.h" #include "GuiGlobals.h" #include "MessageGlobals.h" using namespace Gui; namespace Model { /*! * Simple request models * These are models to send the request for the doAdjustment * The the only reason thy have been defined to help overloading the adjustment methods * Otherwise the parameters are so tiny models. */ /*! * \brief The MAdjustInitiateTreatmentReq class * \details The model to request starting a treatment * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:----:|:------:|:----:|:---:|:---:|:----:|:-------------------------:| * |0x4500| 0x041 | Req | Y | UI | TD | Initiate Treatment Request| * * | Payload || * | || * | #1:(U32) | \ref requestedState | * */ class MAdjustInitTreatmentReq : public MModel { public: enum Options { eUnknown = -1, eCancel = 0, eInitiate = 1, }; Options requestedState = eUnknown; QString toString() { return toString({requestedState}); } static QString toString(const QVariantList &vParameters) { return MModel::toString("InitTreatment", vParameters); } }; /*! * \brief The MAdjustParametersValidationReq class * \details The model used to request treatment parameters validation * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:-----------------------------------------:| * |0x3500| 0x100 | 9 | Req | Y | UI | HD | Validate New Treatment Parameters Request | * * | Payload || * | || * | #01:(U32) | \ref mBloodFlowRate | * | #02:(U32) | \ref mDialysateFlowRate | * | #03:(U32) | \ref mTreatmentDuration | * | #04:(U32) | \ref mSalineBolusVolume | * | #05:(U32) | \ref mHeparinStopTime | * | #06:(U32) | \ref mHeparinType | * | #07:(U32) | \ref mAcidConcentrate | * | #08:(U32) | \ref mBicarbonateConcentrate | * | #09:(U32) | \ref mDialyzerType | * | #10:(U32) | \ref mBloodPressureMeasureInterval | * | #11:(U32) | \ref mRinsebackFlowRate | * | #12:(U32) | \ref mRinsebackVolume | * | #13:(S32) | \ref mArterialPressureLimitWindow | * | #14:(S32) | \ref mVenousPressureLimitWindow | * | #15:(S32) | \ref mVenousPressureLimitAsymtrc | * | #16:(S32) | \ref mTrancembrncPressureLimitWindow | * | #17:(F32) | \ref mDialysateTemp | * | #18:(F32) | \ref mHeparinDispensingRate | * | #19:(F32) | \ref mHeparinBolusVolume | * */ class MAdjustParametersValidationReq : public MModel { public: quint32 mBloodFlowRate = 0; // mL/min quint32 mDialysateFlowRate = 0; // mL/min quint32 mTreatmentDuration = 0; // minutes quint32 mSalineBolusVolume = 0; // mL quint32 mHeparinStopTime = 0; // min quint32 mHeparinType = 0; // quint32 mAcidConcentrate = 0; // quint32 mBicarbonateConcentrate = 0; // quint32 mDialyzerType = 0; // quint32 mBloodPressureMeasureInterval = 0; // minutes quint32 mRinsebackFlowRate = 0; // mL/min quint32 mRinsebackVolume = 0; // mL qint32 mArterialPressureLimitWindow = 0; // mmHg qint32 mVenousPressureLimitWindow = 0; // mmHg qint32 mVenousPressureLimitAsymtrc = 0; // mmHg qint32 mTrancembrncPressureLimitWindow = 0; // mmHg float mDialysateTemp = 0; // Celsius float mHeparinDispensingRate = 0; // mL/hr float mHeparinBolusVolume = 0; // mL QString toString() { return toString({ mBloodFlowRate , mDialysateFlowRate , mTreatmentDuration , mSalineBolusVolume , mHeparinStopTime , mHeparinType , mAcidConcentrate , mBicarbonateConcentrate , mDialyzerType , mBloodPressureMeasureInterval , mRinsebackFlowRate , mRinsebackVolume , mArterialPressureLimitWindow , mVenousPressureLimitWindow , mVenousPressureLimitAsymtrc , mTrancembrncPressureLimitWindow , mDialysateTemp , mHeparinDispensingRate , mHeparinBolusVolume , }); } static QString toString(const QVariantList &vParameters) { return MModel::toString("ValidateParameters", vParameters); } }; /*! * \brief The MAdjustParametersConfirmReq class * \details The model to tell HD treatment parameters have been confirmed * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------------------------------:| * |0x4400| 0x041 | Req | Y | UI | TD | Confirm Treatment Parameter Request | * * | Payload || * | || * | #1:(U32) | \ref requestedState | * */ class MAdjustParametersConfirmReq : public MModel { public: enum Options { eCancel = 0, eConfirm = 1 }; Options requestedState = eConfirm; QString toString() { return toString({requestedState}); } static QString toString(const QVariantList &vParameters) { return MModel::toString("ConfirmParameters", vParameters); } }; /*! * \brief The MAdjustWaterSampleReq class * \details The model to request start/stop water sample * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| * |0x5D00| 0x100 | 9 | Req | Y | UI | HD | Water Sample Request | * * | Payload || * | || * | #1:(U32) | \ref requestedState | * */ class MAdjustWaterSampleReq : public MModel { public: enum Options { eStop = 0, eStart = 1, }; Options requestedState = eStop; QString toString() { return toString({requestedState}); } static QString toString(const QVariantList &vParameters) { return MModel::toString("WaterSample", vParameters); } }; /*! * \brief The MAdjustWaterSampleResultReq class * \details The model to provide water sample result * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------------:| * |0x5F00| 0x100 | 9 | Req | Y | UI | HD | Water Sample Result Request | * * | Payload || * | || * | #1:(U32) | \ref request | * */ class MAdjustWaterSampleResultReq : public MModel { public: enum Options { eUnknown = -1, eFailed = 0, ePassed = 1, }; Options requestedState = eUnknown; QString toString() { return toString({requestedState}); } static QString toString(const QVariantList &vParameters) { return MModel::toString("WaterSampleResult", vParameters); } }; /*! * \brief The MAdjustConsumablesConfirmReq class * \details The model to Confirm Consumables Installation * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:----------------------------------------:| * |0x6800| 0x100 | 9 | Req | Y | UI | HD | Consumables Installation Confirm Request | * * | Payload || * | || * | None || * */ class MAdjustConsumablesConfirmReq : public MModel { public: static QString toString(const QVariantList &vParameters) { return MModel::toString("ConsumablesConfirm", vParameters); } }; /*! * \brief The MAdjustDisposablesConfirmReq class * \details The model to Confirm Disposables Installation * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:----------------------------------------:| * |0x6200| 0x100 | 9 | Req | Y | UI | HD | Disposables Installation Confirm Request | * * | Payload || * | || * | None || * */ class MAdjustDisposablesConfirmReq : public MModel { public: static QString toString(const QVariantList &vParameters) { return MModel::toString("DisposablesConfirm", vParameters); } }; /*! * \brief The MAdjustDisposablesPrimeReq class * \details The model to Confirm Disposables Installation * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------------------:| * |0x3C00| 0x100 | 9 | Req | Y | UI | HD | Disposables Priming Start Request | * * | Payload || * | || * | None || * */ class MAdjustDisposablesPrimeReq : public MModel { public: static QString toString(const QVariantList &vParameters) { return MModel::toString("DisposablesPrime", vParameters); } }; /*! * \brief The MAdjustPatientConnectionBeginReq class * \details The model to Confirm Disposables Installation * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------------------:| * |0x6400| 0x100 | 9 | Req | Y | UI | HD | Patient Connection Begin Request | * * | Payload || * | || * | None || * */ class MAdjustPatientConnectionBeginReq : public MModel { public: static QString toString(const QVariantList &vParameters) { return MModel::toString("PatientConnectionBegin", vParameters); } }; /*! * \brief The MAdjustUltrafiltrationInitReq class * \details The ultrafiltration volume change request model * * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | * |0x4F00| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Initial Adjustment Request | * * | Payload || * | || * | #1:(F32) | \ref volume | * */ class MAdjustUltrafiltrationInitReq : public MModel { public: float volume = 0; static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustUFInit", vParameters); } }; /*! * \brief The MAdjustPatientConnectionConfirmReq class * \details The model to Confirm Disposables Installation * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:----------------------------------:| * |0x6600| 0x100 | 9 | Req | Y | UI | HD | Patient Connection Confirm Request | * * | Payload || * | || * | None || * */ class MAdjustPatientConnectionConfirmReq : public MModel { public: static QString toString(const QVariantList &vParameters) { return MModel::toString("PatientConnectionConfirm", vParameters); } }; /*! * \brief The MAdjustStartTreatmentReq class * \details The model to request starting a treatment * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:-------------------------:| * |0x7100| 0x100 | 9 | Req | Y | UI | HD | Start Treatment Request | * * | Payload || * | || * | #1:(U32) | \ref request | * */ class MAdjustStartTreatmentReq : public MModel { public: static QString toString(const QVariantList &vParameters) { return MModel::toString("StartTreatment", vParameters); } }; } typedef Model:: MAdjustInitTreatmentReq AdjustInitTreatmentRequestData; typedef Model:: MAdjustParametersValidationReq AdjustParametersValidationRequestData; typedef Model:: MAdjustParametersConfirmReq AdjustParametersConfirmRequestData; typedef Model:: MAdjustWaterSampleReq AdjustWaterSampleRequestData; typedef Model:: MAdjustWaterSampleResultReq AdjustWaterSampleResultRequestData; typedef Model:: MAdjustConsumablesConfirmReq AdjustConsumablesConfirmRequestData; typedef Model:: MAdjustDisposablesConfirmReq AdjustDisposablesConfirmRequestData; typedef Model:: MAdjustDisposablesPrimeReq AdjustDisposablesPrimeRequestData; typedef Model:: MAdjustPatientConnectionBeginReq AdjustPatientConnectionBeginRequestData; typedef Model:: MAdjustUltrafiltrationInitReq AdjustUltrafiltrationInitRequestData; typedef Model:: MAdjustPatientConnectionConfirmReq AdjustPatientConnectionConfirmRequestData; typedef Model:: MAdjustStartTreatmentReq AdjustStartTreatmentRequestData;