Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -rca8a4a4cf6d2c59d9296c3abdf314765550a2624 -rd1bc0f8c1853416dd5258b38a17413faa3515f84 --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision ca8a4a4cf6d2c59d9296c3abdf314765550a2624) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision d1bc0f8c1853416dd5258b38a17413faa3515f84) @@ -21,6 +21,7 @@ #include "AlarmMgmt.h" #include "BloodLeak.h" +#include "DialInFlow.h" #include "FPGA.h" #include "NVDataMgmtHDRecords.h" #include "OperationModes.h" @@ -866,7 +867,7 @@ { case MODE_TREA: case MODE_SERV: - if ( FALSE == isDialysateLineInBypass() ) + if ( ( FALSE == isDialysateLineInBypass() ) && ( getTreatmentState() != TREATMENT_RECIRC_STATE ) && ( getDialysisState() != DIALYSIS_SALINE_BOLUS_STATE ) ) { if ( BLOOD_LEAK_DETECTED == getBloodLeakStatus() ) { @@ -930,7 +931,10 @@ bloodLeakStatus.data = getFPGABloodDetectProcessedStatus(); - if ( BLOOD_LEAK_NOT_DETECTED == getBloodLeakStatus() ) + // Check if the blood is not detected but at the same time the Dialin pump should be running to make sure we are in the + // blood recovery state of the treatment stop so the blood detection recovery is not done on the stagnant fluid + // NOTE: should we check of the measured flow is about 600 mL/min? + if ( ( BLOOD_LEAK_NOT_DETECTED == getBloodLeakStatus() ) && ( TRUE == isDialInPumpRunning() ) ) { if ( TRUE == didTimeout( bloodLeakRecoveryStartTimeMS, BLOOD_LEAK_DETECT_RECOVERY_MIN_TIME_MS ) ) {