Skip to content
Open
Changes from all commits
Commits
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";
} //Made changes to the alert by Kollil, Refer to tkt # 13461

@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