From 8036820fae8242b52605fd41530c5bd709a365bb Mon Sep 17 00:00:00 2001 From: kollil Date: Fri, 10 Oct 2025 14:49:27 -0700 Subject: [PATCH 1/2] Made changes to the Weights drop alert. --- .../notification/WeightAlertsNotification.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java index b661a3a64..bd1607f0e 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java @@ -79,13 +79,13 @@ public String getEmailSubject(Container c) @Override public String getCronString() { - return "0 15 9 ? * MON"; + return "0 0 12 ? * THU"; } @Override public String getScheduleDescription() { - return "every Monday, at 9:15 AM"; + return "every Thursday, at 12pm"; } @Override @@ -97,7 +97,7 @@ public String getMessageBodyHTML(Container c, User u) Date now = new Date(); msg.append("This email contains alerts of significant weight changes. It was run on: " + getDateFormat(c).format(now) + " at " + _timeFormat.format(now) + ".

"); - getLivingWithoutWeight(c, u, msg); + //getLivingWithoutWeight(c, u, msg); generateCombinedWeightTable(c, u, msg); @@ -110,7 +110,7 @@ private void generateCombinedWeightTable(final Container c, User u, final String //first weight drops Set dropDistinctIds = new HashSet<>(); - processWeights(c, u, sb, 0, 30, CompareType.LTE, -10, dropDistinctIds); + processWeights(c, u, sb, 0, 100, CompareType.LTE, -10, dropDistinctIds); consecutiveWeightDrops(c, u, sb, dropDistinctIds); if (!dropDistinctIds.isEmpty()) @@ -121,7 +121,7 @@ private void generateCombinedWeightTable(final Container c, User u, final String //also weight gains Set gainDistinctIds = new HashSet<>(); - processWeights(c, u, sb, 0, 30, CompareType.GTE, 10, gainDistinctIds); + processWeights(c, u, sb, 0, 100, CompareType.GTE, 10, gainDistinctIds); if (!gainDistinctIds.isEmpty()) { @@ -180,7 +180,8 @@ private void processWeights(Container c, User u, final StringBuilder msg, int mi final FieldKey ageKey = FieldKey.fromString("Id/age/AgeFriendly"); final FieldKey problemKey = FieldKey.fromString("Id/openProblems/problems"); final FieldKey investKey = FieldKey.fromString("Id/activeAssignments/investigators"); - final FieldKey vetsKey = FieldKey.fromString("Id/activeAssignments/vets"); + //final FieldKey vetsKey = FieldKey.fromString("Id/activeAssignments/vets"); + final FieldKey vetsKey = FieldKey.fromString("Id/assignedVet/AssignedVet"); final FieldKey peKey = FieldKey.fromString("Id/physicalExamHistory/daysSinceExam"); List colKeys = new ArrayList<>(); @@ -206,7 +207,7 @@ private void processWeights(Container c, User u, final StringBuilder msg, int mi filter.addCondition(FieldKey.fromString("IntervalInDays"), max, CompareType.LTE); Calendar date = Calendar.getInstance(); - date.add(Calendar.DATE, -30); + date.add(Calendar.DATE, -100); /// change to last 100 days filter.addCondition(FieldKey.fromString("LatestWeightDate"), getDateFormat(c).format(date.getTime()), CompareType.DATE_GTE); TableSelector ts = new TableSelector(ti, columns.values(), filter, null); From 34222c215b7492d510455afe1f2e748a9b6e8689 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 9 Dec 2025 15:10:14 -0800 Subject: [PATCH 2/2] Added query.xml files for the db tables --- .../labkey/onprc_ehr/notification/WeightAlertsNotification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java index bd1607f0e..2e8135f75 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/WeightAlertsNotification.java @@ -80,7 +80,7 @@ public String getEmailSubject(Container c) public String getCronString() { return "0 0 12 ? * THU"; - } + } //Made changes to the alert by Kollil, Refer to tkt # 13461 @Override public String getScheduleDescription()