Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r93b33e09cf47fabffc3cf93d8693c2b445a90402 -ra3573271ffbed88224af67c092fce5be0d0874dc --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 93b33e09cf47fabffc3cf93d8693c2b445a90402) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision a3573271ffbed88224af67c092fce5be0d0874dc) @@ -1014,27 +1014,27 @@ *************************************************************************/ BOOL verifyTreatmentDurationSettingChange( U32 treatmentTime ) { - BOOL result = FALSE; + BOOL result = FALSE; REQUEST_REJECT_REASON_CODE_T rejectReason = REQUEST_REJECT_REASON_NONE; - HD_OP_MODE_T currMode = getCurrentOperationMode(); + HD_OP_MODE_T currMode = getCurrentOperationMode(); // Check if we are in an appropriate treatment state for settings adjustment if ( ( MODE_TREA == currMode ) && ( currentTreatmentState > TREATMENT_START_STATE ) && ( currentTreatmentState < TREATMENT_END_STATE ) && ( CALC_ELAPSED_TREAT_TIME_IN_MIN() < treatmentTime ) && ( treatmentTime >= getMinTreatmentTimeInMinutes() ) ) { - F32 uFVolume; + // Always adjust UF volume to accommodate treatment time change (not UF rate) + F32 uFVolume = ( (F32)( treatmentTime - CALC_ELAPSED_TREAT_TIME_IN_MIN() ) * presUFRate ) + getUltrafiltrationReferenceVolume(); U32 dialVolume = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ) * treatmentTime; // In mL // The minimum treatment time is either in the range of the institutional record or the 1-minute treatment config has been requested which is an exception BOOL isMinTxTimeValid = ( ( treatmentTime >= getU32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_TREATMENT_DURATION ) ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_ONE_MINUTE_TREATMENT ) ) ? TRUE : FALSE ); + BOOL isTxTimeValid = ( ( TRUE == isMinTxTimeValid ) && + ( treatmentTime <= getU32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_TREATMENT_DURATION ) ) ? TRUE : FALSE ); + BOOL isMinUFVolValid = ( ( uFVolume >= getF32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_UF_VOLUME ) ) || ( uFVolume <= 0.0F ) ? TRUE : FALSE ); + BOOL isUFVolValid = ( ( TRUE == isMinUFVolValid ) && ( uFVolume <= getF32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_UF_VOLUME ) ) ? TRUE : FALSE ); - // Always adjust UF volume to accommodate treatment time change (not UF rate) - uFVolume = ( (F32)( treatmentTime - CALC_ELAPSED_TREAT_TIME_IN_MIN() ) * presUFRate ) + getUltrafiltrationReferenceVolume(); - if ( ( TRUE == isMinTxTimeValid ) && - ( treatmentTime <= getU32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_TREATMENT_DURATION ) ) && - ( dialVolume <= MAX_DIALYSATE_VOLUME_ML ) && - ( uFVolume <= MAX_UF_VOLUME_ML ) ) + if ( ( TRUE == isTxTimeValid ) && ( dialVolume <= MAX_DIALYSATE_VOLUME_ML ) && ( TRUE == isUFVolValid ) ) { result = TRUE; sendTreatmentLogEventData( TREATMENT_DURATION_CHANGE_EVENT, ( presTreatmentTimeSecs / SEC_PER_MIN ), treatmentTime ); @@ -1052,7 +1052,7 @@ { rejectReason = REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE; } - else if ( uFVolume > MAX_UF_VOLUME_ML ) + else if ( FALSE == isUFVolValid ) { rejectReason = REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE; } Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r88dd475deace8ca8c34d131ad8c594b090daabfc -ra3573271ffbed88224af67c092fce5be0d0874dc --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 88dd475deace8ca8c34d131ad8c594b090daabfc) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision a3573271ffbed88224af67c092fce5be0d0874dc) @@ -638,8 +638,10 @@ break; case TREATMENT_PARAM_TREATMENT_DURATION: - result = ( ( value.uInt >= hdInstitutionalRecord.minTxDurationMIN ) && - ( value.uInt <= hdInstitutionalRecord.maxTxDurationMIN ) ? TRUE : FALSE ); + result = ( ( value.uInt >= hdInstitutionalRecord.minTxDurationMIN ) && + ( value.uInt <= hdInstitutionalRecord.maxTxDurationMIN ) ? TRUE : FALSE ); + // If the 1-minute treatment is selected, it is ok to accept the time. This test configuration specifically checks for a 1-minute run + result |= ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_ONE_MINUTE_TREATMENT ) ? TRUE : FALSE ); break; case TREATMENT_PARAM_HEPARIN_PRE_STOP_TIME: