feature: Trend Detection & Alert Suppression Windows
This commit is contained in:
@@ -35,6 +35,15 @@ public class WarningEvaluator
|
||||
// critical alerts are created synchronously by the ingest path.
|
||||
if (IsCriticalBreach(value, threshold)) return false;
|
||||
|
||||
var alertType = AlertTypeExtensions.WarningFor(observationCode);
|
||||
var suppression = _services.GetRequiredService<IAlertSuppressionService>();
|
||||
if (await suppression.IsSuppressedAsync(encounterId, alertType, ct))
|
||||
{
|
||||
_logger.LogDebug(
|
||||
"Warning alert suppressed for encounter {Id} type {Type}", encounterId, alertType);
|
||||
return false;
|
||||
}
|
||||
|
||||
return await TryCreateWarningAlertAsync(
|
||||
observationId, encounterId, patientId, observationCode, value, threshold, ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user