/************************************************************************** * * 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 ModeTreatmentParams.h * * @author (last) Sean Nash * @date (last) 29-May-2020 * * @author (original) Sean Nash * @date (original) 29-May-2020 * ***************************************************************************/ #ifndef __MODE_OP_PARAMS_H__ #define __MODE_OP_PARAMS_H__ #include "HDCommon.h" #include "HDDefs.h" /** * @defgroup HDTreatmentParamsMode HDTreatmentParamsMode * @brief Treatment parameters mode module. * * @addtogroup HDTreatmentParamsMode * @{ */ // ********** private definitions ********** /// Enumeration of treatment parameters. typedef enum Treatment_Params { TREATMENT_PARAM_BLOOD_FLOW = 0, ///< Blood flow rate (in mL/min) TREATMENT_PARAM_FIRST_U32 = TREATMENT_PARAM_BLOOD_FLOW, ///< First integer treatment parameter TREATMENT_PARAM_DIALYSATE_FLOW, ///< Dialysate flow rate (in mL/min) TREATMENT_PARAM_TREATMENT_DURATION, ///< Treatment duration (in minutes) TREATMENT_PARAM_HEPARIN_PRE_STOP_TIME, ///< Heparin pre-stop time (in minutes) TREATMENT_PARAM_SALINE_BOLUS_VOLUME, ///< Saline bolus volume (in mL) TREATMENT_PARAM_ACID_CONCENTRATE, ///< Acid concentrate type (enum) TREATMENT_PARAM_BICARB_CONCENTRATE, ///< Bicarbonate concentrate type (enum) TREATMENT_PARAM_DIALYZER_TYPE, ///< Dialysate type (enum) TREATMENT_PARAM_ART_PRESSURE_LOW_LIMIT, ///< Arterial pressure low alarm limit (in mmHg) TREATMENT_PARAM_ART_PRESSURE_HIGH_LIMIT, ///< Arterial pressure high alarm limit (in mmHg) TREATMENT_PARAM_VEN_PRESSURE_LOW_LIMIT, ///< Venous pressure low alarm limit (in mmHg) TREATMENT_PARAM_VEN_PRESSURE_HIGH_LIMIT, ///< Venous pressure high alarm limit (in mmHg) TREATMENT_PARAM_BP_MEAS_INTERVAL, ///< Blood pressure measurement interval (in minutes) TREATMENT_PARAM_RINSEBACK_FLOW_RATE, ///< Rinseback flow rate (in mL/min) TREATMENT_PARAM_LAST_U32 = TREATMENT_PARAM_RINSEBACK_FLOW_RATE, ///< Last integer treatment parameter TREATMENT_PARAM_HEPARIN_DISPENSE_RATE, ///< Heparin dispense rate (in mL/hr) TREATMENT_PARAM_FIRST_F32 = TREATMENT_PARAM_HEPARIN_DISPENSE_RATE, ///< First floating point treatment parameter TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME, ///< Heparin bolus volume (in mL) TREATMENT_PARAM_DIALYSATE_TEMPERATURE, ///< Dialysate temperature (in degC) TREATMENT_PARAM_UF_VOLUME, ///< Ultrafiltration volume (in liters) - provided separately by UI NUM_OF_TREATMENT_PARAMS ///< Total number of treatment parameters } TREATMENT_PARAM_T; /// Enumeration of dialyzer types. typedef enum Dialyzer_Types { DIALYZER_TYPE_NIPRO_ELISIO_H_17 = 0, ///< Nipro Elisio H17 dialyzer DIALYZER_TYPE_NIPRO_ELISIO_H_19, ///< Nipro Elisio H19 dialyzer DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F160NRE, ///< Fresenius Optiflux F160NRe DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F180NRE, ///< Fresenius Optiflux F180NRe NUM_OF_DIALYZER_TYPES ///< Number of dialyzer types } DIALYZER_TYPE_T; /// Enumeration of acid concentrates. typedef enum Acid_Concentrates { ACID_CONC_TYPE_FRESENIUS_08_1251_1 = 0, ///< Fresensius Naturalyte Acid Concentrate 08-1251-1 ACID_CONC_TYPE_FRESENIUS_08_2251_0, ///< Fresensius Naturalyte Acid Concentrate 08-1251-1 ACID_CONC_TYPE_FRESENIUS_08_3251_9, ///< Fresensius Naturalyte Acid Concentrate 08-1251-1 NUM_OF_ACID_CONC_TYPES ///< Number of acid concentrates } ACID_CONCENTRATE_TYPE_T; /// Enumeration of bicarbonate concentrates. typedef enum Bicarb_Concentrates { BICARB_CONC_TYPE_FRESENIUS_CENTRISOL = 0, ///< Fresenius Centrisol Liquid Bicarbonate NUM_OF_BICARB_CONC_TYPES ///< Number of bicarbonate concentrates } BICARB_CONCENTRATE_TYPE_T; /// Record structure for a treatment parameters payload. typedef struct { U32 bloodFlowRate_mL_min; U32 dialysateFlowRate_mL_min; U32 treatmentDuration_min; U32 heparinPreStop_min; U32 salineBolusVolume_mL; U32 acidConcentrate; U32 bicarbConcentrate; U32 dialyzerType; S32 arterialPressureLowLimit_mmHg; S32 arterialPressureHighLimit_mmHg; S32 venousPressureLowLimit_mmHg; S32 venousPressureHighLimit_mmHg; U32 bloodPressureMeasurementInterval_min; U32 rinsebackFlowRate_mL_min; F32 heparinDispenseRate_mL_hr; F32 heparinBolusVolume_mL; F32 dialysateTemperature_degC; } TREATMENT_PARAMS_DATA_PAYLOAD_T; /// Record structure for adjustable treatment parameters typedef struct { U32 bloodFlowRate_mL_min; U32 dialysateFlowRate_mL_min; U32 treatmentDuration_min; S32 arterialPressureLowLimit_mmHg; S32 arterialPressureHighLimit_mmHg; S32 venousPressureLowLimit_mmHg; S32 venousPressureHighLimit_mmHg; F32 uFVolume_L; } ADJ_TREATMENT_PARAMS_T; // ********** private function prototypes ********** void initTreatParamsMode( void ); // initialize this module void transitionToTreatParamsMode( void ); // prepares for transition to treatment parameters mode U32 execTreatParamsMode( void ); // execute the treatment parameters mode state machine (call from OperationModes) BOOL validateAndSetTreatmentParameters( TREATMENT_PARAMS_DATA_PAYLOAD_T params ); // user provided treatment params to be set and validated BOOL signalUserConfirmationOfTreatmentParameters( void ); // User has confirmed treatment parameters BOOL signalUserCancelTreatment( void ); // User has cancelled treatment void setTreatmentParameterU32( TREATMENT_PARAM_T param, U32 value ); // Set a specified unsigned integer treatment parameter value void setTreatmentParameterS32( TREATMENT_PARAM_T param, S32 value ); // Set a specified signed integer treatment parameter value void setTreatmentParameterF32( TREATMENT_PARAM_T param, F32 value ); // Set a specified floating point treatment parameter value U32 getTreatmentParameterU32( TREATMENT_PARAM_T param ); // Get a specified unsigned integer treatment parameter S32 getTreatmentParameterS32( TREATMENT_PARAM_T param ); // Get a specified signed integer treatment parameter F32 getTreatmentParameterF32( TREATMENT_PARAM_T param ); // Get a specified floating point treatment parameter /**@}*/ #endif