From ebebcaa077b78826318767ac7f611bb26152a4ff Mon Sep 17 00:00:00 2001 From: JheanLL Date: Sun, 31 May 2026 15:06:10 -0500 Subject: [PATCH] Add email notifications for critical vitals --- src/com/hpms/service/AlertEngine.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/hpms/service/AlertEngine.java b/src/com/hpms/service/AlertEngine.java index 62be2ec..389d88a 100644 --- a/src/com/hpms/service/AlertEngine.java +++ b/src/com/hpms/service/AlertEngine.java @@ -46,6 +46,10 @@ public Alert generateAlert(VitalReading reading, AlertThreshold threshold) { public void dispatchNotification(Alert alert) { UUID defaultOnCall = UUID.fromString("00000000-0000-0000-0000-000000000002"); notificationService.sendInAppNotification(defaultOnCall, alert); + + if ("CRITICAL".equals(alert.getSeverity())) { + notificationService.sendEmailNotification("emergency@hospital.com", alert); + } } private boolean isBreached(VitalReading reading, AlertThreshold threshold) {