Esempio n. 1
0
        public static BloodPressureUnitCategory Categorise(BloodPressureUnit unit, BloodPressureUnits asUnit)
        {
            switch (asUnit)
            {
            case BloodPressureUnits.Diastolic:
                return(CategoriseDiastolicValue(unit));

            case BloodPressureUnits.Systolic:
                return(CategoriseSystolicValue(unit));
            }
            throw new NotSupportedException("Unsupported BloodPressureUnits specified");
        }
Esempio n. 2
0
        private static BloodPressureUnitCategory CategoriseSystolicValue(BloodPressureUnit unit)
        {
            var systolic = unit.MmHg;

            if (systolic < 90)
            {
                return(BloodPressureUnitCategory.Low);
            }

            if (systolic > 140)
            {
                return(BloodPressureUnitCategory.High);
            }

            if (systolic > 120)
            {
                return(BloodPressureUnitCategory.PreHigh);
            }

            return(BloodPressureUnitCategory.Normal);
        }
Esempio n. 3
0
        private static BloodPressureUnitCategory CategoriseDiastolicValue(BloodPressureUnit unit)
        {
            var diastolic = unit.MmHg;

            if (diastolic < 60)
            {
                return(BloodPressureUnitCategory.Low);
            }

            if (diastolic > 90)
            {
                return(BloodPressureUnitCategory.High);
            }

            if (diastolic > 80)
            {
                return(BloodPressureUnitCategory.PreHigh);
            }

            return(BloodPressureUnitCategory.Normal);
        }
Esempio n. 4
0
 public static (BloodPressureUnitCategory SystolicCategory, BloodPressureUnitCategory DiastolicCategory) CategoriseBloodPressureReading(BloodPressureUnit systolic, BloodPressureUnit diastolic)
 {
     return(CategoriseSystolicValue(systolic), CategoriseDiastolicValue(diastolic));
 }