Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r38355442b06187fe5d57deca647b3adf2fa26b89 -r110304ff98888f6b3bcba19d75d6b268cdd0e9d4 --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 38355442b06187fe5d57deca647b3adf2fa26b89) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 110304ff98888f6b3bcba19d75d6b268cdd0e9d4) @@ -41,6 +41,8 @@ #define NO_HEPARIN_PRE_STOP_TIME_SET 0 ///< Zero value indicates no Heparin pre-stop time was set by user +#define NO_HEPARIN_TYPE_SET 0xFFFFFFFF ///< UI will send this value for Heparin type if Heparin not used + /// Record for range and default of treatment parameters. typedef struct { @@ -474,6 +476,12 @@ BOOL paramsAreInRange, paramsAreConsistent; U32 rejReasons[ NUM_OF_TREATMENT_PARAMS ]; + // Special handling of Heparin Type - UI may send as -1 if Heparin not used - if so, confirm Heparin params not set and bring type into range before range check + if ( ( NO_HEPARIN_TYPE_SET == params.heparinType ) && ( params.heparinBolusVolume_mL < NEARLY_ZERO ) && ( params.heparinDispenseRate_mL_hr < NEARLY_ZERO ) ) + { + params.heparinType = 0; + } + // Extract treatment parameters from given payload to staging array so we can more easily work with them extractTreatmentParamsFromPayload( params );