From 204f5eec586038ef8b6696af3c97d74506338357 Mon Sep 17 00:00:00 2001 From: kollil Date: Mon, 29 Dec 2025 17:58:08 -0800 Subject: [PATCH] Added clause to exclude dead animals in a query --- .../resources/queries/study/AssignmentsReleasedInPast1Day.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql b/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql index f476894d3..2c530c3ef 100644 --- a/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql +++ b/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql @@ -26,4 +26,5 @@ and this one: <= NOW() → not in the future Together, they produce exactly the last 24 hours, nothing more. */ WHERE CAST(enddate AS DATE) = TIMESTAMPADD('SQL_TSI_DAY', -1, CAST(NOW() AS DATE)) - AND CAST(enddate AS DATE) <= CAST(NOW() AS DATE) \ No newline at end of file + AND CAST(enddate AS DATE) <= CAST(NOW() AS DATE) + AND Id.demographics.calculated_status = 'Alive' \ No newline at end of file