Index: firmware/App/Modes/ModePostTreat.h =================================================================== diff -u -r1942c708bc95f57e87b0bf6a472ebe824a3f38ed -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision 1942c708bc95f57e87b0bf6a472ebe824a3f38ed) +++ firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 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 +* @file ModePostTreat.h * -* @author (last) Sean Nash -* @date (last) 29-May-2020 +* @author (last) Sean Nash +* @date (last) 09-Aug-2023 * -* @author (original) Dara Navaei -* @date (original) 05-Nov-2019 +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 * ***************************************************************************/ @@ -23,19 +23,85 @@ /** * @defgroup HDPostTreatmentMode HDPostTreatmentMode - * @brief Post-treatment Mode module. + * @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 originUFVolume_L; ///< Origin ultrafiltration volume (in L) + F32 targetUFVolume_L; ///< Target ultrafiltration volume (in L) + F32 actualUFVolume_L; ///< Actual ultrafiltration volume (in L) + F32 originUFRate_mL_min; ///< Origin ultrafiltration rate (in mL/min) + 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) + U32 heparinType; ///< Heparin type option + + 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; + +/// Post treatment state data publish +typedef struct +{ + U32 currentPostTreatmentState; ///< Post treatment current state. + U32 currentPostTxDrainState; ///< Post treatment drain state. +} POST_TREATMENT_STATE_DATA_T; + // ********** public function prototypes ********** void initPostTreatmentMode( void ); // Initialize this module -void transitionToPostTreatmentMode( void ); // Prepares for transition to post-treatment mode +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 requestPostTxNext( 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