Skip to content

Commit

Permalink
Merge pull request #458 from palladiumkenya/NewVaraiblesInto_ODS
Browse files Browse the repository at this point in the history
Added new variables on both ODS.dbo.ct_Patientvisit([AppointmentRemin…
  • Loading branch information
DennisGibz authored Jul 15, 2024
2 parents f2cbf19 + 88b33a5 commit bce23fd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Scripts/ODS/CT_DOCKET/CT_PatientVisits.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ BEGIN
,PV.[Date_Last_Modified]
,PV.RecordUUID
,[WHOStagingOI]
,PV.[AppointmentReminderWillingness]
,PV.[WantsToGetPregnant]
FROM [DWAPICentral].[dbo].[PatientExtract] P WITH (NoLock)
INNER JOIN [DWAPICentral].[dbo].[PatientVisitExtract] PV WITH(NoLock) ON PV.[PatientId]= P.ID
INNER JOIN [DWAPICentral].[dbo].[Facility] F WITH(NoLock) ON P.[FacilityId] = F.Id AND F.Voided=0
Expand Down Expand Up @@ -191,6 +193,8 @@ BEGIN
,voided
,VoidingSource
,[WHOStagingOI]
,[AppointmentReminderWillingness]
,[WantsToGetPregnant]
,LoadDate
)
VALUES(
Expand Down Expand Up @@ -250,6 +254,8 @@ BEGIN
,voided
,VoidingSource
,[WHOStagingOI]
,[AppointmentReminderWillingness]
,[WantsToGetPregnant]
,Getdate()
)

Expand Down Expand Up @@ -311,7 +317,9 @@ BEGIN
a.[Date_Last_Modified] =b.[Date_Last_Modified],
a.RecordUUID =b.RecordUUID,
a.voided =b.voided,
a.[WHOStagingOI] =b.[WHOStagingOI];
a.[WHOStagingOI] =b.[WHOStagingOI],
a.[AppointmentReminderWillingness] = b.[AppointmentReminderWillingness],
a.[WantsToGetPregnant] = b.[WantsToGetPregnant];

UPDATE [ODS_Logs].[dbo].[CT_Visit_Log]
SET LoadEndDateTime = GETDATE()
Expand Down
18 changes: 17 additions & 1 deletion Scripts/ODS/CT_DOCKET/Load_CT_Ipt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ BEGIN
when IE.voided = 1 Then 'Source'
Else Null
END
,IE.[Adherence]
,IE.Hepatoxicity
,IE.PeripheralNeruopath
,IE.Rash
FROM [DWAPICentral].[dbo].[PatientExtract](NoLock) P
INNER JOIN [DWAPICentral].[dbo].[IptExtract](NoLock) IE ON IE.[PatientId] = P.ID
INNER JOIN [DWAPICentral].[dbo].[Facility](NoLock) F ON P.[FacilityId] = F.Id AND F.Voided = 0
Expand Down Expand Up @@ -132,6 +136,10 @@ BEGIN
,RecordUUID
,voided
,VoidingSource
,[Adherence]
,Hepatoxicity
,PeripheralNeruopath
,Rash
,LoadDate
)
VALUES(
Expand Down Expand Up @@ -171,6 +179,10 @@ BEGIN
,RecordUUID
,voided
,VoidingSource
,[Adherence]
,Hepatoxicity
,PeripheralNeruopath
,Rash
,Getdate()
)

Expand Down Expand Up @@ -202,7 +214,11 @@ BEGIN
a.IPTDiscontinuation = b.IPTDiscontinuation,
a.DateOfDiscontinuation = b.DateOfDiscontinuation,
a.RecordUUID = b.RecordUUID,
a.voided = b.voided;
a.voided = b.voided
,a.[Adherence] = b.[Adherence]
,a.Hepatoxicity = b.Hepatoxicity
,a.PeripheralNeruopath = b.PeripheralNeruopath
,a.Rash = b.Rash;


UPDATE [ODS_logs].[dbo].[CT_Ipt_Log]
Expand Down

0 comments on commit bce23fd

Please sign in to comment.