diff --git a/onprc_ehr/resources/queries/onprc_ehr/NewBirthTasks.query.xml b/onprc_ehr/resources/queries/onprc_ehr/NewBirthTasks.query.xml new file mode 100644 index 000000000..378eb9dc8 --- /dev/null +++ b/onprc_ehr/resources/queries/onprc_ehr/NewBirthTasks.query.xml @@ -0,0 +1,55 @@ + + + + + New Birth tasks created in last 7 days + + + Task ID + /ehr/dataEntryForm.view?formType=${formtype}&taskid=${taskid} + + + Title + + + Task Type + + + Assigned To + true + + core + PrincipalsWithoutAdmin + UserId + + + + Due Date + true + yyyy-MM-dd HH:mm + + + Created By + + core + users + userid + + + + Created + true + yyyy-MM-dd HH:mm + + + Status + false + true + Status + 50 + + +
+
+
+
diff --git a/onprc_ehr/resources/queries/onprc_ehr/NewBirthTasks.sql b/onprc_ehr/resources/queries/onprc_ehr/NewBirthTasks.sql new file mode 100644 index 000000000..841349e66 --- /dev/null +++ b/onprc_ehr/resources/queries/onprc_ehr/NewBirthTasks.sql @@ -0,0 +1,21 @@ +/** + * Created by Kollil, 10/25 + * Get a list of tasks daily on a rolling 7 day window to review for QC. + * This will allow techs to see what new IDs were created by whom, and review for accuracy, + * housing history, group ids and flags. + * Refer tkt # 13504 + */ +SELECT + t.taskid, + t.title, + t.formType as TaskType, + t.assignedto, + t.duedate, + t.createdby, + t.created, + t.qcstate as Status +FROM ehr.tasks t +WHERE t.created >= TIMESTAMPADD('day', -7, NOW()) +And t.formtype = 'birth' + + diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java index 0a40e50fa..35a6e44a4 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java @@ -1551,7 +1551,7 @@ else if (rs.getString("ActiveClinicalTreatment") != null && rs.getString("Active protected void LongTermMedsAlert(final Container c, User u, final StringBuilder msg) { if (QueryService.get().getUserSchema(u, c, "onprc_ehr") == null) { - msg.append("Warning: The study schema has not been enabled in this folder, so the alert cannot run!


"); + msg.append("Warning: The onprc_ehr schema has not been enabled in this folder, so the alert cannot run!


"); return; } @@ -2333,6 +2333,33 @@ protected void duplicateFlags(Container c, User u, final StringBuilder msg) } } + /** + * Created by Kollil, 10/25 + * Get a list of tasks daily on a rolling 7-day window to review for QC. + * This will allow techs to see what new IDs were created by whom, and review for accuracy, + * housing history, group ids and flags. + * Refer tkt # 13504 + */ + protected void newBirthTasks(final Container c, User u, final StringBuilder msg) + { + if (QueryService.get().getUserSchema(u, c, "onprc_ehr") == null) { + msg.append("Warning: The onprc_ehr schema has not been enabled in this folder, so the alert cannot run!


"); + return; + } + + //Get birth tasks + TableInfo ti = QueryService.get().getUserSchema(u, c, "onprc_ehr").getTable("NewBirthTasks", ContainerFilter.Type.AllFolders.create(c, u)); + TableSelector ts = new TableSelector(ti, null, null); + long count = ts.getRowCount(); + + if (count > 0) { + msg.append("WARNING: There are " + count + " new birth(s) found in last 7 days.
"); + msg.append("

Click here to view them

\n"); + msg.append("
"); + } + + } + /** * Created by Kollil, 9/6/23 * Get the new animals found with the flag, "NHPR NOTE: BCG Vaccinated". diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/DataValidationNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/DataValidationNotification.java index 79b34ea4c..8268a7fc0 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/DataValidationNotification.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/DataValidationNotification.java @@ -112,6 +112,9 @@ public String getMessageBodyHTML(Container c, User u) birthRecordsNotMatchingHousing(c, u, msg); duplicateGroupMembership(c, u, msg); duplicateFlags(c, u, msg); + //Added by Kolli, Oct 2025 + //Tasks list alert for the new animal births, Refer to # 13504 + newBirthTasks(c, u, msg); //only send if there are alerts if (!msg.isEmpty())