From cb1e2efa03311a7d788a0a0c9c3396094af025d1 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 5 Aug 2026 15:21:21 -0700 Subject: [PATCH 1/7] Added another Diet snomed to bypass the enddate validation --- onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js | 6 +++++- .../labkey/onprc_ehr/notification/AdminNotifications.java | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js index 30a298a30..bd31c990f 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1064,9 +1064,13 @@ 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 + 5. E-YYY85 - 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'); } 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..3f470ebc1 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java @@ -106,7 +106,8 @@ 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) { From 2edad4a5f1cfe569fb993e76482f0f89621dd8bc Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 5 Aug 2026 18:32:18 -0700 Subject: [PATCH 2/7] Added another Diet snomed to bypass the enddate validation --- onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js index bd31c990f..5b847edea 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1066,7 +1066,7 @@ exports.init = function(EHR){ 5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) Added Diet to the list by Kollil on 8/5/2026. Refer to tkt #15123 - 5. E-YYY85 - 5000 Chow + 5. E-YYY85 - Diet, 5000 Chow */ if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && From 85158bc4f3bafec2db39c319d032953d508139fb Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 5 Aug 2026 21:50:38 -0700 Subject: [PATCH 3/7] Added another Diet snomed to bypass the enddate validation --- onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js index 5b847edea..51e4b53e8 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1066,14 +1066,13 @@ exports.init = function(EHR){ 5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) Added Diet to the list by Kollil on 8/5/2026. Refer to tkt #15123 - 5. E-YYY85 - Diet, 5000 Chow - + 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.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: From 36dd9e7c526ff1d03d8eac023727339082186065 Mon Sep 17 00:00:00 2001 From: kollil Date: Thu, 6 Aug 2026 12:06:15 -0700 Subject: [PATCH 4/7] Updated the query --- onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql index a6dc2db26..910b9a5e5 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql +++ b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql @@ -9,6 +9,9 @@ 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, @@ -30,5 +33,5 @@ SELECT category, 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 From 6fc853651b7e2938f44e3addf897df474fe618a7 Mon Sep 17 00:00:00 2001 From: kollil Date: Thu, 6 Aug 2026 13:25:38 -0700 Subject: [PATCH 5/7] Updated the query take #2 --- .../resources/queries/onprc_ehr/MedsEndDateAlert.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql index 910b9a5e5..253c922f6 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql +++ b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql @@ -15,11 +15,11 @@ */ SELECT Id, - date, + CAST(date AS DATE) AS date, enddate, - frequency, + frequency.meaning as frequency, treatmenttimes, - project, + project.displayname as project, code, volumewithunits, concentrationwithunits, @@ -28,8 +28,8 @@ SELECT performedby, remark, reason, - modifiedby, - modified, + modifiedby.displayname as modifiedby, + CAST(modified AS DATE) AS modified, category, taskid.rowid as TaskId FROM study.treatment_order From 41eff8f27bb6631d96954e7f75a9a145cdee31e2 Mon Sep 17 00:00:00 2001 From: kollil Date: Thu, 6 Aug 2026 16:33:25 -0700 Subject: [PATCH 6/7] Updated the alert and the query --- .../queries/onprc_ehr/MedsEndDateAlert.sql | 3 +- .../notification/AdminNotifications.java | 49 ++++++++++--------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql index 253c922f6..15aec9a95 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql +++ b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql @@ -31,7 +31,8 @@ SELECT 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', 'E-YYY85') +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/src/org/labkey/onprc_ehr/notification/AdminNotifications.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java index 3f470ebc1..534ac5cce 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java @@ -112,8 +112,8 @@ private void MedsEndDateAlert(Container c, User u, final StringBuilder msg, fina 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 @@ -135,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")) + "
"); From 8ceee457698c78bf6fe12eeaf1fde3317a65a160 Mon Sep 17 00:00:00 2001 From: kollil Date: Thu, 6 Aug 2026 16:36:12 -0700 Subject: [PATCH 7/7] Final fix --- onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql index 15aec9a95..83d52ee3d 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql +++ b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql @@ -34,5 +34,5 @@ SELECT 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') --, 'E-YYY85') +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