feature: Explainable Alerts

This commit is contained in:
voltsrage
2026-06-25 00:25:31 +08:00
parent 279add1e45
commit 666d683d67
61 changed files with 9553 additions and 125 deletions
@@ -1,3 +1,4 @@
public record AlertGeneratedEvent(
Guid AlertId, Guid EncounterId, Guid PatientId, string? Department,
string AlertType, string Severity, DateTimeOffset TriggeredAt);
string AlertType, string Severity, DateTimeOffset TriggeredAt,
AlertExplanation? Explanation = null);
@@ -0,0 +1,13 @@
public record AlertResponse(
Guid Id,
Guid EncounterId,
Guid PatientId,
AlertType AlertType,
AlertSeverity Severity,
string Details,
AlertStatus Status,
DateTimeOffset TriggeredAt,
DateTimeOffset? AcknowledgedAt,
string? AcknowledgedBy,
DateTimeOffset? ResolvedAt,
AlertExplanation? Explanation);
@@ -3,7 +3,8 @@ public record GcsResult(
int? TotalScore = null,
string? Classification = null,
bool AlertCreated = false,
int PresentComponents = 0)
int PresentComponents = 0,
List<ScoreContributor>? Contributors = null)
{
public static readonly GcsResult NotGcsCode = new(GcsOutcome.NotGcsCode);
public static readonly GcsResult EncounterNotFound = new(GcsOutcome.EncounterNotFound);
@@ -4,7 +4,8 @@ public record News2Result(
string? RiskLevel = null,
bool AlertCreated = false,
int PresentParameters = 0,
bool HasSingleParamThree = false)
bool HasSingleParamThree = false,
List<ScoreContributor>? Contributors = null)
{
public static readonly News2Result NotNews2Code = new(News2Outcome.NotNews2Code);
public static readonly News2Result EncounterNotFound = new(News2Outcome.EncounterNotFound);
@@ -3,7 +3,8 @@ public record SofaScoringResult(
SofaResult? Score = null,
bool IsBaseline = false,
int? DeltaFromBaseline = null,
bool AlertCreated = false)
bool AlertCreated = false,
List<ScoreContributor>? Contributors = null)
{
public static readonly SofaScoringResult NotSofaTrigger = new(SofaOutcome.NotSofaTrigger);
public static readonly SofaScoringResult EncounterNotFound = new(SofaOutcome.EncounterNotFound);
@@ -2,4 +2,5 @@ public record TrendResult(
TrendOutcome Outcome,
string? ObservationCode = null,
decimal? RatePerMinute = null,
bool AlertCreated = false);
bool AlertCreated = false,
TrendContext? Trend = null);