From b234053ced1f96a024afc600c6364dfcf91c341d Mon Sep 17 00:00:00 2001
From: Lakshmi Kolli <69940873+kollil@users.noreply.github.com>
Date: Mon, 10 Aug 2026 10:08:27 -0700
Subject: [PATCH 1/2] 26.3 New Diet Enddate exclusion (#1838)
Added another Diet snomed to bypass the enddate validation.
E-YYY85 - 5000 Chow
---
.../queries/onprc_ehr/MedsEndDateAlert.sql | 16 +++---
.../scripts/onprc_ehr/onprc_triggers.js | 7 ++-
.../notification/AdminNotifications.java | 52 ++++++++++---------
3 files changed, 42 insertions(+), 33 deletions(-)
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))
Click here to view the treatments
\n"); + 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 | "); ts2.forEach(object -> { Results rs = new ResultsImpl(object, colMap); String url = getParticipantURL(c, rs.getString("Id")); - msg.append("" + PageFlowUtil.filter(rs.getString("Id")) + " | \n"); - msg.append("" + PageFlowUtil.filter(rs.getString("date")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("enddate")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("frequency")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("treatmentTimes")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("project")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("code")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("volumewithunits")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("concentrationwithunits")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("amountwithunits")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("route")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("performedby")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("remark")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("reason")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("modifiedby")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("modified")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("category")) + " | "); - msg.append("" + PageFlowUtil.filter(rs.getString("taskid")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("Id")) + " | \n"); + msg.append("" + PageFlowUtil.filter(rs.getString("date")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("enddate")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("frequency")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("treatmentTimes")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("project")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("code")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("volumewithunits")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("concentrationwithunits")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("amountwithunits")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("route")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("performedby")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("remark")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("reason")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("modifiedby")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("modified")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("category")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("qcstate")) + " | "); + msg.append("" + PageFlowUtil.filter(rs.getString("taskid")) + " | \n"); msg.append(""); }); msg.append("