From 7934d9a1f12dacf4154d3c19401a04fde600b30e Mon Sep 17 00:00:00 2001 From: Mugo Date: Fri, 20 Dec 2024 11:27:30 +0300 Subject: [PATCH] Moved PrEP related base scripts from the default dbo schema to PrEP schema --- Scripts/ODS/PrEP DOCKET/Load_PrEP_AdverseEvent.sql | 6 +++--- Scripts/ODS/PrEP DOCKET/Load_PrEP_BehaviourRisk.sql | 4 ++-- Scripts/ODS/PrEP DOCKET/Load_PrEP_CareTermination.sql | 4 ++-- Scripts/ODS/PrEP DOCKET/Load_PrEP_Lab.sql | 2 +- Scripts/ODS/PrEP DOCKET/Load_PrEP_Patient.sql | 4 ++-- Scripts/ODS/PrEP DOCKET/Load_PrEP_Pharmacy.sql | 2 +- Scripts/ODS/PrEP DOCKET/Load_PrEP_Visits.sql | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Scripts/ODS/PrEP DOCKET/Load_PrEP_AdverseEvent.sql b/Scripts/ODS/PrEP DOCKET/Load_PrEP_AdverseEvent.sql index 946e056a..63a546e4 100644 --- a/Scripts/ODS/PrEP DOCKET/Load_PrEP_AdverseEvent.sql +++ b/Scripts/ODS/PrEP DOCKET/Load_PrEP_AdverseEvent.sql @@ -1,7 +1,7 @@ BEGIN ---truncate table [ODS].[dbo].[PrEP_AdverseEvent] -MERGE [ODS].[dbo].[PrEP_AdverseEvent] AS a +--truncate table [ODS].[PrEP].[PrEP_AdverseEvent] +MERGE [ODS].[PrEP].[PrEP_AdverseEvent] AS a USING(SELECT distinct a.[Id] ,a.[RefId] @@ -81,7 +81,7 @@ MERGE [ODS].[dbo].[PrEP_AdverseEvent] AS a ROW_NUMBER() OVER (PARTITION BY PatientPK,Sitecode ORDER BY PatientPK,Sitecode) Row_Num - FROM [ODS].[dbo].[PrEP_AdverseEvent](NoLock) + FROM [ODS].[PrEP].[PrEP_AdverseEvent](NoLock) ) Delete from cte Where Row_Num >1 ; diff --git a/Scripts/ODS/PrEP DOCKET/Load_PrEP_BehaviourRisk.sql b/Scripts/ODS/PrEP DOCKET/Load_PrEP_BehaviourRisk.sql index 2929572f..cc11df76 100644 --- a/Scripts/ODS/PrEP DOCKET/Load_PrEP_BehaviourRisk.sql +++ b/Scripts/ODS/PrEP DOCKET/Load_PrEP_BehaviourRisk.sql @@ -1,7 +1,7 @@ BEGIN ---truncate table [ODS].[dbo].[PrEP_BehaviourRisk] -MERGE [ODS].[dbo].[PrEP_BehaviourRisk] AS a +--truncate table [ODS].[PrEP].[PrEP_BehaviourRisk] +MERGE [ODS].[PrEP].[PrEP_BehaviourRisk] AS a USING(SELECT distinct A.ID ,a.[RefId] diff --git a/Scripts/ODS/PrEP DOCKET/Load_PrEP_CareTermination.sql b/Scripts/ODS/PrEP DOCKET/Load_PrEP_CareTermination.sql index 43ed4e85..8075f372 100644 --- a/Scripts/ODS/PrEP DOCKET/Load_PrEP_CareTermination.sql +++ b/Scripts/ODS/PrEP DOCKET/Load_PrEP_CareTermination.sql @@ -1,7 +1,7 @@ BEGIN ---truncate table [ODS].[dbo].[PrEP_CareTermination] -MERGE [ODS].[dbo].[PrEP_CareTermination] AS a +--truncate table [ODS].[PrEP].[PrEP_CareTermination] +MERGE [ODS].[PrEP].[PrEP_CareTermination] AS a USING(SELECT distinct a.[Id] ,a.[RefId] ,a.[Created] diff --git a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Lab.sql b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Lab.sql index f0cc5031..bae38a5f 100644 --- a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Lab.sql +++ b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Lab.sql @@ -1,6 +1,6 @@ BEGIN -MERGE [ODS].[dbo].[PrEP_Lab] AS a +MERGE [ODS].[PrEP].[PrEP_Lab] AS a USING(SELECT DISTINCT a.[RefId] diff --git a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Patient.sql b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Patient.sql index df9984be..7907de9b 100644 --- a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Patient.sql +++ b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Patient.sql @@ -1,6 +1,6 @@ BEGIN -MERGE [ODS].[dbo].[PrEP_Patient] AS a +MERGE [ODS].[PrEP].[PrEP_Patient] AS a USING(SELECT ID ,[RefId] ,[Created] @@ -95,7 +95,7 @@ MERGE [ODS].[dbo].[PrEP_Patient] AS a ROW_NUMBER() OVER (PARTITION BY PatientPK,sitecode ORDER BY PatientPK,sitecode) Row_Num - FROM [ODS].[dbo].[PrEP_Patient](NoLock) + FROM [ODS].[PrEP].[PrEP_Patient](NoLock) ) delete from cte Where Row_Num >1; diff --git a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Pharmacy.sql b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Pharmacy.sql index 9373077c..361da152 100644 --- a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Pharmacy.sql +++ b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Pharmacy.sql @@ -1,7 +1,7 @@ BEGIN -MERGE [ODS].[dbo].[PrEP_Pharmacy] AS a +MERGE [ODS].[PrEP].[PrEP_Pharmacy] AS a USING(SELECT distinct a.[Id] ,a.[RefId] diff --git a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Visits.sql b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Visits.sql index 1915a91f..5d3a44bf 100644 --- a/Scripts/ODS/PrEP DOCKET/Load_PrEP_Visits.sql +++ b/Scripts/ODS/PrEP DOCKET/Load_PrEP_Visits.sql @@ -1,6 +1,6 @@ BEGIN -MERGE [ODS].[dbo].[PrEP_Visits] AS a +MERGE [ODS].[PrEP].[PrEP_Visits] AS a USING(SELECT distinct a.[RefId] ,a.[Created]