Skip to content

Commit

Permalink
Merge pull request #529 from palladiumkenya/Refactor_PrEP_Default_Schema
Browse files Browse the repository at this point in the history
Moved PrEP related base scripts from the default dbo schema to PrEP s…
  • Loading branch information
DennisGibz authored Jan 13, 2025
2 parents a61a1a5 + 7934d9a commit c32a666
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Scripts/ODS/PrEP DOCKET/Load_PrEP_AdverseEvent.sql
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -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 ;
Expand Down
4 changes: 2 additions & 2 deletions Scripts/ODS/PrEP DOCKET/Load_PrEP_BehaviourRisk.sql
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 2 additions & 2 deletions Scripts/ODS/PrEP DOCKET/Load_PrEP_CareTermination.sql
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion Scripts/ODS/PrEP DOCKET/Load_PrEP_Lab.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

BEGIN
MERGE [ODS].[dbo].[PrEP_Lab] AS a
MERGE [ODS].[PrEP].[PrEP_Lab] AS a
USING(SELECT DISTINCT

a.[RefId]
Expand Down
4 changes: 2 additions & 2 deletions Scripts/ODS/PrEP DOCKET/Load_PrEP_Patient.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

BEGIN
MERGE [ODS].[dbo].[PrEP_Patient] AS a
MERGE [ODS].[PrEP].[PrEP_Patient] AS a
USING(SELECT ID
,[RefId]
,[Created]
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/ODS/PrEP DOCKET/Load_PrEP_Pharmacy.sql
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion Scripts/ODS/PrEP DOCKET/Load_PrEP_Visits.sql
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit c32a666

Please sign in to comment.