Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r25ede6f944eb53b68c8073404663c99d3ce158b0 -r7dc4bb045389ac95e6658602f2659f6071542361 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 25ede6f944eb53b68c8073404663c99d3ce158b0) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 7dc4bb045389ac95e6658602f2659f6071542361) @@ -40,7 +40,6 @@ #define TUBING_RINSEBACK_VOLUME_ML 80.0F ///< Target rinseback volume to deliver back to the patient (in mL). #define DEFAULT_RINSEBACK_VOLUME_ML 300.0F ///< Default rinseback volume (in mL). #define MAX_TOTAL_ADDITIONAL_RINSEBACK_VOLUME_ML 300.0F ///< Maximum total additional rinseback volume allowed : all additionals (in mL). -#define MAX_RINSEBACK_VOLUME_ERROR_ML 60.0F ///< Maximum error in total additional rinseback volume (20% of total). #define TARGET_ADDITIONAL_RINSEBACK_VOLUME_ML 10.0F ///< Target rinseback volume for an additional volume request (in mL). #define RINSEBACK_FLOW_RATE_ADJ_ML_MIN 25 ///< Adjustment amount (in mL/min) to apply when user requests increase/decrease in flow rate. #define MIN_RINSEBACK_FLOW_RATE_ML_MIN 50 ///< Minimum rinseback flow rate (in mL/min). @@ -63,7 +62,6 @@ static F32 rinsebackTargetVolume_mL; ///< Calculated target rinseback volume (based on selected dialyzer and fixed tubing volume). static OVERRIDE_F32_T cumulativeRinsebackVolume_mL = { 0.0, 0.0, 0.0, 0 }; ///< Total cumulative rinseback volume (in mL) from measured blood flow rate. -static F32 expectedRinsebackVolume_mL = 0.0; ///< Total cumulative rinseback volume (in mL) expected based on target blood flow rate. static F32 targetRinsebackVolumePlusAdditional_mL; ///< Target rinseback volume w/ additional volume(s) added (in mL). static F32 additionalRinsebackVolume_mL; ///< Total volume (in mL) delivered so far for additional volume request. static F32 totalAdditionalRinsebackVolume_mL; ///< Total accumulated volume (in mL) delivered so far for all additional volumes combined. @@ -127,7 +125,6 @@ targetRinsebackVolumePlusAdditional_mL = rinsebackTargetVolume_mL; rinsebackTimerCtr = 0; cumulativeRinsebackVolume_mL.data = 0.0; - expectedRinsebackVolume_mL = 0.0; additionalRinsebackVolume_mL = 0.0; totalAdditionalRinsebackVolume_mL = 0.0; rinsebackAdditionalTimerCtr = 0; @@ -356,7 +353,7 @@ else if ( rinsebackTimerCtr > MAX_RINSEBACK_TIME ) { signalGoToTreatmentStopped(); - activateAlarmNoData( ALARM_ID_TREATMENT_RINSEBACK_TIMEOUT_ALARM ); + activateAlarmNoData( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_ALARM ); } return result; @@ -379,7 +376,6 @@ // Update rinseback volume delivered so far cumulativeRinsebackVolume_mL.data += ( getMeasuredBloodFlowRate() * RINSEBACK_FLOW_INTEGRATOR ); - expectedRinsebackVolume_mL += ( (F32)getTargetBloodFlowRate() * RINSEBACK_FLOW_INTEGRATOR ); // Has user requested to end rinseback? if ( TRUE == endRinsebackRequested ) @@ -399,7 +395,7 @@ // Check for empty saline bag if ( TRUE == isSalineBagEmpty() ) { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_EMPTY_SALINE_BAG, getMeasuredArterialPressure() ); + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_EMPTY_SALINE_BAG, getMeasuredArterialPressure() ); setupForRinsebackStopOrPause(); result = RINSEBACK_PAUSED_STATE; } @@ -409,19 +405,6 @@ setupForRinsebackStopOrPause(); result = RINSEBACK_PAUSED_STATE; } - // Is rinseback taking too long? - else if ( fabs( expectedRinsebackVolume_mL - getRinsebackVolume() ) > MAX_RINSEBACK_VOLUME_ERROR_ML ) - { -#ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMP_FLOW_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) -#endif - { - setRinsebackIsCompleted( TRUE ); - setupForRinsebackStopOrPause(); - activateAlarmNoData( ALARM_ID_RINSEBACK_VOLUME_CHECK_FAILURE ); - result = RINSEBACK_STOP_STATE; - } - } // Otherwise, continue rinseback else { // Has user requested rate change? @@ -466,7 +449,7 @@ if ( rinsebackTimerCtr > MAX_RINSEBACK_TIME ) { signalGoToTreatmentStopped(); - activateAlarmNoData( ALARM_ID_TREATMENT_RINSEBACK_TIMEOUT_ALARM ); + activateAlarmNoData( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_ALARM ); } else if ( TRUE == resumeRinsebackRequested ) { @@ -499,7 +482,7 @@ if ( ( rinsebackTimerCtr > MAX_RINSEBACK_TIME ) && ( getRinsebackVolume() < rinsebackTargetVolume_mL ) ) { signalGoToTreatmentStopped(); - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TREATMENT_RINSEBACK_TIMEOUT_ALARM, rinsebackTimerCtr, MAX_RINSEBACK_TIME ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_ALARM, rinsebackTimerCtr, MAX_RINSEBACK_TIME ); } else if ( TRUE == recircRequested ) { @@ -555,7 +538,7 @@ // Check for empty saline bag if ( TRUE == isSalineBagEmpty() ) { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_EMPTY_SALINE_BAG, getMeasuredArterialPressure() ); + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_EMPTY_SALINE_BAG, getMeasuredArterialPressure() ); targetRinsebackVolumePlusAdditional_mL = getRinsebackVolume(); result = RINSEBACK_STOP_STATE; } @@ -929,6 +912,10 @@ { *rejReason = REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED; } + else if ( TRUE == isTreatmentResumeBlocked() ) + { + *rejReason = REQUEST_REJECT_REASON_TREATMENT_CANNOT_BE_RESUMED; + } else if ( ( RINSEBACK_STOP_INIT_STATE != rinsebackState ) && ( RINSEBACK_STOP_STATE != rinsebackState ) ) { *rejReason = REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE;