diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/BehaviorNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/BehaviorNotification.java index 7a951fab6..35d950f86 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/BehaviorNotification.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/BehaviorNotification.java @@ -105,6 +105,7 @@ public String getMessageBodyHTML(Container c, User u) surgeryCasesRecentlyClosed(c, u, msg); pairIdConflicts(c, u , msg); NHPTraining_BehaviorAlert(c, u , msg); + AlopeciaAlert(c, u, msg); //Added by Kollil, 3/7/2025 dcmNotesAlert(c, u , msg); notesEndingToday(c, u, msg, Arrays.asList("BSU Notes"), null); @@ -113,6 +114,31 @@ public String getMessageBodyHTML(Container c, User u) return msg.toString(); } + // Added by Kollil 03/07/2025, Tkt # 12145 + private void AlopeciaAlert(final Container c, User u, final StringBuilder msg) + { + if (QueryService.get().getUserSchema(u, c, "study") == null) { + msg.append("Warning: The onprc_ehr schema has not been enabled in this folder, so the alert cannot run!


"); + return; + } + TableInfo ti = QueryService.get().getUserSchema(u, c, "study").getTable("BehaviorAlertforAlopecia",ContainerFilter.Type.AllFolders.create(c, u)); +// ((ContainerFilterable) ti).setContainerFilter(ContainerFilter.Type.AllFolders.create(u); + TableSelector ts = new TableSelector(ti, null, null); + + long total = ts.getRowCount(); + msg.append("List of animals receive an alopecia score of 4 or 5, but does not have an open behavioral case for alopecia:

"); + if (total > 0) + { + msg.append("There are " + total + " entries found. "); + msg.append("

Click here to view them

\n"); + msg.append("
\n\n"); + } + else + { + msg.append("WARNING: There are no animals who receive an alopecia score of 4 or 5, but does not have an open behavioral case for alopecia !

\n"); + } + } + // Added by Kollil 11/04/2020 private void NHPTraining_BehaviorAlert(final Container c, User u, final StringBuilder msg) {