/**********************************************************************//** * * Copyright (c) 2019-2020 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 Dialysis.h * * @date 15-Jan-2020 * @author S. Nash * * @brief Header file for Dialysis sub-mode. * **************************************************************************/ #ifndef __DIALYSIS_H__ #define __DIALYSIS_H__ #include "HDCommon.h" /** * @defgroup Dialysis Dialysis * @brief Dialysis sub-mode of treatment mode. * * @addtogroup Dialysis * @{ */ // ********** public definitions ********** /// Enumeration of dialysis sub-mode states. typedef enum Dialysis_States { DIALYSIS_START_STATE = 0, ///< Start state of the dialysis sub-mode state machine. DIALYSIS_UF_STATE, ///< Ultrafiltration state of the dialysis sub-mode state machine. DIALYSIS_SOLUTION_INFUSION_STATE, ///< Solution infusion state of the dialysis sub-mode state machine. NUM_OF_DIALYSIS_STATES ///< Number of dialysis sub-mode states. } DIALYSIS_STATE_T; /// Enumeration of ultrafiltration states. typedef enum UF_States { UF_START_STATE = 0, ///< Start state of the ultrafiltration state machine. UF_PAUSED_STATE, ///< Paused state of the ultrafiltration state machine. UF_RUNNING_STATE, ///< Running state of the ultrafiltration state machine. UF_OFF_STATE, ///< Completed/off state of the ultrafiltration state machine. UF_COMPLETED_STATE, ///< Completed state of ultrafiltration state machine. NUM_OF_UF_STATES ///< Number of ultrafiltration states. } UF_STATE_T; /// Enumeration of system message IDs. typedef enum UF_Commands { UF_CMD_PAUSE = 0, ///< Pause UF command. UF_CMD_RESUME, ///< Resume UF command. NUM_OF_UF_CMDS ///< Number of UF commands. } UF_CMD_T; /// Enumeration of system message IDs. typedef enum UF_Adjustments { UF_ADJ_TREATMENT_TIME = 0, ///< Adjust treatment time to achieve new ultrafiltration volume. UF_ADJ_UF_RATE, ///< Adjust UF rate to achieve new ultrafiltration volume. NUM_OF_UF_ADJS ///< Number of UF adjustments. } UF_ADJ_T; // ********** private function prototypes ********** void initDialysis( void ); void transitionToDialysis( void ); void execDialysis( void ); void setDialysisParams( U32 bPFlow, U32 dPFlow, F32 maxUFVol, F32 uFRate ); void startDialysis( void ); void stopDialysis( void ); DIALYSIS_STATE_T getDialysisState( void ); UF_STATE_T getUltrafiltrationState( void ); F32 getUltrafiltrationVolumeCollected( void ); BOOL pauseUF( void ); BOOL resumeUF( void ); /**@}*/ #endif