/*! * * Copyright (c) 2021-2025 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 VTreatmentTrends.h * \author (last) Stephen Quong * \date (last) 01-Oct-2025 * \author (original) Stephen Quong * \date (original) 01-Oct-2025 * */ #pragma once // Qt #include #include // Project #include "main.h" // Doxygen : do not remove #include "MDDConductivityData.h" #include "MListModel.h" #include "MTreatmentParametersSetPointData.h" #include "MTreatmentPressureOcclusionData.h" #include "MTreatmentSalineData.h" #include "MTreatmentStatesData.h" #include "MTreatmentTimeData.h" #include "MTreatmentUltrafiltrationData.h" #include "MTreatmentVitalsData.h" #include "TreatmentLog.h" #include "VView.h" // namespace namespace View { /*! * \brief The VTreatmentTrends class * \details View for Trends Models' data representation. * * \sa Model::MTreatmentTrends * */ class VTreatmentTrends : public QObject { Q_OBJECT READONLY (QTime, time_Start, QTime() ) READONLY (quint32, time_Elapsed, 0 ) Q_PROPERTY (MListModel *data READ data CONSTANT) Q_PROPERTY (MListModel *history READ history CONSTANT) VIEW_DEC_CLASS ( VTreatmentTrends ) VIEW_DEC_SLOT ( PressureOcclusionData ) VIEW_DEC_SLOT ( TreatmentParametersSetPointData ) VIEW_DEC_SLOT ( TreatmentSalineData ) VIEW_DEC_SLOT ( TreatmentStatesData ) VIEW_DEC_SLOT ( TreatmentTimeData ) VIEW_DEC_SLOT ( TreatmentUltrafiltrationData ) VIEW_DEC_SLOT ( TreatmentVitalsData ) VIEW_DEC_SLOT ( DDConductivityData ) VIEW_DEC_SLOT ( TreatmentLogAlarmData ) VIEW_DEC_SLOT ( TreatmentLogEventData ) public: enum { eDataRole_Timestamp = Qt::UserRole , eDataRole_Systolic , eDataRole_Diastolic , eDataRole_PulseRate , eDataRole_UFVolumeRemoved , eDataRole_UFRate , eDataRole_ArterialPressure , eDataRole_VenousPressure , eDataRole_TMP , eDataRole_BolusCumulativeDelivered , eDataRole_BloodFlowRate , eDataRole_DialysateFlowRate , eDataRole_DialysateTemperature , eDataRole_Conductivity , } DataRole; enum { eHistoryRole_Timestamp = Qt::UserRole , eHistoryRole_EntryID , eHistoryRole_Priority , eHistoryRole_Message , } HistoryRole; public Q_SLOTS: void doClearData(); void onIntervalRequestVitals(); void onIntervalTimeoutVitals(); void onManualVitals(const quint16 vSystolic, const quint16 vDiastolic, const quint16 vHeartRate); void onNoVitalsRecord(); private: MListModel* data(); MListModel* history(); typedef QHash TrendEntry; MListModel _data; MListModel _history; TrendEntry _latestData; TrendEntry _savedData; }; } // namespace View