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..bb8ba8943 100644 --- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js +++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js @@ -1103,10 +1103,15 @@ 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'); + //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'); } } }); 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..6996cf687 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AdminNotifications.java @@ -119,17 +119,17 @@ 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) { //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("
"); 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