From 55e114dfe1046fbadf803031bf6ba4a9294de840 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 14 May 2025 11:41:44 -0700 Subject: [PATCH 01/10] New diet to bypass the enddate is added to the meds order list --- onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql | 5 ++++- onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js | 5 ++++- .../labkey/onprc_ehr/notification/AdminNotifications.java | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql index 196f647b5..a6dc2db26 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql +++ b/onprc_ehr/resources/queries/onprc_ehr/MedsEndDateAlert.sql @@ -6,6 +6,9 @@ Added these two Diets to the list by Kollil on 4/15/25. Refer to tkt #12363 3. E-X0500 - Diet, L-Phyto (Low-phytoestrogen) 4. E-Y9750 - Diet, 5047 High Protein, Jumbo + + Added Diet to the list by Kollil on 5/14/25. Refer to tkt #12506 +5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) */ SELECT Id, @@ -27,5 +30,5 @@ SELECT category, taskid.rowid as TaskId FROM study.treatment_order -WHERE code NOT IN ('E-85760', 'E-Y7735', 'E-X0500', 'E-Y9750') +WHERE code NOT IN ('E-85760', 'E-Y7735', 'E-X0500', 'E-Y9750', 'E-X1380') 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 d785a81d6..01e6a49f3 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1103,8 +1103,11 @@ exports.init = function(EHR){ 3. E-X0500 - Diet, L-Phyto (Low-phytoestrogen) 4. E-Y9750 - Diet, 5047 High Protein, Jumbo + Added Diet to the list by Kollil on 5/14/25. Refer to tkt #12506 + 5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) + */ - if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && row.code != 'E-Y9750'){ + if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && row.code != 'E-Y9750' && row.code != 'E-X1380'){ if (!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 c7e82ce31..4a93517fc 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java @@ -119,12 +119,12 @@ private void MedsEndDateAlert(Container c, User u, final StringBuilder msg, fina TableSelector ts = new TableSelector(ti, null, new Sort("date")); long count = ts.getRowCount(); if (count == 0) { - //msg.append("There are no meds ordered except E-85760 (Medroxyprogesterone injectable 150mg/ml) and E-Y7735 (Diet - Weekly Multivitamin) with missing end dates!
"); - msg.append("No medication orders found with missing end date except the following approved list:" + + msg.append("No medication orders found with missing end date except the following approved list:" + "
1. E-85760 (Medroxyprogesterone injectable 150mg/ml) " + "
2. E-Y7735 (Diet - Weekly Multivitamin)" + "
3. E-X0500 (Diet, L-Phyto (Low-phytoestrogen)) " + - "
4. E-Y9750 (Diet, 5047 High Protein, Jumbo)

"); + "
4. E-Y9750 (Diet, 5047 High Protein, Jumbo) " + + "
5. E-X1380 (Diet Daily (Non-standard), 5LOP (TAD))
"); } else if (count > 0) { From 9bed473ccffd4512a1da2781881540139b99d6a0 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 27 May 2025 14:03:57 -0700 Subject: [PATCH 02/10] Updated the headers --- .../org/labkey/onprc_ehr/notification/AdminNotifications.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4a93517fc..6996cf687 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java @@ -129,7 +129,7 @@ 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("
Meds with missing end date:

"); + msg.append("
Medication orders with missing end date:

"); msg.append("" + count + " meds found with missing end dates:"); msg.append("

Click here to view the meds/diets

\n"); msg.append("
"); From 8dab23e242541a9af749f98bbc7850165c0e4693 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 27 May 2025 14:54:20 -0700 Subject: [PATCH 03/10] Changed WARN to ERROR for enddate exception validation. --- onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js | 4 +++- 1 file changed, 3 insertions(+), 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 01e6a49f3..bb8ba8943 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1109,7 +1109,9 @@ exports.init = function(EHR){ */ if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && row.code != 'E-Y9750' && row.code != 'E-X1380'){ if (!row.enddate) { - EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); + //Changed by Kollil on 5/28/25 - Changed the 'WARN' to 'ERROR' to tighten the end date validation. + //This will prevent the user to submit the med/diet data without passing the validation. The "Force Submit" button WILL NOT WORK with this setting. + EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'ERROR'); } } }); From 15c699cf2f4937f87b5072a454a27746e4ff070c Mon Sep 17 00:00:00 2001 From: kollil Date: Thu, 29 May 2025 19:23:31 -0700 Subject: [PATCH 04/10] Added enddate field to the test case. --- .../src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java index 5dcbd3b73..ab4bacd91 100644 --- a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java +++ b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java @@ -1020,6 +1020,9 @@ public void testExamEntry() throws Exception Assert.assertEquals("mg/tablet", ordersGrid.getFieldValue(3, "conc_units")); Assert.assertEquals(3L, ordersGrid.getFieldValue(3, "dosage")); Assert.assertEquals("mg/kg", ordersGrid.getFieldValue(3, "dosage_units")); + //Added enddate by kollil + Date date_tr = DateUtils.truncate(new Date(), Calendar.DATE); + Assert.assertEquals(date_tr, ordersGrid.getDateFieldValue(3, "enddate")); //note: amount calculation testing handled in surgery test From 4ed7ef863c5d9f7475ba24c5c37204fb78d6afc0 Mon Sep 17 00:00:00 2001 From: Lakshmi Kolli <69940873+kollil@users.noreply.github.com> Date: Tue, 2 Dec 2025 17:12:27 -0800 Subject: [PATCH 05/10] Update onprc_triggers.js --- 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 b2e5b7a60..f25a591d3 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1070,7 +1070,7 @@ exports.init = function(EHR){ if (!row.enddate) { //Changed by Kollil on 5/28/25 - Changed the 'WARN' to 'ERROR' to tighten the end date validation. //This will prevent the user to submit the med/diet data without passing the validation. The "Force Submit" button WILL NOT WORK with this setting. - EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'ERROR'); + EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); } } From 8004e5e40a53edb1103d62fd80c8a82106c9eae3 Mon Sep 17 00:00:00 2001 From: Lakshmi Kolli <69940873+kollil@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:08:07 -0800 Subject: [PATCH 06/10] Update onprc_triggers.js --- .../scripts/onprc_ehr/onprc_triggers.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js index f25a591d3..b50b04e42 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1053,7 +1053,7 @@ exports.init = function(EHR){ } //Added by Kollil, 8/1/24 - /* User can bypass the enddate for these two medications, as per ticket #11016 + /* User can bypass the enddate for the following meddications, as per ticket #11016 Validation code on the Prime side to bypass the following two medications without entering the end dates. 1. E-85760 - Medroxyprogesterone injectable (150mg/ml) 2. E-Y7735 - Diet - Weekly Multivitamin @@ -1066,12 +1066,15 @@ exports.init = function(EHR){ 5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) */ - if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && row.code != 'E-Y9750' && row.code != 'E-X1380'){ - if (!row.enddate) { - //Changed by Kollil on 5/28/25 - Changed the 'WARN' to 'ERROR' to tighten the end date validation. - //This will prevent the user to submit the med/diet data without passing the validation. The "Force Submit" button WILL NOT WORK with this setting. - EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); - } + // if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && row.code != 'E-Y9750' && row.code != 'E-X1380'){ + // if (!row.enddate) { + // EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); + // } + // } + var exemptMeds = ['E-85760', 'E-Y7735', 'E-X0500', 'E-Y9750', 'E-X1380']; + + if (!exemptMeds.includes(row.code) && !row.enddate) { + EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); } //Added by Kollil, 9/15/25 From 5c474c295c2a44c33ef198bc9ed0bef5852e5134 Mon Sep 17 00:00:00 2001 From: Lakshmi Kolli <69940873+kollil@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:10:46 -0800 Subject: [PATCH 07/10] Update ONPRC_EHRTest.java --- .../src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java index 9d835792f..bdf812dd0 100644 --- a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java +++ b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java @@ -1071,12 +1071,8 @@ public void testExamEntry() throws Exception Assert.assertEquals("mg/tablet", ordersGrid.getFieldValue(3, "conc_units")); Assert.assertEquals(3L, ordersGrid.getFieldValue(3, "dosage")); Assert.assertEquals("mg/kg", ordersGrid.getFieldValue(3, "dosage_units")); - //Added enddate by kollil - Date date_tr = DateUtils.truncate(new Date(), Calendar.DATE); - Assert.assertEquals(date_tr, ordersGrid.getDateFieldValue(3, "enddate")); //note: amount calculation testing handled in surgery test - //blood draws waitAndClick(Ext4Helper.Locators.ext4Tab("Blood Draws")); Ext4GridRef bloodGrid = _helper.getExt4GridForFormSection("Blood Draws"); From a93e0ac0437a5ba73ff7309f3e0f5dbc5d8b56ee Mon Sep 17 00:00:00 2001 From: Lakshmi Kolli <69940873+kollil@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:17:27 -0800 Subject: [PATCH 08/10] Update AdminNotifications.java --- .../labkey/onprc_ehr/notification/AdminNotifications.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 b492593af..d9fc7fd8e 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java @@ -101,7 +101,7 @@ private void MedsEndDateAlert(Container c, User u, final StringBuilder msg, fina TableSelector ts = new TableSelector(ti, null, new Sort("date")); long count = ts.getRowCount(); if (count == 0) { - msg.append("No medication orders found with missing end date except the following approved list:" + + msg.append("No treatment orders found with missing end date except the following approved list:" + "
1. E-85760 (Medroxyprogesterone injectable 150mg/ml) " + "
2. E-Y7735 (Diet - Weekly Multivitamin)" + "
3. E-X0500 (Diet, L-Phyto (Low-phytoestrogen)) " + @@ -111,9 +111,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("
Medication orders with missing end date:

"); - msg.append("" + count + " meds found with missing end dates:"); - msg.append("

Click here to view the meds/diets

\n"); + msg.append("
" + count + " treatment order(s) found with missing end dates

"); + msg.append("

Click here to view the treatments

\n"); msg.append("
"); //Display the report in the email From 3bab69a6ddab2306fa842166594b88ed095b0a47 Mon Sep 17 00:00:00 2001 From: Lakshmi Kolli <69940873+kollil@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:18:42 -0800 Subject: [PATCH 09/10] Update onprc_triggers.js --- onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js index b50b04e42..4dd91c4d3 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1066,11 +1066,6 @@ exports.init = function(EHR){ 5. E-X1380 - Diet Daily (Non-standard), 5LOP (TAD) */ - // if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && row.code != 'E-Y9750' && row.code != 'E-X1380'){ - // if (!row.enddate) { - // EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); - // } - // } var exemptMeds = ['E-85760', 'E-Y7735', 'E-X0500', 'E-Y9750', 'E-X1380']; if (!exemptMeds.includes(row.code) && !row.enddate) { From ce97f7db8add6c51206d193898e2325aa40a0f37 Mon Sep 17 00:00:00 2001 From: Lakshmi Kolli <69940873+kollil@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:40:29 -0800 Subject: [PATCH 10/10] Update onprc_triggers.js --- onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js index 4dd91c4d3..6a96e4701 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1064,11 +1064,9 @@ 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) - */ - var exemptMeds = ['E-85760', 'E-Y7735', 'E-X0500', 'E-Y9750', 'E-X1380']; - - if (!exemptMeds.includes(row.code) && !row.enddate) { + if (row.code != 'E-85760' && row.code != 'E-Y7735' && row.code != 'E-X0500' && + row.code != 'E-Y9750' && row.code != 'E-X1380' && !row.enddate) { EHR.Server.Utils.addError(scriptErrors, 'enddate', 'Must enter enddate', 'WARN'); }