/*! * * 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 VCommonAdjustmentVitals.h * \author (last) Behrouz NematiPour * \date (last) 10-Jan-2024 * \author (original) Behrouz NematiPour * \date (original) 23-Jun-2021 * */ #pragma once #include // Project #include "main.h" // Doxygen : do not remove //#include "MTreatmentAdjustVitalsResponse.h" //#include "MUIBloodPressureData.h" #include "MTreatmentVitalsData.h" #include "VAdjustmentResponseBase.h" namespace View { /*! * \brief The VTreatmentVitals class * \details View for Model's Data representation. * * \sa Model::TreatmentLogAvrgeData * */ class VTreatmentVitals : public VAdjustmentResponseBase { Q_OBJECT // friends friend class ::tst_views; int _timerId = 0; // 0 means no timer started or failed to start. int _counter_sec = 0; int _counter_min = 0; // 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) // Vitals data // constant range variables / units / ... CONSTANT( quint16 , systolicMin , 60) CONSTANT( quint16 , systolicMax , 250) CONSTANT( quint16 , diastolicMin , 40) CONSTANT( quint16 , diastolicMax , 200) CONSTANT( quint16 , heartRateMin , 40) CONSTANT( quint16 , heartRateMax , 180) // timer PROPERTY( bool , enableDialog , 0) // enable the vital Dialog being triggered (pre-treatment is screen not a dialog) PROPERTY( quint8 , interval , 1) // show the vital screen in min // timestamp PROPERTY( quint64 , epoch , 0) PROPERTY( QString , lastRead , "") PROPERTY( QString , countdown , "") // vitals PROPERTY( quint16 , systolic , 0) PROPERTY( quint16 , diastolic , 0) PROPERTY( quint16 , heartRate , 0) PROPERTY( quint16 , systolic__rt , 0) PROPERTY( quint16 , diastolic_rt , 0) PROPERTY( quint16 , heartRate_rt , 0) // For Debugging purposes PROPERTY( quint8 , min_left , 0) PROPERTY( quint8 , sec_left , 0) // VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentVitals, UIBloodPressureData) // VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentVitals, AdjustVitalsResponseData) VIEW_DEC(VTreatmentVitals, TreatmentVitalsData) void update (quint16 vSystolic, quint16 vDiastolic, quint16 vHeartRate); void update_rt (quint16 vSystolic, quint16 vDiastolic, quint16 vHeartRate); void treatmentLog(); // timer void timerStart(); void timerReset(); void timerStop (); void timerEvent(QTimerEvent *) override; private slots: void onIntervalChanged(); public slots: // vitals void doConfirm (quint16 vSystolic, quint16 vDiastolic, quint16 vHeartRate); void doSkip (); void doReset (); // timer void doTimerStart () { timerStart(); } void doTimerStop () { timerStop (); } signals: /*! * \brief didTrigger * \details the signal to trigger the Gui to notify the user for the vitals measurement */ void didTrigger(quint16 vSystolic = 0, quint16 vDiastolic = 0, quint16 vHeartRate = 0); /*! * \brief didAdjustment * \details the notification signal to request vitals * \param vData - data model for the duration adjustment request */ void didAdjustment(const AdjustVitalsRequestData &vData); }; }