diff --git a/snprc_ehr/resources/etls/ExportSndLookupSets.xml b/snprc_ehr/resources/etls/ExportSndLookupSets.xml new file mode 100644 index 000000000..df7536f45 --- /dev/null +++ b/snprc_ehr/resources/etls/ExportSndLookupSets.xml @@ -0,0 +1,22 @@ + + + Export SND LookupSets to Animal PKG_ATTRIB_LOOKUPS + Transform Lookup Sets for SND module to Animal PKG_ATTRIB_LOOKUPS data + + + Merge to target + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/snprc_ehr/resources/etls/ExportSndLookups.xml b/snprc_ehr/resources/etls/ExportSndLookups.xml new file mode 100644 index 000000000..2400c1bf4 --- /dev/null +++ b/snprc_ehr/resources/etls/ExportSndLookups.xml @@ -0,0 +1,22 @@ + + + Export SND Lookups to Animal LOOKUP_TABLE + Transform Lookup items for SND module to Animal LOOKUP_TABLE data + + + Merge to target + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/snprc_ehr/resources/etls/exportLookupSets.xml b/snprc_ehr/resources/etls/exportLookupSets.xml deleted file mode 100644 index 4d499ae13..000000000 --- a/snprc_ehr/resources/etls/exportLookupSets.xml +++ /dev/null @@ -1,24 +0,0 @@ - - ExportLookupSets - Push Lookup Sets Data to CAMP - - - Copy to target - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snprc_ehr/resources/etls/exportLookups.xml b/snprc_ehr/resources/etls/exportLookups.xml deleted file mode 100644 index f346e6372..000000000 --- a/snprc_ehr/resources/etls/exportLookups.xml +++ /dev/null @@ -1,24 +0,0 @@ - - ExportLookups - Push Lookup Data to CAMP - - - Copy to target - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snprc_ehr/resources/queries/snprc_ehr/ExportSndLookupSets.sql b/snprc_ehr/resources/queries/snprc_ehr/ExportSndLookupSets.sql new file mode 100644 index 000000000..0e545f3c7 --- /dev/null +++ b/snprc_ehr/resources/queries/snprc_ehr/ExportSndLookupSets.sql @@ -0,0 +1,14 @@ +SELECT + SetName as LOOKUP_KEY, + ObjectId as OBJECT_ID, + LEFT(s.Email, + CASE WHEN charindex('@', s.Email) = 0 + THEN LEN(s.Email) + ELSE (charindex('@', s.Email) - 1) END) as USER_NAME, + ls.Modified as ENTRY_DATE_TM +FROM + snd.LookupSets ls + INNER JOIN + core.SiteUsers s +ON + ls.ModifiedBy = s.UserId \ No newline at end of file diff --git a/snprc_ehr/resources/queries/snprc_ehr/ExportSndLookups.sql b/snprc_ehr/resources/queries/snprc_ehr/ExportSndLookups.sql new file mode 100644 index 000000000..384cd38f2 --- /dev/null +++ b/snprc_ehr/resources/queries/snprc_ehr/ExportSndLookups.sql @@ -0,0 +1,24 @@ +SELECT + LookupId as LOOKUP_ID, + ls.SetName as LOOKUP_KEY, + Value as VALUE, + CASE + WHEN l.Displayable = 0 THEN 'Y' ELSE 'N' END as IS_HIDDEN, + l.SortOrder as ORDER_NUM, + l.ObjectId as OBJECT_ID, + 'N' as DEFAULT_FLAG, + LEFT(s.Email, + CASE WHEN charindex('@', s.Email) = 0 + THEN LEN(s.Email) + ELSE (charindex('@', s.Email) - 1) END) as USER_NAME, + l.Modified as ENTRY_DATE_TM +FROM + snd.Lookups l +INNER JOIN + snd.LookupSets ls +ON + l.LookupSetId = ls.LookupSetId +INNER JOIN + core.SiteUsers s +ON + l.modifiedBy = s.UserId \ No newline at end of file