Index: HDDefs.h =================================================================== diff -u -rc17457e75bce15199acd967951319c7aedd177a1 -r1841f63f8a1715d14809a3edb4e15c5d12ebda86 --- HDDefs.h (.../HDDefs.h) (revision c17457e75bce15199acd967951319c7aedd177a1) +++ HDDefs.h (.../HDDefs.h) (revision 1841f63f8a1715d14809a3edb4e15c5d12ebda86) @@ -94,10 +94,6 @@ enum HD_Standby_States { STANDBY_START_STATE = 0, ///< Start standby - STANDBY_FLUSH_DG_LINES_STATE, ///< Flush DG lines - STANDBY_DRAIN_RESERVOIR_STATE, ///< Drain reservoirs - STANDBY_WAIT_FOR_PRIME_STATE, ///< Wait for prime - STANDBY_FILL_RESERVOIR_STATE, ///< Fill reservoir STANDBY_WAIT_FOR_TREATMENT_STATE, ///< Wait for treatment NUM_OF_STANDBY_STATES ///< Number of standby states (sub-modes) }; @@ -128,20 +124,19 @@ */ /// Enumeration of pre-treatment mode states (sub-mode). -enum Pre_Treatment_Mode_States +enum HD_Pre_Treatment_Mode_States { - PRE_TREATMENT_START_STATE = 0, ///< Start pre-treatment mode state - PRE_TREATMENT_WATER_SAMPLE_STATE, ///< Water sample state - PRE_TREATMENT_SELF_TEST_NO_CART_STATE, ///< Self tests with no cartridge state - PRE_TREATMENT_CART_INSTALL_STATE, ///< Consumable and cartridge installation state - PRE_TREATMENT_SELF_TEST_DRY_STATE, ///< Self tests dry-run state - PRE_TREATMENT_PRIME_STATE, ///< Prime both blood and dialysate circuits state - PRE_TREATMENT_SELF_TEST_WET_STATE, ///< Self tests wet-run state - PRE_TREATMENT_RECIRC_STATE, ///< Re-circulate blood and dialysate circuits state - PRE_TREATMENT_PATIENT_CONNECTION_STATE, ///< Patient connection state - NUM_OF_PRE_TREATMENT_STATES ///< Number of pre-treatment mode states + HD_PRE_TREATMENT_START_STATE = 0, ///< Start pre-treatment mode state + HD_PRE_TREATMENT_WATER_SAMPLE_STATE, ///< Water sample state + HD_PRE_TREATMENT_SELF_TEST_NO_CART_STATE, ///< Self tests with no cartridge state + HD_PRE_TREATMENT_CART_INSTALL_STATE, ///< Consumable and cartridge installation state + HD_PRE_TREATMENT_SELF_TEST_DRY_STATE, ///< Self tests dry state + HD_PRE_TREATMENT_PRIME_STATE, ///< Prime blood and dialysate circuits and run wet self-tests state + HD_PRE_TREATMENT_RECIRCULATE_STATE, ///< Re-circulate blood and dialysate circuits state + HD_PRE_TREATMENT_PATIENT_CONNECTION_STATE, ///< Patient connection state + NUM_OF_HD_PRE_TREATMENT_STATES ///< Number of pre-treatment mode states }; -typedef enum Pre_Treatment_Mode_States PRE_TREATMENT_MODE_STATE_T; ///< Type for HD pre-treatment mode states enumeration +typedef enum HD_Pre_Treatment_Mode_States HD_PRE_TREATMENT_MODE_STATE_T; ///< Type for HD pre-treatment mode states enumeration /**@}*/ @@ -151,17 +146,23 @@ */ /// Enumeration of prime sub-mode states. -enum Pre_Treatment_Prime_States +enum HD_Pre_Treatment_Prime_States { - PRIME_START_STATE = 0, ///< Prime start state - PRIME_SALINE_SETUP_STATE, ///< Saline setup state - PRIME_SALINE_PURGE_AIR_STATE, ///< Saline purge air state - PRIME_SALINE_CIRC_BLOOD_CIRCUIT_STATE, ///< Circulate blood circuit state - PRIME_RESERVOIR_ONE_FILL_COMPLETE_STATE, ///< Wait for reservoir 1 fill complete - PRIME_DIALYSATE_DIALYZER_STATE, ///< Dialysate dialyzer state - NUM_OF_PRIME_STATES ///< Number of prime sub-mode states + HD_PRIME_START_STATE = 0, ///< Prime start state + HD_PRIME_WAIT_FOR_USER_START_STATE, ///< Wait for user to start prime state + HD_PRIME_SALINE_SETUP_STATE, ///< Saline setup state + HD_PRIME_SALINE_PURGE_AIR_STATE, ///< Saline purge air state + HD_PRIME_SALINE_CIRC_BLOOD_CIRCUIT_STATE, ///< Circulate blood circuit state + HD_PRIME_RESERVOIR_ONE_FILL_COMPLETE_STATE, ///< Wait for reservoir 1 fill complete + HD_PRIME_DIALYSATE_DIALYZER_STATE, ///< Dialysate dialyzer fluid path state + HD_PRIME_RESERVOIR_TWO_FILL_COMPLETE_STATE, ///< Wait for reservoir 2 fill complete + HD_PRIME_DIALYSATE_BYPASS_STATE, ///< Dialysate bypass fluid path state + HD_PRIME_WET_SELF_TESTS_STATE, ///< Perform wet self-tests after priming complete + HD_PRIME_PAUSE, ///< Prime pause state, waits to be resumed + HD_PRIME_COMPLETE, ///< Prime complete state + NUM_OF_HD_PRIME_STATES ///< Number of prime sub-mode states }; -typedef enum Pre_Treatment_Prime_States PRE_TREATMENT_PRIME_STATE_T; ///< Type for HD pre-treatment prime sub-mode states enumeration +typedef enum HD_Pre_Treatment_Prime_States HD_PRE_TREATMENT_PRIME_STATE_T; ///< Type for HD pre-treatment prime sub-mode states enumeration /**@}*/ @@ -173,13 +174,13 @@ /// Sub-mode states while in treatment mode enum Treatment_States { - TREATMENT_START_STATE = 0, ///< Start treatment, prime blood side with gradual ramp for 1 min. while dialyzer is bypassed. No dialysis or UF taking place + TREATMENT_START_STATE = 0, ///< Start treatment - initialize treatment and go to blood prime state + TREATMENT_BLOOD_PRIME_STATE, ///< Prime blood-side of dialyzer with gradual ramp for 1 min. while dialyzer is bypassed. No dialysis or UF taking place. No treatment time. TREATMENT_DIALYSIS_STATE, ///< Perform dialysis. Deliver Heparin as prescribed. Deliver UF as prescribed. Handle saline boluses as requested TREATMENT_STOP_STATE, ///< Treatment stopped. All pumps off. Dializer bypassed TREATMENT_RINSEBACK_STATE, ///< Perform rinseback with saline. Dialyzer bypassed. Dialysate recirculating TREATMENT_RECIRC_STATE, ///< Recirculate saline and dialysate while patient disconnected. Blood lines open and shunted. Dialyzer is bypassed - TREATMENT_DIALYSIS_END_STATE, ///< Dialysis has ended. Blood pump slowed. Dialyzer is bypassed. Dialysate is recirculated. User can rinseback - TREATMENT_END_STATE, ///< Treatment has ended. All pumps off. Dialyzer is bypassed. Blood lines are closed. User to disconnect + TREATMENT_END_STATE, ///< Dialysis has ended. Blood pump slowed. Dialyzer is bypassed. Dialysate is recirculated. User can rinseback NUM_OF_TREATMENT_STATES ///< Number of treatment states (sub-modes) }; typedef enum Treatment_States TREATMENT_STATE_T; ///< Type for treatment states enumeration @@ -254,6 +255,15 @@ }; typedef enum Saline_Bolus_States SALINE_BOLUS_STATE_T; ///< Type for saline bolus state enumeration +/// Enumeration of saline bolus command parameters. +enum Saline_Commands +{ + SALINE_CMD_STOP = 0, ///< Start saline bolus command + SALINE_CMD_START, ///< Stop saline bolus command + NUM_OF_SALINE_CMDS ///< Number of saline bolus command parameters +}; +typedef enum Saline_Commands SALINE_CMD_T; ///< Type for saline command enum. + /// Enumeration of ultrafiltration command IDs. enum UF_Commands { @@ -275,42 +285,160 @@ /**@}*/ /** + * @addtogroup Heparin + * @{ + */ + +/// Enumeration of heparin states. +enum Heparin_States +{ + HEPARIN_STATE_OFF = 0, ///< No heparin delivery is in progress + HEPARIN_STATE_PAUSED, ///< Heparin delivery paused + HEPARIN_STATE_INITIAL_BOLUS, ///< Initial heparin bolus delivery in progress + HEPARIN_STATE_DISPENSING, ///< Gradual heparin dispensing in progress + HEPARIN_STATE_COMPLETED, ///< Heparin delivery stopped due to the set stop time before treatment end + HEPARIN_STATE_EMPTY, ///< Heparin Syringe empty + NUM_OF_HEPARIN_STATES ///< Number of saline bolus states +}; +typedef enum Heparin_States HEPARIN_STATE_T; ///< Type for heparin state enumeration + +/// Enumeration of heparin command IDs. +enum Heparin_Commands +{ + HEPARIN_CMD_PAUSE = 0, ///< Pause Heparin command + HEPARIN_CMD_RESUME, ///< Resume Heparin command + NUM_OF_HEPARIN_CMDS ///< Number of Heparin commands +}; +typedef enum Heparin_Commands HEPARIN_CMD_T; ///< Type for HEPARIN command IDs enumeration + +/**@}*/ + +/** + * @addtogroup TreatmentStop + * @{ + */ + +/// Enumeration of treatment stop sub-mode states. +enum Treatment_Stop_States +{ + TREATMENT_STOP_RECIRC_STATE = 0, ///< Dialysate re-circulation state of the treatment stop sub-mode state machine + TREATMENT_STOP_NO_RECIRC_STATE, ///< No dialysate re-circulation state of the treatment stop sub-mode state machine + NUM_OF_TREATMENT_STOP_STATES ///< Number of treatment stop sub-mode states +}; +/// Type for treatment stop states enumeration. +typedef enum Treatment_Stop_States TREATMENT_STOP_STATE_T; + +/**@}*/ + +/** + * @addtogroup BloodPrime + * @{ + */ + +/// Enumeration of blood prime sub-mode states. +enum Blood_Prime_States +{ + BLOOD_PRIME_RAMP_STATE = 0, ///< Ramp state of the blood prime sub-mode state machine + NUM_OF_BLOOD_PRIME_STATES ///< Number of blood prime sub-mode states +}; +/// Type for treatment end states enumeration. +typedef enum Blood_Prime_States BLOOD_PRIME_STATE_T; + +/**@}*/ + +/** * @addtogroup Rinseback * @{ */ /// Enumeration of rinseback sub-mode states. enum Rinseback_States { - RINSEBACK_STOP_INIT_STATE = 0, ///< Start state (stopped) of the rinseback sub-mode state machine - RINSEBACK_RUN_STATE, ///< Rinseback running state of the rinseback sub-mode state machine - RINSEBACK_PAUSED_STATE, ///< Rinseback paused state of the rinseback sub-mode state machine - RINSEBACK_STOP_STATE, ///< Rinseback stopped (done) state of the rinseback sub-mode state machine - RINSEBACK_RUN_ADDITIONAL_STATE, ///< Additional rinseback volume (10 mL) state of the rinseback sub-mode state machine - NUM_OF_RINSEBACK_STATES ///< Number of rinseback sub-mode states + RINSEBACK_STOP_INIT_STATE = 0, ///< Start state (stopped) of the rinseback sub-mode state machine + RINSEBACK_RUN_STATE, ///< Rinseback running state of the rinseback sub-mode state machine + RINSEBACK_PAUSED_STATE, ///< Rinseback paused state of the rinseback sub-mode state machine + RINSEBACK_STOP_STATE, ///< Rinseback stopped (done) state of the rinseback sub-mode state machine + RINSEBACK_RUN_ADDITIONAL_STATE, ///< Additional rinseback volume (10 mL) state of the rinseback sub-mode state machine + NUM_OF_RINSEBACK_STATES ///< Number of rinseback sub-mode states }; -typedef enum Rinseback_States RINSEBACK_STATE_T; ///< Type for rinseback states enumeration. +typedef enum Rinseback_States RINSEBACK_STATE_T; ///< Type for rinseback states enumeration. +/// Enumeration of user actions that may be requested from rinseback sub-mode. +enum Requested_Rinseback_User_Actions +{ + REQUESTED_USER_ACTION_RINSEBACK_CONFIRM_START = 0, ///< User confirms saline bag clamped, connected to end of arterial line, un-clamped, and ready to start rinseback operation + REQUESTED_USER_ACTION_RINSEBACK_INCREASE_RATE = 1, ///< User requests increase in rinseback flow rate + REQUESTED_USER_ACTION_RINSEBACK_DECREASE_RATE = 2, ///< User requests decrease in rinseback flow rate + REQUESTED_USER_ACTION_RINSEBACK_PAUSE = 3, ///< User requests to pause rinseback operation + REQUESTED_USER_ACTION_RINSEBACK_RESUME = 4, ///< User requests to resume rinseback operation + REQUESTED_USER_ACTION_RINSEBACK_END = 5, ///< User requests to end the rinseback operation + REQUESTED_USER_ACTION_RINSEBACK_ADDITIONAL = 6, ///< User requests an additional 10 mL of rinseback volume + REQUESTED_USER_ACTION_RINSEBACK_CONFIRM_DISCONNECT = 7, ///< User confirms patient disconnected, saline bag clamped, re-connected to VBA, un-clamped, and lines shunted to start re-circulation + REQUESTED_USER_ACTION_RINSEBACK_END_TREATMENT = 8, ///< User requests to end treatment + REQUESTED_USER_ACTION_RINSEBACK_BACK_TO_TREATMENT = 9, ///< User requests to return to treatment + NUM_OF_REQUESTED_RINSEBACK_USER_ACTIONS ///< Number of requested rinseback user actions +}; +/// Type for requested user actions enumeration. +typedef enum Requested_Rinseback_User_Actions REQUESTED_RINSEBACK_USER_ACTIONS_T; + /**@}*/ /** - * @addtogroup TreatmentRecirc + * @addtogroup TreatmentRecirculate * @{ */ /// Enumeration of treatment re-circulation sub-mode states. enum Treatment_Recirc_States { - TREATMENT_RECIRC_RECIRC_STATE = 0, ///< Re-circulate state of the treatment re-circulate sub-mode state machine - TREATMENT_RECIRC_UF_STATE, ///< Stopped state of the treatment re-circulate sub-mode state machine - NUM_OF_TREATMENT_RECIRC_STATES ///< Number of treatment re-circulate sub-mode states + TREATMENT_RECIRC_RECIRC_STATE = 0, ///< Re-circulate state of the treatment re-circulate sub-mode state machine + TREATMENT_RECIRC_STOPPED_STATE, ///< Stopped state of the treatment re-circulate sub-mode state machine + NUM_OF_TREATMENT_RECIRC_STATES ///< Number of treatment re-circulate sub-mode states }; /// Type for treatment re-circulation states enumeration. typedef enum Treatment_Recirc_States TREATMENT_RECIRC_STATE_T; +/// Enumeration of user actions that may be requested from treatment re-circulate sub-mode. +enum Requested_Treatment_Recirc_User_Actions +{ + REQUESTED_USER_ACTION_TX_RECIRC_RECONNECT = 0, ///< User requests to re-connect to system (stop re-circulating, clamp arterial and venous lines) + REQUESTED_USER_ACTION_TX_RECIRC_CONFIRM_RECONNECT = 1, ///< User confirms patient connected, lines un-shunted to return to treatment + REQUESTED_USER_ACTION_TX_RECIRC_RESUME_RC = 2, ///< User requests to resume re-circulation + REQUESTED_USER_ACTION_TX_RECIRC_END_TREATMENT = 3, ///< User requests to end treatment + NUM_OF_REQUESTED_TX_RECIRC_USER_ACTIONS ///< Number of requested treatment re-circ user actions +}; +/// Type for requested user actions enumeration. +typedef enum Requested_Treatment_Recirc_User_Actions REQUESTED_TREATMENT_RECIRC_USER_ACTIONS_T; + /**@}*/ /** + * @addtogroup TreatmentEnd + * @{ + */ + +/// Enumeration of treatment end sub-mode states. +enum Treatment_End_States +{ + TREATMENT_END_WAIT_FOR_RINSEBACK_STATE = 0, ///< Wait for rinseback state of the treatment end sub-mode state machine + TREATMENT_END_PAUSED_STATE, ///< Paused state of the treatment end sub-mode state machine + NUM_OF_TREATMENT_END_STATES ///< Number of treatment end sub-mode states +}; +/// Type for treatment end states enumeration. +typedef enum Treatment_End_States TREATMENT_END_STATE_T; + +/// Enumeration of user actions that may be requested from treatment end sub-mode. +enum Requested_Treatment_End_User_Actions +{ + REQUESTED_USER_ACTION_TX_END_RINSEBACK_START = 0, ///< User requests to initiate final rinseback + NUM_OF_REQUESTED_TX_END_USER_ACTIONS ///< Number of requested treatment end user actions +}; +/// Type for requested user actions enumeration. +typedef enum Requested_Treatment_End_User_Actions REQUESTED_TREATMENT_END_USER_ACTIONS_T; + +/**@}*/ + +/** * @addtogroup HDTreatmentParamsMode * @{ */ @@ -348,8 +476,9 @@ /// Enumeration of dialyzer types. 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_BBRAUN_PRO_13H = 0, ///< BBraun Diacap Pro 13H + DIALYZER_TYPE_BBRAUN_PRO_16H, ///< BBraun Diacap Pro 16H + DIALYZER_TYPE_BBRAUN_PRO_19H, ///< BBraun Diacap Pro 19H DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F160NRE, ///< Fresenius Optiflux F160NRe DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F180NRE, ///< Fresenius Optiflux F180NRe NUM_OF_DIALYZER_TYPES ///< Number of dialyzer types @@ -374,37 +503,6 @@ }; typedef enum Bicarb_Concentrates BICARB_CONCENTRATE_TYPE_T; ///< Type for bicarbonate concentrates enumeration -/// Enumeration of heparin states. -enum Heparin_States -{ - HEPARIN_STATE_OFF = 0, ///< No heparin delivery is in progress - HEPARIN_STATE_PAUSED, ///< Heparin delivery paused - HEPARIN_STATE_INITIAL_BOLUS, ///< Initial heparin bolus delivery in progress - HEPARIN_STATE_DISPENSING, ///< Gradual heparin dispensing in progress - HEPARIN_STATE_COMPLETED, ///< Heparin delivery stopped due to the set stop time before treatment end - HEPARIN_STATE_EMPTY, ///< Heparin Syringe empty - NUM_OF_HEPARIN_STATES ///< Number of saline bolus states -}; -typedef enum Heparin_States HEPARIN_STATE_T; ///< Type for heparin state enumeration - -/// Enumeration of heparin command IDs. -enum Heparin_Commands -{ - HEPARIN_CMD_PAUSE = 0, ///< Pause Heparin command - HEPARIN_CMD_RESUME, ///< Resume Heparin command - NUM_OF_HEPARIN_CMDS ///< Number of Heparin commands -}; -typedef enum Heparin_Commands HEPARIN_CMD_T; ///< Type for HEPARIN command IDs enumeration - -/// Enumeration of start/stop command parameters. -enum Saline_Commands -{ - SALINE_CMD_STOP = 0, ///< Start command - SALINE_CMD_START, ///< Stop command - NUM_OF_SALINE_CMDS ///< Number of start/stop command parameters -}; -typedef enum Saline_Commands SALINE_CMD_T; ///< Type for saline command enum. - /**@}*/ #endif