diff --git a/onprc_ehr/resources/etls/SLACensusInvestigator.xml b/onprc_ehr/resources/etls/SLACensusInvestigator.xml new file mode 100644 index 000000000..5d2d368c8 --- /dev/null +++ b/onprc_ehr/resources/etls/SLACensusInvestigator.xml @@ -0,0 +1,28 @@ + + + + + SLACensusInvestigator + + Executes stored procedure to populate the SLA census investigator data + + + + Runs the stored procedure to update sla.census.investigatorId directly from ehr.project and onprc_ehr.investigators datasets + + + + + + + + + + \ No newline at end of file diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-26.001-26.002.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-26.001-26.002.sql new file mode 100644 index 000000000..6a4885560 --- /dev/null +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-26.001-26.002.sql @@ -0,0 +1,32 @@ + +/****** Object: StoredProcedure sla.SLACensusInvestigatorUpdate Script Date: June, 2026 *****/ +-- ========================================================================================== +-- Author: Lakshmi Kolli +-- Create date: June 2026 +-- A new stored procedure is created to update sla.census.investigatorId directly from ehr.project +-- and onprc_ehr.investigators +-- ========================================================================================== + +--Drop Stored proc if exists +EXEC core.fn_dropifexists 'SLACensusInvestigatorUpdate', 'onprc_ehr', 'PROCEDURE'; +GO + +--Create stored procedure to update the investigators data in sla.census table. +CREATE PROCEDURE [onprc_ehr].[SLACensusInvestigatorUpdate] +AS + +BEGIN + + UPDATE c + SET c.investigatorId = i.objectid + FROM sla.census c + INNER JOIN ehr.project p + ON p.project = c.project + INNER JOIN onprc_ehr.investigators i + ON i.rowId = p.investigatorId + WHERE c.date >= '2016/09/01' + AND c.investigatorId IS NULL + AND i.objectid IS NOT NULL + +END +Go \ No newline at end of file diff --git a/sla/src/org/labkey/sla/SLAModule.java b/sla/src/org/labkey/sla/SLAModule.java index 51f654a8e..aea865bce 100644 --- a/sla/src/org/labkey/sla/SLAModule.java +++ b/sla/src/org/labkey/sla/SLAModule.java @@ -57,7 +57,7 @@ public String getName() @Override public @Nullable Double getSchemaVersion() { - return 23.003; + return 26.002; } @Override