Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -ra56db4650fe5652d633e0c51b29da32d5d708608 -r56551a81794c222eaf78d1e2e06737490c0a80a7 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision a56db4650fe5652d633e0c51b29da32d5d708608) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 56551a81794c222eaf78d1e2e06737490c0a80a7) @@ -221,7 +221,7 @@ * @brief * The setupForSelfTestsStop function sets actuators appropriately for self-tests * states. - * @details Inputs: none + * @details Inputs: dryPressureTestsCompleted, PreTreatmentSubState * @details Outputs: All pumps stopped * @return none *************************************************************************/ @@ -243,9 +243,21 @@ setValvePosition( VDI, VALVE_POSITION_A_INSERT_EJECT ); setValvePosition( VDO, VALVE_POSITION_A_INSERT_EJECT ); - setValvePosition( VBA, VALVE_POSITION_A_INSERT_EJECT ); setValvePosition( VBV, VALVE_POSITION_A_INSERT_EJECT ); - setValveAirTrap( STATE_CLOSED ); + + // If the HD has finished no cart s.t. but not dry pressure tests, Open VBT to vent pressure + // to prevent air going to the Saline bag. + if ( ( HD_PRE_TREATMENT_SELF_TEST_DRY_STATE == getPreTreatmentSubState() ) && ( FALSE == dryPressureTestsCompleted ) ) + { + setValvePosition( VBA, VALVE_POSITION_B_OPEN ); + setValveAirTrap( STATE_OPEN ); + } + + else + { + setValvePosition( VBA, VALVE_POSITION_A_INSERT_EJECT ); + setValveAirTrap( STATE_CLOSED ); + } } /*********************************************************************//** @@ -1601,6 +1613,17 @@ checkForSyringeOcclusion( FALSE ); } + // Set VBA to Pos A and close VBT after we have + // depressurized the line from failed pressure self tests. + if ( FALSE == dryPressureTestsCompleted ) + { + if ( getFilteredVenousPressure() <= NORMAL_PRESSURE_DIFF_TOLERANCE_MMHG ) + { + setValvePosition( VBA, VALVE_POSITION_A_INSERT_EJECT ); + setValveAirTrap( STATE_CLOSED ); + } + } + // if resume request, resume dry self-tests if ( TRUE == selfTestsResumeRequested ) {