Skip to content

Commit 9796db4

Browse files
Merge 25.7 to 25.11
2 parents 86230e4 + 33811ef commit 9796db4

13 files changed

+428
-21
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--Report title-->
2+
<query xmlns="http://labkey.org/data/xml/query">
3+
<metadata>
4+
<tables xmlns="http://labkey.org/data/xml">
5+
<table tableName="AssignmentsCreatedInPast1Day" tableDbType="TABLE">
6+
<tableTitle>Assignments created in the past 24 hrs</tableTitle>
7+
</table>
8+
</tables>
9+
</metadata>
10+
</query>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* Created by Kollil, Dec, 2025
2+
Tkt # 13618
3+
Priority 1: Add Grid 1 ("Assignments Created in the Past Day ") to daily Behavior Alerts email - display full grid in email
4+
*/
5+
SELECT
6+
Id,
7+
Id.demographics.gender as Sex,
8+
Id.curlocation.room as Room,
9+
Id.curlocation.cage as Cage,
10+
project.displayname as project,
11+
project.protocol.displayname as Protocol,
12+
project.title as Title,
13+
project.protocol.investigatorId.lastname as ProjectInvestigator,
14+
CAST(date AS DATE) AS AssignDate,
15+
CAST(enddate AS DATE) AS ReleaseDate,
16+
CAST(projectedRelease AS DATE) AS ProjectedReleaseDate,
17+
assignmentType,
18+
assignCondition.meaning as AssignCondition,
19+
projectedReleaseCondition.meaning as ProjectedReleaseCondition,
20+
releaseCondition.meaning as ConditionAtRelease
21+
22+
FROM Assignment
23+
WHERE CAST(created AS DATE) >= TIMESTAMPADD('SQL_TSI_DAY', -1, CAST(NOW() AS DATE))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--Report title-->
2+
<query xmlns="http://labkey.org/data/xml/query">
3+
<metadata>
4+
<tables xmlns="http://labkey.org/data/xml">
5+
<table tableName="AssignmentsReleasedInPast1Day" tableDbType="TABLE">
6+
<tableTitle>Assignments released in the past 24 hrs</tableTitle>
7+
</table>
8+
</tables>
9+
</metadata>
10+
</query>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* Created by Kollil, Dec, 2025
2+
Tkt # 13618
3+
Priority 2: Create new Grid 2 (Assignments ended in the Past 1 Day):
4+
- List of records with new “Release date” added within the last 24hrs (omitting day leases). I am not omitting day leases for now as per Isabel's request.
5+
*/
6+
SELECT
7+
Id,
8+
Id.demographics.gender as Sex,
9+
Id.curlocation.room as Room,
10+
Id.curlocation.cage as Cage,
11+
project.displayname as project,
12+
project.protocol.displayname as Protocol,
13+
project.title as Title,
14+
project.protocol.investigatorId.lastname as ProjectInvestigator,
15+
CAST(date AS DATE) AS AssignDate,
16+
CAST(enddate AS DATE) AS ReleaseDate,
17+
CAST(projectedRelease AS DATE) AS ProjectedReleaseDate,
18+
assignmentType,
19+
assignCondition.meaning as AssignCondition,
20+
projectedReleaseCondition.meaning as ProjectedReleaseCondition,
21+
releaseCondition.meaning as ConditionAtRelease
22+
23+
FROM Assignment
24+
/* this condition: >= TIMESTAMPADD('SQL_TSI_DAY', -1, NOW()) → not older than 24 hours
25+
and this one: <= NOW() → not in the future
26+
Together, they produce exactly the last 24 hours, nothing more.
27+
*/
28+
WHERE CAST(enddate AS DATE) = TIMESTAMPADD('SQL_TSI_DAY', -1, CAST(NOW() AS DATE))
29+
AND CAST(enddate AS DATE) <= CAST(NOW() AS DATE)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--Report title-->
2+
<query xmlns="http://labkey.org/data/xml/query">
3+
<metadata>
4+
<tables xmlns="http://labkey.org/data/xml">
5+
<table tableName="AssignmentsStartedPast1to7Days" tableDbType="TABLE">
6+
<tableTitle>Assignments started in the past 1-7 days</tableTitle>
7+
</table>
8+
</tables>
9+
</metadata>
10+
</query>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* Created by Kollil, Dec, 2025
2+
Tkt # 13618
3+
Priority 4: Add links to grids 3 and 4 in daily Behavior Alerts email (do not need to display full grid in email)
4+
- for grid 3 - There were __ assignments started in the past 1-7 days" with a link, including today's date
5+
6+
*/
7+
SELECT
8+
Id,
9+
Id.demographics.gender as Sex,
10+
Id.curlocation.room as Room,
11+
Id.curlocation.cage as Cage,
12+
project.displayname as project,
13+
project.protocol.displayname as Protocol,
14+
project.title as Title,
15+
project.protocol.investigatorId.lastname as ProjectInvestigator,
16+
CAST(date AS DATE) AS AssignDate,
17+
CAST(enddate AS DATE) AS ReleaseDate,
18+
CAST(projectedRelease AS DATE) AS ProjectedReleaseDate,
19+
assignmentType,
20+
assignCondition.meaning as AssignCondition,
21+
projectedReleaseCondition.meaning as ProjectedReleaseCondition,
22+
releaseCondition.meaning as ConditionAtRelease
23+
24+
FROM Assignment
25+
--including today
26+
WHERE CAST(date AS DATE) >= TIMESTAMPADD('SQL_TSI_DAY', -7, CAST(NOW() AS DATE))
27+
AND CAST(date AS DATE) <= CAST(NOW() AS DATE);
28+
--excluding today
29+
-- WHERE CAST(date AS DATE) >= TIMESTAMPADD('SQL_TSI_DAY', -1, NOW())
30+
-- AND CAST(date AS DATE) < TIMESTAMPADD('SQL_TSI_DAY', -7, NOW())
31+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--Report title-->
2+
<query xmlns="http://labkey.org/data/xml/query">
3+
<metadata>
4+
<tables xmlns="http://labkey.org/data/xml">
5+
<table tableName="AssignmentsStartingNext1to14Days" tableDbType="TABLE">
6+
<tableTitle>Assignments starting in the next 1 to 14 days</tableTitle>
7+
</table>
8+
</tables>
9+
</metadata>
10+
</query>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* Created by Kollil, Dec, 2025
2+
Tkt # 13618
3+
Priority 4: Add links to grids 3 and 4 in daily Behavior Alerts email (do not need to display full grid in email)
4+
- for grid 4 - There are __ assignments starting in the Next 1-14 days" with a link, including today's date
5+
*/
6+
7+
SELECT
8+
Id,
9+
Id.demographics.gender as Sex,
10+
Id.curlocation.room as Room,
11+
Id.curlocation.cage as Cage,
12+
project.displayname as project,
13+
project.protocol.displayname as Protocol,
14+
project.title as Title,
15+
project.protocol.investigatorId.lastname as ProjectInvestigator,
16+
CAST(date AS DATE) AS AssignDate,
17+
CAST(enddate AS DATE) AS ReleaseDate,
18+
CAST(projectedRelease AS DATE) AS ProjectedReleaseDate,
19+
assignmentType,
20+
assignCondition.meaning as AssignCondition,
21+
projectedReleaseCondition.meaning as ProjectedReleaseCondition,
22+
releaseCondition.meaning as ConditionAtRelease
23+
24+
FROM Assignment
25+
WHERE CAST(date AS DATE) >= TIMESTAMPADD('SQL_TSI_DAY', 1, CAST(NOW() AS DATE))
26+
AND CAST(date AS DATE) <= TIMESTAMPADD('SQL_TSI_DAY', 14, CAST(NOW() AS DATE))

onprc_ehr/resources/queries/study/flags.query.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<column columnName="Id"/>
1212
<column columnName="date">
1313
<columnTitle>Date Added</columnTitle>
14-
<formatString>Date</formatString>
14+
<formatString>DateTime</formatString>
1515
</column>
1616
<column columnName="enddate">
1717
<columnTitle>Date Removed</columnTitle>
1818
<isHidden>false</isHidden>
19-
<formatString>Date</formatString>
19+
<formatString>DateTime</formatString>
2020
</column>
2121
<column columnName="project">
2222
<isHidden>true</isHidden>

onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ exports.init = function(EHR){
483483
EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.INIT, 'study', 'flags', function(event, helper){
484484
helper.setScriptOptions({
485485
allowFutureDates: true,
486-
removeTimeFromDate: true,
487-
removeTimeFromEndDate: true
486+
removeTimeFromDate: false,
487+
removeTimeFromEndDate: false
488488
});
489489

490490
EHR.Server.TriggerManager.unregisterAllHandlersForQueryNameAndEvent('study', 'flags', EHR.Server.TriggerManager.Events.AFTER_INSERT);

0 commit comments

Comments
 (0)