Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r14d740bbb065f043daaa348bcda5f447e1c16a32 -r7dc4bb045389ac95e6658602f2659f6071542361 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 14d740bbb065f043daaa348bcda5f447e1c16a32) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 7dc4bb045389ac95e6658602f2659f6071542361) @@ -40,15 +40,14 @@ // ********** private definitions ********** -#define MAX_UF_VOLUME_ACCURACY_ERROR_ML 50.0F ///< Maximum ultrafiltration volume accuracy error in mL over the entire treatment. -#define MAX_UF_RATE_ACCURACY_ERROR_ML_MIN 5.0F ///< Maximum ultrafiltration rate accuracy error in mL/min over use of single reservoir during treatment. +#define MAX_UF_VOLUME_ACCURACY_ERROR_ML 100.0F ///< Maximum ultrafiltration volume accuracy error in mL over the entire treatment. +#define MAX_UF_RATE_ACCURACY_ERROR_ML_MIN 10.0F ///< Maximum ultrafiltration rate accuracy error in mL/min over use of single reservoir during treatment. /// Saline bolus data broadcast interval (ms/task time) count. static const U32 SALINE_BOLUS_DATA_PUB_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); #define MAX_SALINE_VOLUME_DELIVERED 800 ///< Maximum saline volume delivered for a treatment. #define SALINE_BOLUS_RATE_ML_MIN 300 ///< Fixed rate for saline bolus delivery. -#define MAX_BOLUS_ERROR_PCT 0.2F ///< Maximum error in saline bolus volume delivered (as a percentage of target). #define MAX_ACTIVE_LOAD_CELL_CHANGE_G 50.0F ///< Maximum delta between new and previous measured UF volume. @@ -108,7 +107,6 @@ static BOOL autoResumeUF; ///< Flag indicates UF should be auto-resumed after saline bolus completes. static F32 totalSalineVolumeDelivered_mL; ///< Volume (mL) in total of saline delivered so far (cumulative for all boluses including current one). static F32 bolusSalineVolumeDelivered_mL; ///< Volume (mL) of current bolus delivered so far (calculated from measured blood flow rate). -static F32 expectedSalineBolusVolume_mL; ///< Volume (mL) of current bolus delivered so far (calculated from target blood flow rate). static U32 bolusSalineLastVolumeTimeStamp; ///< Time stamp for last saline volume update. #ifdef DIALYZER_REPRIME_ENABLED @@ -224,7 +222,6 @@ salineBolusStartRequested = FALSE; salineBolusAbortRequested = FALSE; bolusSalineVolumeDelivered_mL = 0.0; - expectedSalineBolusVolume_mL = 0.0; if ( currentSalineBolusState != SALINE_BOLUS_STATE_MAX_DELIVERED ) { currentSalineBolusState = SALINE_BOLUS_STATE_IDLE; @@ -1019,7 +1016,6 @@ { // Reset bolus data before we start bolusSalineVolumeDelivered_mL = 0.0; - expectedSalineBolusVolume_mL = 0.0; bolusSalineLastVolumeTimeStamp = getMSTimerCount(); // Bypass dialyzer @@ -1053,7 +1049,6 @@ BOOL errorFound = FALSE; F32 timeSinceLastVolumeUpdateMin = (F32)calcTimeSince( bolusSalineLastVolumeTimeStamp ) / (F32)( MS_PER_SECOND * SEC_PER_MIN ); F32 bolusTargetVolume = (F32)getTreatmentParameterU32( TREATMENT_PARAM_SALINE_BOLUS_VOLUME ); - F32 maxBolusErrorMl = bolusTargetVolume * MAX_BOLUS_ERROR_PCT; F32 bldFlowRate = getMeasuredBloodFlowRate(); F32 volSinceLastUpdateMl = bldFlowRate * timeSinceLastVolumeUpdateMin; F32 expVolSinceLastUpdateMl = (F32)getTargetBloodFlowRate() * timeSinceLastVolumeUpdateMin; @@ -1062,12 +1057,11 @@ bolusSalineLastVolumeTimeStamp = getMSTimerCount(); bolusSalineVolumeDelivered_mL += volSinceLastUpdateMl; totalSalineVolumeDelivered_mL += volSinceLastUpdateMl; - expectedSalineBolusVolume_mL += expVolSinceLastUpdateMl; // Check for empty saline bag per arterial line pressure 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() ); errorFound = TRUE; result = SALINE_BOLUS_STATE_IDLE; } @@ -1090,18 +1084,6 @@ salineBolusAbortRequested = FALSE; result = SALINE_BOLUS_STATE_IDLE; } - // Determine if saline bolus is under/over delivering - else if ( fabs( expectedSalineBolusVolume_mL - bolusSalineVolumeDelivered_mL ) > maxBolusErrorMl ) - { -#ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMP_FLOW_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) -#endif - { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_SALINE_BOLUS_VOLUME_CHECK_FAILURE, bolusSalineVolumeDelivered_mL, expectedSalineBolusVolume_mL ); - errorFound = TRUE; - result = SALINE_BOLUS_STATE_IDLE; - } - } } // Are we stopping the bolus? @@ -1372,7 +1354,7 @@ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ULTRAFILTRATION_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) #endif { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_UF_VOLUME_ACCURACY_ERROR, refUFVolume, measUFVolume ); + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_UF_VOLUME_ACCURACY_ERROR, refUFVolume, measUFVolume ); } } } @@ -1490,7 +1472,7 @@ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ULTRAFILTRATION_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) #endif { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_UF_RATE_TOO_HIGH_ERROR, uFMeasRate ); + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_UF_RATE_ERROR, uFMeasRate ); } } SEND_EVENT_WITH_2_F32_DATA( HD_EVENT_RSRVR_UF_VOLUME_AND_TIME, uFResVolumeInMl, resUFTimeInMin )