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"); }
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); }
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); }
public static (BloodPressureUnitCategory SystolicCategory, BloodPressureUnitCategory DiastolicCategory) CategoriseBloodPressureReading(BloodPressureUnit systolic, BloodPressureUnit diastolic) { return(CategoriseSystolicValue(systolic), CategoriseDiastolicValue(diastolic)); }