/************************************************************************** * * Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. * * 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 ModePostTreat.h * * @author (last) Sean Nash * @date (last) 13-Aug-2021 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 * ***************************************************************************/ #ifndef __MODE_POST_TREATMENT_H__ #define __MODE_POST_TREATMENT_H__ #include "HDCommon.h" #include "HDDefs.h" /** * @defgroup HDPostTreatmentMode HDPostTreatmentMode * @brief Post-treatment Mode module. The post-treatment mode sends treatment data log to UI. * This mode handles draining reservoirs and verifies disposable removal. * * @addtogroup HDPostTreatmentMode * @{ */ // ********** public definitions ********** /// Record structure for a treatment log parameters payload. typedef struct { U32 bloodFlowRate_mL_min; ///< Blood flow rate (in mL/min) U32 dialysateFlowRate_mL_min; ///< Dialysate flow rate (in mL/min) U32 treatmentDuration_sec; ///< Selected treatment duration (in sec) U32 actualTreatmentDur_sec; ///< Actual treatment duration (in sec) U32 acidConcentrate; ///< Acid concentrate option U32 bicarbConcentrate; ///< Bicarbonate concentrate option U32 potassiumConcentration; ///< Potassium concentration value in mEq/L. U32 calciumConcentration; ///< Calcium concentration value in mEq/L. U32 bicarbonateConcentration; ///< Bicarbonate concentration value in mEq/L. U32 sodiumConcentration; ///< Sodium concentration value in mEq/L. F32 dialysateTemperature_degC; ///< Dialysate temperature (in deg C) U32 dialyzerType; ///< Dialyzer type option U32 treatmentStartDateAndTime; ///< Treatment start date and time in epoch time (in seconds) U32 treatmentEndDateAndTime; ///< Treatment end date and time in epoch time (in seconds) F32 avgBloodFlow_mL_min; ///< Average blood flow rate during treatment (in mL/min) F32 avgDialysateFlow_mL_min; ///< Average dialysate flow rate during treatment (in mL/min) F32 dialysateVolumeUsed_L; ///< Dialysate volume used during treatment (in L) F32 avgDialysateTemperature_degC; ///< Average dialysate temperature (in deg C) F32 targetUFVolume_L; ///< Target ultrafiltration volume (in L) F32 actualUFVolume_L; ///< Actual ultrafiltration volume (in L) F32 targetUFRate_mL_min; ///< Target ultrafiltration rate (in mL/min) F32 actualUFRate_mL_min; ///< Actual ultrafiltration rate (in mL/min) U32 salineBolusVolume_mL; ///< Saline bolus volume (in mL) F32 heparinBolusVolume_mL; ///< Heparin bolus volume (in mL) F32 heparinDispenseRate_mL_hr; ///< Heparin dispense rate (in mL/hr) U32 heparinPreStop_min; ///< Heparin pre-stop time (in min) F32 heparinDeliveredVolume_mL; ///< Heparin delivererd volume (in mL) F32 avgArterialPressure_mmHg; ///< Average arterial pressure (in mmHg) F32 avgVenousPressure_mmHg; ///< Average venous pressure (in mmHg) U32 deviceID; ///< Serial number or UID U32 waterSampleTestResult; ///< Pass or fail } TREATMENT_LOG_DATA_PAYLOAD_T; // ********** public function prototypes ********** void initPostTreatmentMode( void ); // Initialize this module U32 transitionToPostTreatmentMode( void ); // Prepares for transition to post-treatment mode U32 execPostTreatmentMode( void ); // Execute the post-treatment mode state machine (call from OperationModes) void collectTreatmentLogData( void ); void sendTreatmentLogDataToUI( void ); void signalUserConfirmPatientDisconnection( void ); void signalUserConfirmDisposableRemoval( void ); void signalAlarmActionToPostTreatmentMode( ALARM_ACTION_T action ); // Execute alarm action as appropriate for post-treatment mode BOOL testSetPostTreatmentModePublishIntervalOverride( U32 ms ); BOOL testResetPostTreatmentModePublishIntervalOverride( void ); /**@}*/ #endif