/*! * * Copyright (c) 2019-2020 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 VPostTreatmentAdjustTreatmentLog.cpp * \author (last) Behrouz NematiPour * \date (last) 11-Apr-2021 * \author (original) Behrouz NematiPour * \date (original) 11-Apr-2021 * */ #include "VPostTreatmentAdjustTreatmentLog.h" // Qt #include #include // Project #include "GuiController.h" #include "FileHandler.h" using namespace Storage; VIEW_DEF_CLASS_ADJUSTMENT(VPostTreatmentAdjustmentTreatmentLog) /*! \brief Connection Initializer \details All the class signal/slot connections are defined here. */ void View::VPostTreatmentAdjustmentTreatmentLog::initConnections() { ADJUST_VIEW_CONNECTION(AdjustTreatmentLogRequestData ); ACTION_VIEW_CONNECTION(AdjustTreatmentLogResponseData); ACTION_VIEW_CONNECTION(TreatmentLogAvrgeData); ACTION_VIEW_CONNECTION(TreatmentLogAlarmData); ACTION_VIEW_CONNECTION(TreatmentLogEventData); connect(&_TreatmentLog , &TreatmentLog::isIdleNotified, this , [=](bool vIdle){isIdle(vIdle);}); } /*! * \brief View::VPostTreatmentAdjustmentTreatmentLog::doRequest * \details the invocable slot to send user's treatment log request */ void View::VPostTreatmentAdjustmentTreatmentLog::doRequest() { AdjustTreatmentLogRequestData data; emit didAdjustment(data); } /*! * \brief View::VPostTreatmentAdjustmentTreatmentLog::doExport * \details the invocable slot to send user's treatment log export request to the controller */ void View::VPostTreatmentAdjustmentTreatmentLog::doExport() { _TreatmentLog.doExport(); } /*! * \brief VPostTreatmentAdjustmentUltrafiltrationInit::onActionReceive * \details received response model data handler * \param vData - model data */ void View::VPostTreatmentAdjustmentTreatmentLog::onActionReceive(const AdjustTreatmentLogResponseData &vData) { adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); _TreatmentLog.initModel (vData, _patientID.trimmed() ); parametersText ( _TreatmentLog.values() ); // raw values bloodFlowRate ( vData.mBloodFlowRate ); dialysateFlowRate ( vData.mDialysateFlowRate ); treatmentDuration ( vData.mTreatmentDuration ); actualTreatmentDuration ( vData.mActualTreatmentDuration ); acidConcentrateType ( vData.mAcidConcentrateType ); bicarbonateConcentrateType ( vData.mBicarbonateConcentrateType ); potassiumConcentration ( vData.mPotassiumConcentration ); calciumConcentration ( vData.mCalciumConcentration ); bicarbonateConcentration ( vData.mBicarbonateConcentration ); sodiumConcentration ( vData.mSodiumConcentration ); dialysateTemperature ( vData.mDialysateTemperature ); dialyzerType ( vData.mDialyzerType ); treatmentStartEpoch ( vData.mTreatmentStartEpoch ); treatmentEndEpoch ( vData.mTreatmentEndEpoch ); averageBloodFlow ( vData.mAverageBloodFlow ); averageDialysateFlow ( vData.mAverageDialysateFlow ); dialysateVolumeUsed ( vData.mDialysateVolumeUsed ); averageDialysateTemp ( vData.mAverageDialysateTemp ); targetUFVolume ( vData.mTargetUFVolume ); actualUFVolume ( vData.mActualUFVolume ); targetUFRate ( vData.mTargetUFRate ); actualUFRate ( vData.mActualUFRate ); salineBolusVolume ( vData.mSalineBolusVolume ); heparinBolusVolume ( vData.mHeparinBolusVolume ); heparinDispenseRate ( vData.mHeparinDispenseRate ); heparinStop ( vData.mHeparinStop ); heparinDeliveredVolume ( vData.mHeparinDeliveredVolume ); averageArterialPressure ( vData.mAverageArterialPressure ); averageVenousPressure ( vData.mAverageVenousPressure ); deviceID ( vData.mDeviceID ); waterSampleTestResult ( vData.mWaterSampleTestResult ); heparinType ( vData.mHeparinType ); heparinConcentration ( vData.mHeparinConcentration ); if (adjustment_Accepted()) _TreatmentLog.doSave(); // *** has to be the last to let the information to be set and then emit the signal *** // *** otherwise will use the Previous values before being set. *** adjustment ( true ); } /*! * \brief VPostTreatmentAdjustmentUltrafiltrationInit::onActionReceive * \details received response model data handler * \param vData - model data */ void View::VPostTreatmentAdjustmentTreatmentLog::onActionReceive(const TreatmentLogAvrgeData &vData){ _TreatmentLog.append(vData); } void View::VPostTreatmentAdjustmentTreatmentLog::onActionReceive(const TreatmentLogAlarmData &vData){ _TreatmentLog.append(vData); } void View::VPostTreatmentAdjustmentTreatmentLog::onActionReceive(const TreatmentLogEventData &vData){ _TreatmentLog.append(vData); }