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

Moved PrEP related base scripts from the default dbo schema to PrEP s… #529

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
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