feature: qSOFA Scoring & Sepsis Bundle Compliance

This commit is contained in:
voltsrage
2026-06-18 22:52:43 +08:00
parent 3c54feb38a
commit 4b46c09f90
34 changed files with 2351 additions and 18 deletions
@@ -29,6 +29,8 @@ public enum AlertType
News2Emergency,
RapidDeterioration,
QsofaWarning,
}
public static class AlertTypeExtensions
@@ -60,6 +62,7 @@ public static class AlertTypeExtensions
AlertType.News2Warning => "NEWS2_WARNING",
AlertType.News2Emergency => "NEWS2_EMERGENCY",
AlertType.RapidDeterioration => "RAPID_DETERIORATION",
AlertType.QsofaWarning => "QSOFA_WARNING",
_ => throw new ArgumentOutOfRangeException(nameof(t))
};
@@ -90,6 +93,7 @@ public static class AlertTypeExtensions
"NEWS2_WARNING" => AlertType.News2Warning,
"NEWS2_EMERGENCY" => AlertType.News2Emergency,
"RAPID_DETERIORATION" => AlertType.RapidDeterioration,
"QSOFA_WARNING" => AlertType.QsofaWarning,
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown alert type: '{v}'")
};
@@ -136,7 +140,7 @@ public static class AlertTypeExtensions
or AlertType.CriticalLactateMmolL or AlertType.CriticalAvpu
or AlertType.CriticalGlucoseMgDl => false,
AlertType.RapidDeterioration => false, // trajectory alerts are never suppressed
_ => true // all Warning* types and News2Warning
_ => true // all Warning* types, News2Warning, and QsofaWarning
};
public static string? ObservationCodeForWarning(this AlertType t) => t switch
@@ -0,0 +1,25 @@
public enum SepsisBundleComplianceStatus
{
InProgress,
Compliant,
NonCompliant
}
public static class SepsisBundleComplianceStatusExtensions
{
public static string ToDbString(this SepsisBundleComplianceStatus s) => s switch
{
SepsisBundleComplianceStatus.InProgress => "IN_PROGRESS",
SepsisBundleComplianceStatus.Compliant => "COMPLIANT",
SepsisBundleComplianceStatus.NonCompliant => "NON_COMPLIANT",
_ => throw new ArgumentOutOfRangeException(nameof(s))
};
public static SepsisBundleComplianceStatus FromDbString(string v) => v switch
{
"IN_PROGRESS" => SepsisBundleComplianceStatus.InProgress,
"COMPLIANT" => SepsisBundleComplianceStatus.Compliant,
"NON_COMPLIANT" => SepsisBundleComplianceStatus.NonCompliant,
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown compliance status: '{v}'")
};
}
@@ -0,0 +1,22 @@
public enum SepsisBundleElementStatus
{
Pending,
Completed
}
public static class SepsisBundleElementStatusExtensions
{
public static string ToDbString(this SepsisBundleElementStatus s) => s switch
{
SepsisBundleElementStatus.Pending => "PENDING",
SepsisBundleElementStatus.Completed => "COMPLETED",
_ => throw new ArgumentOutOfRangeException(nameof(s))
};
public static SepsisBundleElementStatus FromDbString(string v) => v switch
{
"PENDING" => SepsisBundleElementStatus.Pending,
"COMPLETED" => SepsisBundleElementStatus.Completed,
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown bundle element status: '{v}'")
};
}
@@ -0,0 +1,28 @@
public enum SepsisBundleElementType
{
BloodCultures,
SerumLactate,
BroadSpectrumAntibiotics,
IvFluidResuscitation
}
public static class SepsisBundleElementTypeExtensions
{
public static string ToDbString(this SepsisBundleElementType t) => t switch
{
SepsisBundleElementType.BloodCultures => "BLOOD_CULTURES",
SepsisBundleElementType.SerumLactate => "SERUM_LACTATE",
SepsisBundleElementType.BroadSpectrumAntibiotics => "BROAD_SPECTRUM_ANTIBIOTICS",
SepsisBundleElementType.IvFluidResuscitation => "IV_FLUID_RESUSCITATION",
_ => throw new ArgumentOutOfRangeException(nameof(t))
};
public static SepsisBundleElementType FromDbString(string v) => v switch
{
"BLOOD_CULTURES" => SepsisBundleElementType.BloodCultures,
"SERUM_LACTATE" => SepsisBundleElementType.SerumLactate,
"BROAD_SPECTRUM_ANTIBIOTICS" => SepsisBundleElementType.BroadSpectrumAntibiotics,
"IV_FLUID_RESUSCITATION" => SepsisBundleElementType.IvFluidResuscitation,
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown bundle element type: '{v}'")
};
}