feature: Clinical Data Model Expansion & Observation Vocabulary
This commit is contained in:
@@ -6,7 +6,12 @@ public enum AlertType
|
||||
CriticalPotassiumMeqL,
|
||||
CriticalSpo2,
|
||||
CriticalRespRate,
|
||||
CriticalWbcKUl
|
||||
CriticalWbcKUl,
|
||||
CriticalSystolicBp,
|
||||
CriticalDiastolicBp,
|
||||
CriticalLactateMmolL,
|
||||
CriticalAvpu,
|
||||
CriticalGlucoseMgDl
|
||||
}
|
||||
|
||||
public static class AlertTypeExtensions
|
||||
@@ -20,6 +25,11 @@ public static class AlertTypeExtensions
|
||||
AlertType.CriticalSpo2 => "CRITICAL_SPO2",
|
||||
AlertType.CriticalRespRate => "CRITICAL_RESP_RATE",
|
||||
AlertType.CriticalWbcKUl => "CRITICAL_WBC_K_UL",
|
||||
AlertType.CriticalSystolicBp => "CRITICAL_SYSTOLIC_BP",
|
||||
AlertType.CriticalDiastolicBp => "CRITICAL_DIASTOLIC_BP",
|
||||
AlertType.CriticalLactateMmolL => "CRITICAL_LACTATE_MMOL_L",
|
||||
AlertType.CriticalAvpu => "CRITICAL_AVPU",
|
||||
AlertType.CriticalGlucoseMgDl => "CRITICAL_GLUCOSE_MG_DL",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(t))
|
||||
};
|
||||
|
||||
@@ -32,6 +42,11 @@ public static class AlertTypeExtensions
|
||||
"CRITICAL_SPO2" => AlertType.CriticalSpo2,
|
||||
"CRITICAL_RESP_RATE" => AlertType.CriticalRespRate,
|
||||
"CRITICAL_WBC_K_UL" => AlertType.CriticalWbcKUl,
|
||||
"CRITICAL_SYSTOLIC_BP" => AlertType.CriticalSystolicBp,
|
||||
"CRITICAL_DIASTOLIC_BP" => AlertType.CriticalDiastolicBp,
|
||||
"CRITICAL_LACTATE_MMOL_L" => AlertType.CriticalLactateMmolL,
|
||||
"CRITICAL_AVPU" => AlertType.CriticalAvpu,
|
||||
"CRITICAL_GLUCOSE_MG_DL" => AlertType.CriticalGlucoseMgDl,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown alert type: '{v}'")
|
||||
};
|
||||
|
||||
@@ -44,6 +59,11 @@ public static class AlertTypeExtensions
|
||||
"SPO2" => AlertType.CriticalSpo2,
|
||||
"RESP_RATE" => AlertType.CriticalRespRate,
|
||||
"WBC_K_UL" => AlertType.CriticalWbcKUl,
|
||||
"SYSTOLIC_BP" => AlertType.CriticalSystolicBp,
|
||||
"DIASTOLIC_BP" => AlertType.CriticalDiastolicBp,
|
||||
"LACTATE_MMOL_L" => AlertType.CriticalLactateMmolL,
|
||||
"AVPU" => AlertType.CriticalAvpu,
|
||||
"GLUCOSE_MG_DL" => AlertType.CriticalGlucoseMgDl,
|
||||
_ => throw new ArgumentOutOfRangeException(
|
||||
nameof(observationCode), $"No critical alert type for observation code '{observationCode}'")
|
||||
};
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
public enum BloodType
|
||||
{
|
||||
APositive,
|
||||
ANegative,
|
||||
BPositive,
|
||||
BNegative,
|
||||
AbPositive,
|
||||
AbNegative,
|
||||
OPositive,
|
||||
ONegative
|
||||
}
|
||||
|
||||
public static class BloodTypeExtensions
|
||||
{
|
||||
public static string ToDbString(this BloodType b) => b switch
|
||||
{
|
||||
BloodType.APositive => "A+",
|
||||
BloodType.ANegative => "A-",
|
||||
BloodType.BPositive => "B+",
|
||||
BloodType.BNegative => "B-",
|
||||
BloodType.AbPositive => "AB+",
|
||||
BloodType.AbNegative => "AB-",
|
||||
BloodType.OPositive => "O+",
|
||||
BloodType.ONegative => "O-",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(b))
|
||||
};
|
||||
|
||||
public static BloodType FromDbString(string v) => v switch
|
||||
{
|
||||
"A+" => BloodType.APositive,
|
||||
"A-" => BloodType.ANegative,
|
||||
"B+" => BloodType.BPositive,
|
||||
"B-" => BloodType.BNegative,
|
||||
"AB+" => BloodType.AbPositive,
|
||||
"AB-" => BloodType.AbNegative,
|
||||
"O+" => BloodType.OPositive,
|
||||
"O-" => BloodType.ONegative,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown blood type: '{v}'")
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user