Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r0aba18162f271555453e7f9266f990a7c22779a6 -rad76efb3e9196e5cee4d8ab824dcd88507c66ade --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 0aba18162f271555453e7f9266f990a7c22779a6) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision ad76efb3e9196e5cee4d8ab824dcd88507c66ade) @@ -642,8 +642,14 @@ break; case TREATMENT_PARAM_HEPARIN_PRE_STOP_TIME: - result = ( ( value.uInt >= hdInstitutionalRecord.minStopHeparinDispBeforeTxEndMIN ) && - ( value.uInt <= hdInstitutionalRecord.maxStopHeparinDispBeforeTxEndMIN ) ? TRUE : FALSE ); + result = ( ( value.uInt >= hdInstitutionalRecord.minStopHeparinDispBeforeTxEndMIN ) && + ( value.uInt <= hdInstitutionalRecord.maxStopHeparinDispBeforeTxEndMIN ) ? TRUE : FALSE ); + // The value of the heparin pre stop time should only be checked if the heparin dispense rate in not zero. + // If the stop time is outside of range but the heparin dispense rate is 0, this item has passed regardless. + // If the stop time is outside of range and the heparin is not 0, then this item has failed. + // Staged params is directly used because the heparin dispense rate is check after the stop so we need to know about it + // prior to checking later in this switch case + result |= ( stagedParams[ TREATMENT_PARAM_HEPARIN_DISPENSE_RATE ].sFlt <= NEARLY_ZERO ? TRUE : FALSE ); break; case TREATMENT_PARAM_SALINE_BOLUS_VOLUME: @@ -673,19 +679,19 @@ case TREATMENT_PARAM_UF_VOLUME: result = ( ( value.sFlt >= hdInstitutionalRecord.minUFVolumeL ) && ( value.sFlt <= hdInstitutionalRecord.maxUFVolumeL ) ? TRUE : FALSE ); - result |= ( value.sFlt <= NEARLY_ZERO ? TRUE : FALSE ); // There might be a minimum UF volume set in the instit record but a treatment with 0 vol should be allowed + result |= ( value.sFlt <= NEARLY_ZERO ? TRUE : FALSE ); // There might be a minimum UF volume set in the institutional record but a treatment with 0 vol should be allowed break; case TREATMENT_PARAM_HEPARIN_DISPENSE_RATE: result = ( ( value.sFlt >= hdInstitutionalRecord.minHeparinDispRateMLPM ) && ( value.sFlt <= hdInstitutionalRecord.maxHeparinDispRateMLPM ) ? TRUE : FALSE ); - result |= ( 0 == value.sFlt ? TRUE : FALSE ); // Even if the minimum is not 0, 0 is accepted meaning heparin can be turned off + result |= ( value.sFlt <= NEARLY_ZERO ? TRUE : FALSE ); // Even if the minimum is not 0, 0 is accepted meaning heparin can be turned off break; case TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME: result = ( ( value.sFlt >= hdInstitutionalRecord.minHeparinBolusVolumeML ) && ( value.sFlt <= hdInstitutionalRecord.maxHeparinBolusVolumeML ) ? TRUE : FALSE ); - result |= ( 0 == value.sFlt ? TRUE : FALSE ); // Even if the minimum is not 0, 0 is accepted meaning heparin can be turned off + result |= ( value.sFlt <= NEARLY_ZERO ? TRUE : FALSE ); // Even if the minimum is not 0, 0 is accepted meaning heparin can be turned off break; default: