Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions onprc_ehr/resources/etls/SLACensusInvestigator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Created By: Kollil, June 2026.
Create an ETL process to update SLA census, investigator data:
This ETL process is created to change the current process of transferring data into a db view (vw_SLAProjects) first and then into SLA census table.

A new stored procedure is created to update sla.census.investigatorId directly from ehr.project and onprc_ehr.investigators

Run this stored proc daily at 5am
-->
<etl xmlns="http://labkey.org/etl/xml">

<name>SLACensusInvestigator</name>

<description>Executes stored procedure to populate the SLA census investigator data</description>

<transforms>
<transform id="Stored_Proc" type="StoredProcedure">
<description>Runs the stored procedure to update sla.census.investigatorId directly from ehr.project and onprc_ehr.investigators datasets</description>
<procedure schemaName="onprc_ehr" procedureName="SLACensusInvestigatorUpdate"> </procedure>
</transform>
</transforms>

<schedule>
<!-- Runs daily at 4am -->
<cron expression="0 0 04 * * ?"/>
</schedule>

</etl>
32 changes: 32 additions & 0 deletions sla/resources/schemas/dbscripts/sqlserver/sla-26.001-26.002.sql
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion sla/src/org/labkey/sla/SLAModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public String getName()
@Override
public @Nullable Double getSchemaVersion()
{
return 23.003;
return 26.002;
}

@Override
Expand Down