-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release23.11-SNAPSHOT' into 23.11_fb_EnvironmentalInpur…
…tForm # Conflicts: # onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
- Loading branch information
Showing
47 changed files
with
1,423 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<etl xmlns="http://labkey.org/etl/xml"> | ||
<name>KinshipDataImport</name> | ||
<description>Import PRIMe-seq Kinship Data</description> | ||
<transforms> | ||
<transform id="kinship" type="TaskRefTransformStep"> | ||
<taskref ref="org.labkey.GeneticsCore.etl.ImportGeneticsCalculationsStep"> | ||
<settings> | ||
|
||
</settings> | ||
</taskref> | ||
</transform> | ||
</transforms> | ||
</etl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
GeneticsCore/src/org/labkey/GeneticsCore/etl/ImportGeneticsCalculationsStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
package org.labkey.GeneticsCore.etl; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.apache.xmlbeans.XmlException; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.labkey.GeneticsCore.GeneticsCoreModule; | ||
import org.labkey.api.data.Container; | ||
import org.labkey.api.data.ContainerManager; | ||
import org.labkey.api.di.TaskRefTask; | ||
import org.labkey.api.ehr.EHRService; | ||
import org.labkey.api.module.Module; | ||
import org.labkey.api.module.ModuleLoader; | ||
import org.labkey.api.module.ModuleProperty; | ||
import org.labkey.api.pipeline.PipelineJob; | ||
import org.labkey.api.pipeline.PipelineJobException; | ||
import org.labkey.api.pipeline.RecordedActionSet; | ||
import org.labkey.api.security.permissions.UpdatePermission; | ||
import org.labkey.api.view.UnauthorizedException; | ||
import org.labkey.api.writer.ContainerUser; | ||
|
||
import java.io.File; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ImportGeneticsCalculationsStep implements TaskRefTask | ||
{ | ||
protected ContainerUser _containerUser; | ||
|
||
@Override | ||
public RecordedActionSet run(@NotNull PipelineJob job) throws PipelineJobException | ||
{ | ||
Module ehr = ModuleLoader.getInstance().getModule("ehr"); | ||
Module geneticsCore = ModuleLoader.getInstance().getModule(GeneticsCoreModule.class); | ||
|
||
ModuleProperty mp = ehr.getModuleProperties().get("EHRStudyContainer"); | ||
String ehrContainerPath = StringUtils.trimToNull(mp.getEffectiveValue(_containerUser.getContainer())); | ||
if (ehrContainerPath == null) | ||
{ | ||
throw new PipelineJobException("EHRStudyContainer has not been set"); | ||
} | ||
|
||
Container ehrContainer = ContainerManager.getForPath(ehrContainerPath); | ||
if (ehrContainer == null) | ||
{ | ||
throw new PipelineJobException("Invalid container: " + ehrContainerPath); | ||
} | ||
|
||
if (!_containerUser.getContainer().equals(ehrContainer)) | ||
{ | ||
throw new PipelineJobException("This ETL can only be run from the EHRStudyContainer"); | ||
} | ||
|
||
// Downstream import events will get additional permissions checks | ||
if (!ehrContainer.hasPermission(_containerUser.getUser(), UpdatePermission.class)) | ||
{ | ||
throw new UnauthorizedException(); | ||
} | ||
|
||
ModuleProperty mp2 = geneticsCore.getModuleProperties().get("KinshipDataPath"); | ||
String pipeDirPath = StringUtils.trimToNull(mp2.getEffectiveValue(ehrContainer)); | ||
if (pipeDirPath == null) | ||
{ | ||
throw new PipelineJobException("Must provide the filepath to import data using the KinshipDataPath module property"); | ||
} | ||
|
||
File pipeDir = new File(pipeDirPath); | ||
if (!pipeDir.exists()) | ||
{ | ||
throw new PipelineJobException("Path does not exist: " + pipeDir.getPath()); | ||
} | ||
|
||
File kinship = new File(pipeDir, "kinship.txt"); | ||
if (!kinship.exists()) | ||
{ | ||
throw new PipelineJobException("File does not exist: " + kinship.getPath()); | ||
} | ||
|
||
File inbreeding = new File(pipeDir, "inbreeding.txt"); | ||
if (!inbreeding.exists()) | ||
{ | ||
throw new PipelineJobException("File does not exist: " + inbreeding.getPath()); | ||
} | ||
|
||
EHRService.get().standaloneProcessKinshipAndInbreeding(ehrContainer, _containerUser.getUser(), pipeDir, job.getLogger()); | ||
|
||
return new RecordedActionSet(); | ||
} | ||
|
||
@Override | ||
public List<String> getRequiredSettings() | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public void setSettings(Map<String, String> settings) throws XmlException | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public void setContainerUser(ContainerUser containerUser) | ||
{ | ||
_containerUser = containerUser; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
ONPRC_EHR_ComplianceDB/resources/queries/onprc_ehr_compliancedb/SciShield_Data.query.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<query xmlns="http://labkey.org/data/xml/query"> | ||
<metadata> | ||
<tables xmlns="http://labkey.org/data/xml"> | ||
<table tableName="SciShield_Data" tableDbType="TABLE"> | ||
<tableTitle>SciShield Data</tableTitle> | ||
<columns> | ||
</columns> | ||
</table> | ||
</tables> | ||
</metadata> | ||
</query> |
20 changes: 20 additions & 0 deletions
20
ONPRC_EHR_ComplianceDB/resources/queries/onprc_ehr_compliancedb/SciShield_Data/.qview.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<customView xmlns="http://labkey.org/data/xml/queryCustomView"> | ||
<columns> | ||
<column name="employeeid"/> | ||
|
||
<column name="requirementname"/> | ||
<column name="date"/> | ||
<column name="processed"/> | ||
<column name="comment"/> | ||
|
||
</columns> | ||
<sorts> | ||
<sort column="employeeid" descending="false"/> | ||
<sort column="requirementname" descending="false"/> | ||
<sort column="date" descending="true"/> | ||
<sort column="created" descending="true"/> | ||
</sorts> | ||
<filters> | ||
<filter column="processed" operator="isblank"/> | ||
</filters> | ||
</customView> |
34 changes: 34 additions & 0 deletions
34
..._ComplianceDB/resources/queries/onprc_ehr_compliancedb/SciShield_Reference_Data.query.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<query xmlns="http://labkey.org/data/xml/query"> | ||
<metadata> | ||
<tables xmlns="http://labkey.org/data/xml"> | ||
<table tableName="SciShield_Reference_Data" tableDbType="NOT_IN_DB"> | ||
<tableTitle>SciShield Reference Data</tableTitle> | ||
|
||
<columns> | ||
<column columnName ="rowId"> | ||
<isHidden>true</isHidden> | ||
</column> | ||
<column columnName="value"> | ||
<columnTitle>Value</columnTitle> | ||
</column> | ||
<column columnName="endDate"> | ||
<columnTitle>End Date</columnTitle> | ||
</column> | ||
|
||
<column columnName="columnName"> | ||
<columnTitle>Column Name</columnTitle> | ||
</column> | ||
|
||
<column columnName="Label"> | ||
<columnTitle>Label</columnTitle> | ||
</column> | ||
|
||
<column columnName="sort_order"> | ||
<columnTitle>Sort Order</columnTitle> | ||
</column> | ||
</columns> | ||
</table> | ||
</tables> | ||
</metadata> | ||
</query> | ||
|
43 changes: 43 additions & 0 deletions
43
...omplianceDB/resources/schemas/dbscripts/sqlserver/onprc_ehr_compliancedb-0.000-24.000.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
CREATE SCHEMA onprc_ehr_compliancedb; | ||
GO | ||
|
||
CREATE TABLE onprc_ehr_compliancedb.SciShield_Data | ||
( | ||
RowId INT IDENTITY(1,1) NOT NULL, | ||
employeeId nvarchar(255) not null, | ||
requirementname nvarchar(255) null, | ||
Date datetime null, | ||
Container ENTITYID NOT NULL, | ||
comment nvarchar(2000) null, | ||
CreatedBy USERID, | ||
Created datetime, | ||
ModifiedBy USERID, | ||
Modified datetime, | ||
processed int NULL | ||
|
||
CONSTRAINT PK_ScieShield_Data PRIMARY KEY (RowId), | ||
CONSTRAINT FK_ONPRC_EHR_COMPLIANCE_SCISHIELD_DATA_CONTAINER FOREIGN KEY (Container) REFERENCES core.Containers (EntityId) | ||
); | ||
CREATE INDEX IX_ONPRC_EHR_COMPLIANCEDB_SCISHIELD_DATA_CONTAINER ON onprc_ehr_compliancedb.SciShield_Data (Container); | ||
|
||
CREATE TABLE onprc_ehr_compliancedb.SciShield_Reference_Data | ||
( | ||
rowId int identity(1,1), | ||
label nvarchar(250) NULL, | ||
value nvarchar(255) NOT NULL , | ||
columnName nvarchar(255) NOT NULL, | ||
sort_order integer null, | ||
endDate datetime NULL, | ||
Container ENTITYID NOT NULL, | ||
CreatedBy USERID, | ||
Created datetime, | ||
ModifiedBy USERID, | ||
Modified datetime, | ||
|
||
CONSTRAINT pk_SciShield_reference PRIMARY KEY (value), | ||
CONSTRAINT FK_ONPRC_EHR_COMPLIANCE_REFERENCE_DATA_CONTAINER FOREIGN KEY (Container) REFERENCES core.Containers (EntityId) | ||
); | ||
CREATE INDEX IX_ONPRC_EHR_COMPLIANCEDB_SCISHIELD_REFERENCE_DATA_CONTAINER ON onprc_ehr_compliancedb.SciShield_Reference_Data (Container); | ||
|
||
GO |
Oops, something went wrong.