diff --git a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql index a6dc2db26..83d52ee3d 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql +++ b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql @@ -9,14 +9,17 @@ Added Diet to the list by Kollil on 5/14/25. Refer to tkt #12506 5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) + + Added Diet to the list by Kollil on 8/5/2026. Refer to tkt #15123 +6. E-YYY85 - Diet, 5000 Chow */ SELECT Id, - date, + CAST(date AS DATE) AS date, enddate, - frequency, + frequency.meaning as frequency, treatmenttimes, - project, + project.displayname as project, code, volumewithunits, concentrationwithunits, @@ -25,10 +28,11 @@ SELECT performedby, remark, reason, - modifiedby, - modified, + modifiedby.displayname as modifiedby, + CAST(modified AS DATE) AS modified, category, + qcstate.label as qcstate, taskid.rowid as TaskId FROM study.treatment_order -WHERE code NOT IN ('E-85760', 'E-Y7735', 'E-X0500', 'E-Y9750', 'E-X1380') +WHERE code NOT IN ('E-85760', 'E-Y7735', 'E-X0500', 'E-Y9750', 'E-X1380', 'E-YYY85') AND enddate is null \ No newline at end of file diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js index 30a298a30..51e4b53e8 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1064,12 +1064,15 @@ exports.init = function(EHR){ Added Diet to the list by Kollil on 5/14/25. Refer to tkt #12506 5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) + + Added Diet to the list by Kollil on 8/5/2026. Refer to tkt #15123 + 6. E-YYY85 - Diet, 5000 Chow */ + if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && - row.code != 'E-Y9750' && row.code != 'E-X1380' && !row.enddate) { + row.code != 'E-Y9750' && row.code != 'E-X1380' && row.code != 'E-YYY85' && !row.enddate) { EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); } - //Added by Kollil, 9/15/25 /* MPA validation, as per ticket #9669 Add validation code to ensure that MPA is ordered for the correct day: diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java index d9fc7fd8e..534ac5cce 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java @@ -106,13 +106,14 @@ private void MedsEndDateAlert(Container c, User u, final StringBuilder msg, fina "
2. E-Y7735 (Diet - Weekly Multivitamin)" + "
3. E-X0500 (Diet, L-Phyto (Low-phytoestrogen)) " + "
4. E-Y9750 (Diet, 5047 High Protein, Jumbo) " + - "
5. E-X1380 (Diet Daily (Non-standard), 5LOP (TAD))
"); + "
5. E-X1380 (Diet Daily (Non-standard), 5LOP (TAD)) " + + "
6. E-YYY85 (5000 Chow)
"); } else if (count > 0) { //Display the report link on the notification page - msg.append("
" + count + " treatment order(s) found with missing end dates

"); - msg.append("

Click here to view the treatments

\n"); + msg.append("
" + count + " treatment order(s) found with missing end dates. "); + msg.append("Click here to view the Medications/Diets in a grid view\n"); msg.append("
"); //Display the report in the email @@ -134,40 +135,41 @@ else if (count > 0) columns.add(FieldKey.fromString("modifiedby")); columns.add(FieldKey.fromString("modified")); columns.add(FieldKey.fromString("category")); + columns.add(FieldKey.fromString("qcstate")); columns.add(FieldKey.fromString("taskid")); final Map colMap = QueryService.get().getColumns(ti, columns); TableSelector ts2 = new TableSelector(ti, colMap.values(), null, new Sort("date")); // Table header - msg.append(""); - msg.append(""); - msg.append("
"); + + msg.append("
"); msg.append(""); - msg.append(""); + msg.append(""); ts2.forEach(object -> { Results rs = new ResultsImpl(object, colMap); String url = getParticipantURL(c, rs.getString("Id")); - msg.append("\n"); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); + msg.append("\n"); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append("\n"); msg.append(""); }); msg.append("
Id Begin Date End Date Frequency Times Charge To Treatment Volume Concentration Amount Route Ordered By Remark Reason Modified By Modified Date Category Task Id
Id Begin Date End Date Frequency Times Charge To Treatment Volume Concentration Amount Route Ordered By Remark Reason Modified By Modified Date Category QCState Task Id
" + PageFlowUtil.filter(rs.getString("Id")) + "" + PageFlowUtil.filter(rs.getString("date")) + "" + PageFlowUtil.filter(rs.getString("enddate")) + "" + PageFlowUtil.filter(rs.getString("frequency")) + "" + PageFlowUtil.filter(rs.getString("treatmentTimes")) + "" + PageFlowUtil.filter(rs.getString("project")) + "" + PageFlowUtil.filter(rs.getString("code")) + "" + PageFlowUtil.filter(rs.getString("volumewithunits")) + "" + PageFlowUtil.filter(rs.getString("concentrationwithunits")) + "" + PageFlowUtil.filter(rs.getString("amountwithunits")) + "" + PageFlowUtil.filter(rs.getString("route")) + "" + PageFlowUtil.filter(rs.getString("performedby")) + "" + PageFlowUtil.filter(rs.getString("remark")) + "" + PageFlowUtil.filter(rs.getString("reason")) + "" + PageFlowUtil.filter(rs.getString("modifiedby")) + "" + PageFlowUtil.filter(rs.getString("modified")) + "" + PageFlowUtil.filter(rs.getString("category")) + "" + PageFlowUtil.filter(rs.getString("taskid")) + " " + PageFlowUtil.filter(rs.getString("Id")) + " " + PageFlowUtil.filter(rs.getString("date")) + "" + PageFlowUtil.filter(rs.getString("enddate")) + "" + PageFlowUtil.filter(rs.getString("frequency")) + "" + PageFlowUtil.filter(rs.getString("treatmentTimes")) + "" + PageFlowUtil.filter(rs.getString("project")) + "" + PageFlowUtil.filter(rs.getString("code")) + "" + PageFlowUtil.filter(rs.getString("volumewithunits")) + "" + PageFlowUtil.filter(rs.getString("concentrationwithunits")) + "" + PageFlowUtil.filter(rs.getString("amountwithunits")) + "" + PageFlowUtil.filter(rs.getString("route")) + "" + PageFlowUtil.filter(rs.getString("performedby")) + "" + PageFlowUtil.filter(rs.getString("remark")) + "" + PageFlowUtil.filter(rs.getString("reason")) + "" + PageFlowUtil.filter(rs.getString("modifiedby")) + "" + PageFlowUtil.filter(rs.getString("modified")) + "" + PageFlowUtil.filter(rs.getString("category")) + "" + PageFlowUtil.filter(rs.getString("qcstate")) + "" + PageFlowUtil.filter(rs.getString("taskid")) + "
");