Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scott's final export changes #460

Draft
wants to merge 1 commit into
base: release22.3-SNAPSHOT
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion snprc_ehr/resources/etls/exportLookupSets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<description>Push Lookup Sets Data to CAMP</description>
<transforms>
<transform id="step1" type="org.labkey.di.pipeline.TransformTask">
<description>Copy to target</description>
<description>Copy SND to CAMP</description>
<source schemaName="snprc_ehr" queryName="ExportLookupSets" />
<destination schemaName="tacSrc" queryName="LookupSets" bulkLoad="true" targetOption="merge">
<alternateKeys>
Expand Down
12 changes: 10 additions & 2 deletions snprc_ehr/resources/queries/snprc_ehr/ExportLookupSets.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
/************************************
Source for TAC/SND etl back to camp
ETL: exportLookupSets.xml
srr 03.04.2021
Added DisplayName to C/M by
Columns Label and Description are null
srr 08.20.2021
************************************/
SELECT ls.LookupSetId,
ls.SetName,
ls.Label,
ls.Description,
ls.Container,
ls.CreatedBy,
ls.CreatedBy.DisplayName as CreatedByText,
ls.Created,
ls.ModifiedBy,
ls.ModifiedByDisplayName as ModifiedByText,
ls.Modified,
ls.Lsid,
ls.ObjectId
Expand Down
12 changes: 10 additions & 2 deletions snprc_ehr/resources/queries/snprc_ehr/ExportLookups.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
/************************
NULL columns exported to CAMP
SortOrder
Lsid
Added DisplayName to CreatedBy and ModifiedBy
srr 08.19.2021
************************/

SELECT l.LookupSetId,
l.Value,
l.Displayable,
l.SortOrder,
l.Container,
l.CreatedBy,
l.CreatedBy.DisplayName as CreatedByText,
l.Created,
l.ModifiedBy,
l.ModifiedBy.DisplayName as ModifiedByText,
l.Modified,
l.Lsid,
l.LookupId,
Expand Down
4 changes: 2 additions & 2 deletions snprc_ehr/resources/queries/snprc_ehr/ExportPkgCategories.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ SELECT pc.CategoryId,
pc.Active,
pc.SortOrder,
pc.Container,
pc.CreatedBy,
pc.CreatedBy.DisplayName as CreatedByText,
pc.Created,
pc.ModifiedBy,
pc.ModifiedBy.DisplayName as ModifiedByText,
pc.Modified,
pc.Lsid,
pc.Objectid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
/********************************************************
Query will feed the export ETL back to CAMP.

03.04.21 srr

Changed CreatedBy and ModifiedBy to user DisplayName
Added Text to column names
.CreatedBy.DisplayName as CreatedByText,
.ModifiedBy.DisplayName as ModifiedByText,
08.19.21 srr
********************************************************/

SELECT pcj.PkgId,
pcj.CategoryId,
pcj.Container,
pcj.CreatedBy,
pcj.CreatedBy.DisplayName as CreatedByText,
pcj.Created,
pcj.ModifiedBy,
pcj.ModifiedBy.DisplayName as ModifiedByText,
pcj.Modified,
pcj.Lsid,
pcj.Objectid
Expand Down
19 changes: 15 additions & 4 deletions snprc_ehr/resources/source_queries/create_CAMP_LookupSets.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,38 @@ I think this will go to CAMP pkgAttrib lookups
02.24.2021
srr
***********************************************************/
/******************************
WORKING NOTE:
Note as of 08.19.2021
Label, Description and Lsid are all null
on vogon
srr
Changed user data from INT to nvarchar(128) and appended "Text" to column name
08.23.2021 srr

******************************/

/* DEV Note: Table exists on vogon */

-- new schema
DROP TABLE IF EXISTS TAC_src.LookupSets;


CREATE TABLE [TAC_src].[LookupSets](
[LookupSetId] [int] IDENTITY(1,1) NOT NULL,
[SetName] [nvarchar](128) NOT NULL,
[Label] [nvarchar](128) NULL,
[Description] [nvarchar](900) NULL,
[Container] [uniqueidentifier] NOT NULL,
[CreatedBy] [int] NULL,
[CreatedByText] [nvarchar](128) NULL,
[Created] [datetime] NULL,
[ModifiedBy] [int] NULL,
[ModifiedByText] [nvarchar](128) NULL,
[Modified] [datetime] NULL,
[Lsid] [nvarchar](300) NULL,
[ObjectId] [uniqueidentifier] NOT NULL
CONSTRAINT PK_TAC_LookupSetId
PRIMARY KEY CLUSTERED (LookupSetId ASC)
)


-- Table permits
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE ON TAC_src.LookupSets TO z_labkey;
GRANT VIEW DEFINITION ON TAC_src.LookupSets TO z_labkey;
Expand Down
10 changes: 6 additions & 4 deletions snprc_ehr/resources/source_queries/create_CAMP_Lookups.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/**********************************************************

Will go to CAMP lookup_table
02.24.2021
srr
02.24.2021 srr

Changed user data from INT to nvarchar(128) and appended "Text" to column name
08.23.2021 srr
***********************************************************/

-- new schema
Expand All @@ -15,9 +17,9 @@ CREATE TABLE [TAC_src].[Lookups](
[Displayable] [bit] NOT NULL,
[SortOrder] [int] NULL,
[Container] [uniqueidentifier] NOT NULL,
[CreatedBy] [int] NULL,
[CreatedByText] [nvarchar](128) NULL,
[Created] [datetime] NULL,
[ModifiedBy] [int] NULL,
[ModifiedByText] [nvarchar](128) NULL,
[Modified] [datetime] NULL,
[Lsid] [nvarchar](300) NULL,
[LookupId] [int] IDENTITY(1,1) NOT NULL,
Expand Down
10 changes: 8 additions & 2 deletions snprc_ehr/resources/source_queries/create_CAMP_PkgCategories.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/********************************************************************************

Changed user data from INT to nvarchar(128) and appended "Text" to column name
08.23.2021 srr

*********************************************************************************/


-- NOTE SQL Server 2016 and after
Expand All @@ -11,10 +17,10 @@ CREATE TABLE [TAC_src].[PkgCategories](
[Active] [bit] NOT NULL,
[SortOrder] [int] NULL,
[Container] [uniqueidentifier] NOT NULL,
[CreatedBy] [int] NULL,
[CreatedByText] [nvarchar](128) NULL,
[Created] [datetime] NULL,
[ModifiedBy] [int] NULL,
[Modified] [datetime] NULL,
[ModifiedText] [nvarchar](128) NULL,
[Lsid] [nvarchar](300) NULL,
[Objectid] [uniqueidentifier] NOT NULL
CONSTRAINT PK_TAC_PkgCategories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
TBD
02.24.2021
srr
Changed user data from INT to nvarchar(128) and appended "Text" to column name
08.23.2021 srr

***********************************************************/
-- NOTE SQL Server 2016 and after
DROP TABLE IF EXISTS TAC_src.PkgCategoryJunction;
Expand All @@ -14,9 +17,9 @@ CREATE TABLE [TAC_src].[PkgCategoryJunction](
[PkgId] [int] NOT NULL,
[CategoryId] [int] NOT NULL,
[Container] [uniqueidentifier] NOT NULL,
[CreatedBy] [int] NULL,
[CreatedByText] [nvarchar](128) NULL,
[Created] [datetime] NULL,
[ModifiedBy] [int] NULL,
[ModifiedByText] [nvarchar](128) NULL,
[Modified] [datetime] NULL,
[Lsid] [nvarchar](300) NULL,
[Objectid] [uniqueidentifier] NOT NULL
Expand Down