feature: qSOFA Scoring & Sepsis Bundle Compliance
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
public class SepsisBundle
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid EncounterId { get; set; }
|
||||
public Guid TriggeringAlertId { get; set; }
|
||||
public string TriggeringAlertType { get; set; } = null!;
|
||||
public DateTimeOffset RecognizedAt { get; set; }
|
||||
public DateTimeOffset DeadlineAt { get; set; }
|
||||
public SepsisBundleComplianceStatus ComplianceStatus { get; set; } =
|
||||
SepsisBundleComplianceStatus.InProgress;
|
||||
public DateTimeOffset? CompletedAt { get; set; }
|
||||
|
||||
public Encounter Encounter { get; set; } = null!;
|
||||
public ClinicalAlert TriggeringAlert { get; set; } = null!;
|
||||
public ICollection<SepsisBundleElement> Elements { get; set; } = new List<SepsisBundleElement>();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
public class SepsisBundleElement
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid BundleId { get; set; }
|
||||
public SepsisBundleElementType ElementType { get; set; }
|
||||
public SepsisBundleElementStatus Status { get; set; } = SepsisBundleElementStatus.Pending;
|
||||
public Guid? OrderId { get; set; }
|
||||
public DateTimeOffset? CompletedAt { get; set; }
|
||||
|
||||
public SepsisBundle Bundle { get; set; } = null!;
|
||||
public Order? Order { get; set; }
|
||||
}
|
||||
@@ -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}'")
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user