Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8036820
Made changes to the Weights drop alert.
kollil Oct 10, 2025
34222c2
Added query.xml files for the db tables
kollil Dec 9, 2025
439341f
Added new functionality to the weights data
kollil Jan 9, 2026
9811c87
Added new exclusion clauses
kollil Jan 10, 2026
d49504c
Updated queries with more filters
kollil Jan 11, 2026
3fae10a
Updated queries
kollil Jan 15, 2026
c64648c
Updated query: Removed the animalid from the where clause
kollil Jan 15, 2026
ed95c68
Updated query: Removed the animalid from the where clause
kollil Jan 15, 2026
2e638a0
Updated query: Added new clauses,
kollil Jan 22, 2026
8978470
Updated query #2: Added new clauses,
kollil Jan 23, 2026
e2f0067
latest version
kollil Feb 13, 2026
dfa3148
Added a new area filter and fixed the duplicates issue in the email data
kollil Feb 27, 2026
dd35cde
Added another if clause
kollil Mar 2, 2026
fc81aee
Fixed the XML mismatches
kollil Mar 5, 2026
3a1a258
Deleted files that are not used and fixed the XML
kollil Mar 5, 2026
39a5ae7
Delete onprc_ehr/resources/queries/study/weightConsecutiveDrops_NotIn…
kollil Mar 5, 2026
33d2107
Delete onprc_ehr/resources/queries/study/weightConsecutiveDrops_NotIn…
kollil Mar 5, 2026
ab4a677
Update weightRelChange_NotInMMA.query.xml
kollil Mar 5, 2026
565fc50
Cleaned up the code
kollil Mar 5, 2026
9aee27c
Update WeightAlertsNotification.java
kollil Mar 5, 2026
29a9a4a
Created a new query as code based
kollil Mar 9, 2026
b28d172
Merge remote-tracking branch 'origin/25.7_fb_WeightDropAlertUpdate' i…
kollil Mar 9, 2026
d8a5b5f
Created a new query as code based
kollil Mar 9, 2026
0bbe714
updated query
kollil Mar 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) + ".<p>");

getLivingWithoutWeight(c, u, msg);
//getLivingWithoutWeight(c, u, msg);

generateCombinedWeightTable(c, u, msg);

Expand All @@ -110,7 +110,7 @@ private void generateCombinedWeightTable(final Container c, User u, final String

//first weight drops
Set<String> 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())
Expand All @@ -121,7 +121,7 @@ private void generateCombinedWeightTable(final Container c, User u, final String

//also weight gains
Set<String> 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())
{
Expand Down Expand Up @@ -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<FieldKey> colKeys = new ArrayList<>();
Expand All @@ -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);
Expand Down