From 40e60a31022ba6f0cea3066bfbbad342c70acae1 Mon Sep 17 00:00:00 2001 From: NIRC-IT <87669815+NIRC-IT@users.noreply.github.com> Date: Tue, 21 Jul 2026 17:15:41 -0500 Subject: [PATCH] Updated source query to pull current location instead of all locations. --- nirc_ehr/resources/queries/study/orchardData.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nirc_ehr/resources/queries/study/orchardData.sql b/nirc_ehr/resources/queries/study/orchardData.sql index 7597aa15..74b40b5d 100644 --- a/nirc_ehr/resources/queries/study/orchardData.sql +++ b/nirc_ehr/resources/queries/study/orchardData.sql @@ -11,8 +11,8 @@ SELECT pa.protocol.title as protocol, InitCap(pa.protocol.InvestigatorId.LastName) || ', ' || InitCap(pa.protocol.InvestigatorId.FirstName) as PI, InitCap(pa.protocol.AuthorId.LastName) || ', ' || InitCap(pa.protocol.AuthorId.FirstName) as Vet, - h.cage.cage as cage, + dlh.cage.cage as cage, d.calculated_status as alive FROM demographics d -LEFT JOIN housing h ON d.Id = h.Id +LEFT JOIN demographicsLastHousing dlh ON d.Id = dlh.Id LEFT JOIN protocolAssignment pa ON d.Id = pa.Id AND pa.endDate is null \ No newline at end of file