Full SOFA Score: Data Layer + Scoring Engine

Glasgow Coma Scale: Data Layer + Scoring Engine
This commit is contained in:
voltsrage
2026-06-21 01:09:50 +08:00
parent 78c043e4d3
commit 93ea473d2b
62 changed files with 7133 additions and 72 deletions
@@ -10,19 +10,18 @@ public static class QsofaCalculator
public static readonly IReadOnlySet<string> QsofaCodeSet =
new HashSet<string>(QsofaCodes);
// qSOFA criteria (Sepsis-3 consensus):
// - Respiratory rate ≥ 22 breaths/min
// - Systolic blood pressure ≤ 100 mmHg
// - Altered mentation: AVPU score ≥ 1 (any non-Alert state)
public static bool MeetsCriterion(string observationCode, decimal value) =>
observationCode switch
{
"RESP_RATE" => value >= 22m,
"SYSTOLIC_BP" => value <= 100m,
"AVPU" => value >= 1m,
_ => false
_ => false
};
public static bool MeetsGcsAlteredMentation(int gcsTotal) =>
GcsCalculator.MeetsQsofaAlteredMentation(gcsTotal);
public static string CriterionKey(Guid encounterId, string code) =>
$"qsofa:{encounterId}:{code}";