Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r8c8ac9430cbd0a836b51d16a02457575861c5990 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 8c8ac9430cbd0a836b51d16a02457575861c5990) @@ -79,7 +79,6 @@ #define VENOUS_PRESSURE_MAX_MMHG ( 2000.0F ) ///< Maximum venous pressure reading (in mmHg) for range check. #define VENOUS_PRESSURE_MIN_MMHG ( -1500.0F ) ///< Minimum venous pressure reading (in mmHg) for range check. #define VENOUS_PRESSURE_LIMIT_MAX_MMHG ( 400.0F ) ///< Maximum venous pressure limit (in mmHg). -#define VENOUS_PRESSURE_LIMIT_MIN_MMHG ( 0.0F ) ///< Minimum venous pressure limit (in mmHg). #define VENOUS_PRESSURE_OCCL_OFFSET_MMHG ( 50.0F ) ///< Venous pressure occlusion threshold offset from max alarm limit (in mmHg). #define VENOUS_PRESSURE_EXEMPTION_PERIOD ( ( 2 * MS_PER_SECOND ) / \ TASK_GENERAL_INTERVAL ) ///< Venous pressure low exemption period (in task interval) after fill for all blood flow rate @@ -443,7 +442,7 @@ currentArterialMaxLimit = (S32)ARTERIAL_PRESSURE_LIMIT_MAX_MMHG; currentArterialMinLimit = (S32)ARTERIAL_PRESSURE_LIMIT_MIN_MMHG; currentVenousMaxLimit = (S32)VENOUS_PRESSURE_LIMIT_MAX_MMHG; - currentVenousMinLimit = (S32)VENOUS_PRESSURE_LIMIT_MIN_MMHG; + currentVenousMinLimit = (S32)getMinVenousPressureWideValueMMHG(); } /*********************************************************************//** @@ -539,16 +538,17 @@ ( PRESSURE_LIMITS_STATE_STABILIZATION_2 == currPresLimitsState ) ) { // apply pressure windows when stable - S32 artOffset = getTreatmentParameterS32( TREATMENT_PARAM_ART_PRES_LIMIT_WINDOW ) / 2; // Arterial is symmetric - S32 venMinOffset = getTreatmentParameterS32( TREATMENT_PARAM_VEN_PRES_LIMIT_ASYMMETRIC ); // Venous is asymmetric - S32 venMaxOffset = getTreatmentParameterS32( TREATMENT_PARAM_VEN_PRES_LIMIT_WINDOW ) - venMinOffset; + S32 artOffset = getTreatmentParameterS32( TREATMENT_PARAM_ART_PRES_LIMIT_WINDOW ) / 2; // Arterial is symmetric + S32 venMinOffset = getTreatmentParameterS32( TREATMENT_PARAM_VEN_PRES_LIMIT_ASYMMETRIC ); // Venous is asymmetric + S32 venMaxOffset = getTreatmentParameterS32( TREATMENT_PARAM_VEN_PRES_LIMIT_WINDOW ) - venMinOffset; + U32 venMinWideLimitMMHG = getMinVenousPressureWideValueMMHG(); currentArterialMinLimit = stableArterialPressure - artOffset; currentArterialMinLimit = MAX( currentArterialMinLimit, ARTERIAL_PRESSURE_LIMIT_MIN_MMHG ); currentArterialMaxLimit = stableArterialPressure + artOffset; currentArterialMaxLimit = MIN( currentArterialMaxLimit, ARTERIAL_PRESSURE_LIMIT_MAX_MMHG ); currentVenousMinLimit = stableVenousPressure - venMinOffset; - currentVenousMinLimit = MAX( currentVenousMinLimit, VENOUS_PRESSURE_LIMIT_MIN_MMHG ); + currentVenousMinLimit = MAX( currentVenousMinLimit, venMinWideLimitMMHG ); currentVenousMaxLimit = stableVenousPressure + venMaxOffset; currentVenousMaxLimit = MIN( currentVenousMaxLimit, VENOUS_PRESSURE_LIMIT_MAX_MMHG ); } Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r592af09c58d6270e3f6b3ebc3ce87147ba9ea3c1 -r8c8ac9430cbd0a836b51d16a02457575861c5990 --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 592af09c58d6270e3f6b3ebc3ce87147ba9ea3c1) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 8c8ac9430cbd0a836b51d16a02457575861c5990) @@ -45,6 +45,7 @@ #define INSTIT_CHEM_DISINFECT_ENABLE_RANGE 1 ///< Institutional record chemical disinfect enable/disable allowable range #define INSTIT_MIN_RO_REJECTION_RATIO_MAX_PCT 99 ///< Institutional record min RO rejection ratio maximum in percent. #define INSTIT_MAX_INLET_WATER_COND_ALARM_USPCM 300.0F ///< Institutional record max inlet water conductivity alarm in uS/cm. +#define INSTIT_MAX_MIN_VEN_PRES_WIDE_LIMIT_MMHG 20 ///< Institutional record max min venous pressure wide limit in mmHg. /// Record for range and default of treatment parameters. typedef struct @@ -951,6 +952,19 @@ /*********************************************************************//** * @brief + * The getMinVenousPressureWideValueMMHG function returns the min venous + * pressure wide limit window in mmHg. + * @details Inputs: hdInstitutionalRecord + * @details Outputs: none + * @return the min venous pressure wide limit window in mmHg. + *************************************************************************/ +U32 getMinVenousPressureWideValueMMHG( void ) +{ + return hdInstitutionalRecord.minVenPressWideLimitWindowMMHG; +} + +/*********************************************************************//** + * @brief * The isNVInstitutionalRecordInRange function checks whether all the * institutional NV records are valid and within range or not. * @details Inputs: none @@ -1032,6 +1046,8 @@ result &= ( ( nvInstRcrd->minRORejectionRatioPCT <= INSTIT_MIN_RO_REJECTION_RATIO_MAX_PCT ) ? TRUE : FALSE ); result &= ( ( nvInstRcrd->minInletWaterCondAlarmLimitUSPCM >= 0.0F ) && ( nvInstRcrd->minInletWaterCondAlarmLimitUSPCM <= INSTIT_MAX_INLET_WATER_COND_ALARM_USPCM ) ? TRUE : FALSE ); + // NOTE: min venous and arterial pressure wide limits are not needed to be >= 0 because it is a U32 + result &= ( ( nvInstRcrd->minVenPressWideLimitWindowMMHG <= INSTIT_MAX_MIN_VEN_PRES_WIDE_LIMIT_MMHG ) ? TRUE : FALSE ); return result; } Index: firmware/App/Modes/ModeTreatmentParams.h =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r8c8ac9430cbd0a836b51d16a02457575861c5990 --- firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision 8c8ac9430cbd0a836b51d16a02457575861c5990) @@ -114,6 +114,7 @@ S32 getS32DefaultTreatmentParamEdge( TREATMENT_PARAM_T param, BOOL isMin ); U32 getU32DefaultTreatmentParamEdge( TREATMENT_PARAM_T param, BOOL isMin ); F32 getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_T param, BOOL isMin ); +U32 getMinVenousPressureWideValueMMHG( void ); BOOL isNVInstitutionalRecordInRange( HD_INSTITUTIONAL_RECORD_T* nvInstRcrd ); // Is non-volatile memory institutional record in range void setNVInstitutionalRecordToTxParamsRecord( HD_INSTITUTIONAL_RECORD_T* nvInstitutionalRecord ); // Set the recently received institution record from NV to local tx parameters