Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r1fac9ba116252c4919505b7b8fee80c175c81c86 -rec17ff0ee8477fde41197b5cadb5b665cf56fd75 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 1fac9ba116252c4919505b7b8fee80c175c81c86) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision ec17ff0ee8477fde41197b5cadb5b665cf56fd75) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2021-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 Rinseback.c * -* @author (last) Sean Nash -* @date (last) 08-Sep-2023 +* @author (last) Vinayakam Mani +* @date (last) 10-Apr-2024 * * @author (original) Sean Nash * @date (original) 20-Jan-2021 @@ -45,6 +45,7 @@ #define DEFAULT_RINSEBACK_FLOW_RATE_ML_MIN 200 ///< Default rinseback flow rate (in mL/min). #define MIN_RINSEBACK_FLOW_RATE_ML_MIN 100 ///< Minimum rinseback flow rate (in mL/min). #define MAX_RINSEBACK_FLOW_RATE_ML_MIN 300 ///< Maximum rinseback flow rate (in mL/min). +#define DEFAULT_FILL_RESERVOIR_TO_VOLUME_ML 1500 ///< default Fill reservoir to this volume (in mL). /// Interval at which rinseback progress is to be published to UI. #define RINSEBACK_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) @@ -188,6 +189,20 @@ stopSyringePump(); endAirTrapControl(); + // If DG restarted for some reason, lets make sure we set the heating parameters first before commanding to + // turn on the trimmer heater and start the DG as well. + if ( DG_MODE_STAN == getDGOpMode() ) + { + F32 targetTempC = getTreatmentParameterF32( TREATMENT_PARAM_DIALYSATE_TEMPERATURE ); + U32 dialysateFlowMLPM = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ); + + // Set the heating parameters + setPreTreatmentHeatingParams( targetTempC, DEFAULT_FILL_RESERVOIR_TO_VOLUME_ML, DEFAULT_TARGET_FILL_FLOW_RATE_LPM, dialysateFlowMLPM ); + + // Start the DG + cmdStartDG(); + } + // Re-circulate dialysate side of dialyzer w/ heating to maintain temperature setDialInPumpTargetFlowRate( DIALYSATE_FLOW_RATE_FOR_RECIRC, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); cmdStartDGTrimmerHeater(); @@ -212,6 +227,21 @@ setBloodPumpTargetFlowRate( rate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // Start air trap leveling control startAirTrapControl(); + + // If DG restarted for some reason, lets make sure we set the heating parameters first before commanding to + // turn on the trimmer heater and start the DG as well. + if ( DG_MODE_STAN == getDGOpMode() ) + { + F32 targetTempC = getTreatmentParameterF32( TREATMENT_PARAM_DIALYSATE_TEMPERATURE ); + U32 dialysateFlowMLPM = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ); + + // Set the heating parameters + setPreTreatmentHeatingParams( targetTempC, DEFAULT_FILL_RESERVOIR_TO_VOLUME_ML, DEFAULT_TARGET_FILL_FLOW_RATE_LPM, dialysateFlowMLPM ); + + // Start the DG + cmdStartDG(); + } + // Re-circulate dialysate side of dialyzer w/ heating to maintain temperature setDialInPumpTargetFlowRate( DIALYSATE_FLOW_RATE_FOR_RECIRC, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); cmdStartDGTrimmerHeater(); @@ -347,10 +377,6 @@ setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); - if ( isTreatmentCompleted() != TRUE ) - { - sendTreatmentLogEventData( MID_TREATMENT_RINSE_BACK_EVENT, 0.0, rinsebackRate_mL_min ); - } setupForRinsebackDelivery( rinsebackRate_mL_min ); // From moment we start rinseback, we consider blood side of dialyzer no longer fully primed setBloodIsPrimed( FALSE );