Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -ra7104162b3467a67c5f4ed2f0f2ec038a8738d33 -r521a0569bf3097e9f7075d9c0e99dca9af3e6410 --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision a7104162b3467a67c5f4ed2f0f2ec038a8738d33) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision 521a0569bf3097e9f7075d9c0e99dca9af3e6410) @@ -22,12 +22,31 @@ // ********** public definitions ********** +/// Sub-mode states while in treatment mode +typedef 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_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_RINSEBACK_PAUSE_STATE, ///< Rinseback paused. Blood pump off. Dialyzer bypassed. Dialysate recirculating. + TREATMENT_RECIRC_SETUP_STATE, ///< Rinseback complete. Blood pump off. Blood lines closed. User to disconnect and shunt blood lines. + TREATMENT_RECIRC_STATE, ///< Recirculate saline and dialysate while patient disconnected. Blood lines open and shunted. Dialyzer is bypassed. + TREATMENT_RECIRC_PAUSE_STATE, ///< Recirculate paused. Blood pump off. Blood lines closed and shunted. Dialyzer is bypassed. + TREATMENT_RECIRC_STOP_STATE, ///< Recirculate stopped. Blood pump off. Blood lines open. Waiting for patient to unshunt and connect and resume treatment. + 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. + NUM_OF_TREATMENT_STATES ///< # of treatment states (sub-modes). +} TREATMENT_STATE_T; + // ********** private function prototypes ********** void initTreatmentMode( void ); // initialize this module void transitionToTreatmentMode( void ); // prepares for transition to treatment mode void execTreatmentMode( void ); // execute the treatment mode state machine (call from OperationModes) +TREATMENT_STATE_T getTreatmentState( void ); + BOOL verifyTreatmentDurationSettingChange( U32 treatmentTime ); BOOL verifyUFSettingsChange( F32 uFVolume, UF_ADJ_T adjustment ); BOOL verifyUFSettingsConfirmation( BOOL confirmed, F32 uFVolume, U32 treatmentTime, F32 uFRate );