Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petermolnar-dev/069a751e80ddfdef5998d7cf913f87dd to your computer and use it in GitHub Desktop.
Save petermolnar-dev/069a751e80ddfdef5998d7cf913f87dd to your computer and use it in GitHub Desktop.
Blood Pressure Classifier dense
class BloodPressureClassifier {
static func classifyBloodpessure(systolicValue: Int, diastoicValue: Int) -> BloodPressureClassification {
switch (systolicValue, diastoicValue) {
case (SystolicRanges.severeHyperTensionRange, _), (_, DiastolicRanges.severeHyperTensionRange):
return .severeHypertension
case (SystolicRanges.moderateHypertensionRange, _), (_, DiastolicRanges.moderateHypertensionRange):
return .moderateHypertension
case (SystolicRanges.mildHypertensionRange, _), (_, DiastolicRanges.mildHypertensionRange):
return .mildHypertension
case (SystolicRanges.highNormalRange, _), (_, DiastolicRanges.highNormalRange):
return.highNormal
case (_, DiastolicRanges.normalRange):
return .normal
case (SystolicRanges.baseRange, _), (_, DiastolicRanges.baseRange):
return .base
default:
return .unidentified
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment