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
@@ -6,11 +6,24 @@ public static class DbResetHelper
// the database, and preserves the schema (migrations do not re-run).
public static async Task ResetAsync(AppDbContext db)
{
await db.Database.ExecuteSqlRawAsync(@"
TRUNCATE TABLE reconciliation_alerts, outbox_events, orders,
clinical_alerts, news2_scores, observations, encounters,
alert_thresholds, patients
RESTART IDENTITY CASCADE;
");
for (var attempt = 0; ; attempt++)
{
try
{
await db.Database.ExecuteSqlRawAsync(@"
SET lock_timeout = '3s';
TRUNCATE TABLE sepsis_bundle_elements, sepsis_bundles,
reconciliation_alerts, outbox_events, orders,
clinical_alerts, news2_scores, observations, encounters,
alert_thresholds, patients
RESTART IDENTITY CASCADE;
");
return;
}
catch when (attempt < 5)
{
await Task.Delay(1000);
}
}
}
}