Skip to content

Behavior alert update #1282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release24.11-SNAPSHOT
Choose a base branch
from
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 @@ -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);
Expand All @@ -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("<b>Warning: The onprc_ehr schema has not been enabled in this folder, so the alert cannot run!<p><hr>");
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("<b>List of animals receive an alopecia score of 4 or 5, but does not have an open behavioral case for alopecia:</b><p>");
if (total > 0)
{
msg.append("There are " + total + " entries found. ");
msg.append("<p><a href='" + getExecuteQueryUrl(c, "study", "BehaviorAlertforAlopecia", null) + "'>Click here to view them</a></p>\n");
msg.append("<hr>\n\n");
}
else
{
msg.append("<b>WARNING: There are no animals who receive an alopecia score of 4 or 5, but does not have an open behavioral case for alopecia !</b><br><hr>\n");
}
}

// Added by Kollil 11/04/2020
private void NHPTraining_BehaviorAlert(final Container c, User u, final StringBuilder msg)
{
Expand Down