diff --git a/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Daily.sql b/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Daily.sql index 0ae451d2f..d538ef1e6 100644 --- a/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Daily.sql +++ b/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Daily.sql @@ -19,5 +19,5 @@ SELECT e.modified FROM Events e, PMIC_getFolderInfo r Where r.id = e.resourceid - --And e.container = '783D2EA5-C6AC-1036-A33C-BD25D0574070' - And CAST(e.startDate AS DATE) = curdate() --Show only PMIC events \ No newline at end of file + And CAST(e.startDate AS DATE) = curdate() --Show only PMIC events + Order by e.startDate \ No newline at end of file diff --git a/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Weekly.sql b/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Weekly.sql index 117b1bb9c..5674ea490 100644 --- a/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Weekly.sql +++ b/extscheduler/resources/queries/extscheduler/PMIC_Scheduler_Weekly.sql @@ -1,6 +1,8 @@ /* Created by: Kolli on 11/14/2019 Weekly report: This query filters all the PMIC events from today to the next 7 days +Change by Kolli, 5/5/21: This query filters all the PMIC events from next day to the next 7 days. +The Daily events will cover the current day events, no need to duplicate same day events again in the weekly report. */ SELECT r.resourceid, @@ -19,5 +21,9 @@ SELECT e.modified FROM Events e, PMIC_getFolderInfo r Where r.id = e.resourceid - --And e.container = '783D2EA5-C6AC-1036-A33C-BD25D0574070' -- PMIC container - And CAST(e.startDate AS DATE) BETWEEN curdate() and TIMESTAMPADD('SQL_TSI_DAY', 7, curdate()) +--And CAST(e.startDate AS DATE) BETWEEN curdate() and TIMESTAMPADD('SQL_TSI_DAY', 7, curdate()) +And CAST(e.startDate AS DATE) BETWEEN TIMESTAMPADD('SQL_TSI_DAY', 1, curdate()) and TIMESTAMPADD('SQL_TSI_DAY', 7, curdate()) +Order by e.startdate + + + diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java index 1e9f12afa..0afd3f547 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java @@ -1150,7 +1150,7 @@ protected void pmicSchedulerAlert(final Container c, User u, final StringBuilder final Map colMap = QueryService.get().getColumns(ti, columns); TableSelector ts2 = new TableSelector(ti, colMap.values(), null, null); - msg.append("
Daily PMIC events:

\n"); + msg.append("
Today's PMIC events:

\n"); msg.append(""); msg.append(""); msg.append("");
Resource Id Start Date End Date Name Alias Quantity Comments Color Room Bldg