Skip to content
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

[bot] Merge 24.11 to develop #1265

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions extscheduler/resources/views/schedulertest.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<link href="/ExtScheduler/Sch/ONPRC/Schedule/resources/css/sch-all-debug.css" rel="stylesheet" type="text/css" />

<!--Ext JS includes-->
<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/ext-all-debug.js" type="text/javascript"></script>
<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/theme-classic.js" type="text/javascript"></script>
<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/ext-all-debug.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>
<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/theme-classic.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>

<!--Scheduler files-->
<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/sch-all-debug.js" type="text/javascript"></script>
<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/sch-all-debug.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>

<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/examples-shared.js" type="text/javascript"></script>
<script src="/ExtScheduler/Sch/ONPRC/Schedule/resources/extJs/examples-shared.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>

<title>Simple Editor Demo</title>
</head>
Expand Down
12 changes: 6 additions & 6 deletions extscheduler/resources/views/weeklyTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<!--<link href="/ExtScheduler/css/sch-all-triton.css" rel="stylesheet" type="text/css" />-->

<!-- Ext JS includes -->
<script src="/ExtScheduler/resources/extJs/ext-all.js" type="text/javascript"></script>
<!--<script src="/ExtScheduler/js/ext-all-debug.js" type="text/javascript"></script>-->
<script src="/ExtScheduler/weekview/resources/css/theme-triton/theme-triton.js" crossorigin="anonymous" type="text/javascript"></script>
<!--<script src="/ExtScheduler/js/theme-triton-debug.js" crossorigin="anonymous" type="text/javascript"></script>-->
<script src="/ExtScheduler/resources/extJs/ext-all.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>
<!--<script src="/ExtScheduler/js/ext-all-debug.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>-->
<script src="/ExtScheduler/weekview/resources/css/theme-triton/theme-triton.js" crossorigin="anonymous" type="text/javascript" nonce="<%=scriptNonce%>"></script>
<!--<script src="/ExtScheduler/js/theme-triton-debug.js" crossorigin="anonymous" type="text/javascript" nonce="<%=scriptNonce%>"></script>-->

<!-- Scheduler files -->
<script src="/ExtScheduler/resources/extJs/sch-all.js?ver=4.2.1" type="text/javascript"></script>
<!--<script src="/ExtScheduler/js/sch-all-debug.js" type="text/javascript"></script>-->
<script src="/ExtScheduler/resources/extJs/sch-all.js?ver=4.2.1" type="text/javascript" nonce="<%=scriptNonce%>"></script>
<!--<script src="/ExtScheduler/js/sch-all-debug.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>-->

<title>Scheduler Week View</title>
</head>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="Procedures_Missing_PainLevels" tableDbType="TABLE">
<tableTitle>Procedures created with no USDA Pain Categories</tableTitle>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- This query extracts the active procedures that were created newly with missing USDA pain categories.
-- Set the date range to 1 year back from curr date
Select
Name as ProcedureName,
PainCategories as USDAPainCategories,
Category,
major as IsMajor,
Active
From ehr_lookups.procedures
Where active = 'true'
And PainCategories IS NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="Procedures_Missing_PainLevels" tableDbType="TABLE">
<tableTitle>Active procedures with no USDA Pain Categories</tableTitle>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ protected void pmicServicesRequestAlert(final Container c, User u, final StringB
//End of PMIC alert

/**
* Kollil, 12/22/2022 : Find the procedure entries where the PainCategory on the procedure is not defined (IS NULL).
* Kollil, 12/22/2022 : Find the procedure entries in the encounters table where the PainCategory on the procedure is not defined (IS NULL).
* This email notification is sent to Jeff every Thursday at 7:30am.
*/
protected void proceduresWithoutUSDAPainLevels(final Container c, User u, final StringBuilder msg)
Expand All @@ -1306,7 +1306,7 @@ protected void proceduresWithoutUSDAPainLevels(final Container c, User u, final
long count = ts.getRowCount();

if (count > 0) {//procedures count
msg.append("<br><b>Active procedures with missing USDA categories:</b><br><br>");
msg.append("<br><b>The following procedures were performed with missing USDA pain categories:</b><br><br>");
msg.append("<b>" + count + " procedure(s) found:</b>");
msg.append("<p><a href='" + getExecuteQueryUrl(c, "onprc_ehr", "Procedures_Missing_PainLevels", null) + "'>Click here to view the procedures in PRIME</a></p>\n");
msg.append("<hr>");
Expand All @@ -1330,7 +1330,7 @@ protected void proceduresWithoutUSDAPainLevels(final Container c, User u, final
TableSelector ts2 = new TableSelector(ti, colMap.values(), null, null);

// Table header
msg.append("<br><br><table border=1 style='border-collapse: collapse;'>");
msg.append("<table border=1 style='border-collapse: collapse;'>");
msg.append("<tr bgcolor = " + '"' + "#00FF7F" + '"' + "style='font-weight: bold;'>");
msg.append("<td> Id </td><td> Center Project </td><td> Date </td><td> Procedure </td><td> USDA Categories </td></tr>");

Expand All @@ -1350,6 +1350,68 @@ public void exec(ResultSet object) throws SQLException
msg.append("</tr>");
}
});
msg.append("</table><br>");
}
}

/**
* Kollil, 2/12/2024 : Find the procedure entries where the PainCategory is not defined (IS NULL).
* This email notification is sent to Jeff every Thursday at 7:30am.
*/
protected void proceduresCreatedWithNoPainLevels(final Container c, User u, final StringBuilder msg)
{
if (QueryService.get().getUserSchema(u, c, "onprc_ehr") == null) {
msg.append("<b>Warning: The onprc_ehr schema has not been enabled in this folder, so the alert cannot run!<p><hr>");
return;
}

//procedures query
TableInfo ti = QueryService.get().getUserSchema(u, c, "onprc_ehr").getTable("NewProcedures_missing_PainLevels", ContainerFilter.Type.AllFolders.create(c, u));
//((ContainerFilterable) ti).setContainerFilter(ContainerFilter.Type.AllFolders.create(c, u));
TableSelector ts = new TableSelector(ti, null, null);
long count = ts.getRowCount();

if (count > 0) {//procedures count
msg.append("<br><b>Procedures created with no USDA pain categories:</b><br><br>");
msg.append("<b>" + count + " procedure(s) found:</b>");
msg.append("<p><a href='" + getExecuteQueryUrl(c, "onprc_ehr", "NewProcedures_missing_PainLevels", null) + "'>Click here to view the procedures in PRIME</a></p>\n");
msg.append("<hr>");
}

if (count == 0) {
msg.append("<b>Currently, there are no active procedures with no USDA pain categories!</b><hr>");
}

//Display the daily report in the email
if (count > 0)
{
Set<FieldKey> columns = new HashSet<>();
columns.add(FieldKey.fromString("ProcedureName"));
columns.add(FieldKey.fromString("USDAPainCategories"));
columns.add(FieldKey.fromString("Category"));
columns.add(FieldKey.fromString("IsMajor"));
columns.add(FieldKey.fromString("Active"));

final Map<FieldKey, ColumnInfo> colMap = QueryService.get().getColumns(ti, columns);
TableSelector ts2 = new TableSelector(ti, colMap.values(), null, null);

// Table header
msg.append("<table border=1 style='border-collapse: collapse;'>");
msg.append("<tr bgcolor = " + '"' + "#00FF7F" + '"' + "style='font-weight: bold;'>");
msg.append("<td> Procedure Name </td><td> USDA Pain Categories </td><td> Category </td></tr>");

ts2.forEach(new Selector.ForEachBlock<ResultSet>()
{
@Override
public void exec(ResultSet object) throws SQLException
{
Results rs = new ResultsImpl(object, colMap);
msg.append("<td>" + PageFlowUtil.filter(rs.getString("ProcedureName")) + "</td>");
msg.append("<td>" + PageFlowUtil.filter(rs.getString("USDAPainCategories")) + "</td>");
msg.append("<td>" + PageFlowUtil.filter(rs.getString("Category")) + "</td>");
msg.append("</tr>");
}
});
msg.append("</table>");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public String getMessageBodyHTML(Container c, User u)
StringBuilder msg = new StringBuilder();

proceduresWithoutUSDAPainLevels(c, u, msg);
proceduresCreatedWithNoPainLevels (c,u,msg);

return msg.toString();
}
Expand Down