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

Hotfix for v_getobscode and v_getobstxt #247

Merged
merged 9 commits into from
Mar 12, 2025
2 changes: 1 addition & 1 deletion db/upgrade/rdb_modern/views/001-v_getobscode.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ WITH InvFormQObservations AS
dbo.nrt_investigation_observation tnio with (nolock)
INNER JOIN dbo.nrt_investigation inv with (nolock) on tnio.public_health_case_uid = inv.public_health_case_uid and ISNULL(tnio.batch_id, 1) = ISNULL(inv.batch_id, 1)
inner join dbo.nrt_observation_coded ovc with (nolock) ON ovc.observation_uid = tnio.branch_id
inner join dbo.nrt_observation o with (nolock) ON o.observation_uid = ovc.observation_uid
inner join dbo.nrt_observation o with (nolock) ON o.observation_uid = ovc.observation_uid and ISNULL(o.batch_id,1) = ISNULL(ovc.batch_id,1)
WHERE branch_type_cd = 'InvFrmQ'

)
Expand Down
2 changes: 1 addition & 1 deletion db/upgrade/rdb_modern/views/004-v_getobstxt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FROM
dbo.nrt_investigation_observation tnio with (nolock)
INNER JOIN dbo.nrt_investigation inv with (nolock) on tnio.public_health_case_uid = inv.public_health_case_uid and ISNULL(tnio.batch_id, 1) = ISNULL(inv.batch_id, 1)
LEFT JOIN dbo.nrt_observation o with (nolock) ON o.observation_uid = tnio.branch_id
LEFT JOIN dbo.nrt_observation_txt ovt with (nolock) ON ovt.observation_uid = o.observation_uid
LEFT JOIN dbo.nrt_observation_txt ovt with (nolock) ON ovt.observation_uid = o.observation_uid and ISNULL(o.batch_id,1) = ISNULL(ovt.batch_id,1)
WHERE tnio.branch_type_cd = 'InvFrmQ' AND ovt.ovt_seq = 1;
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ WITH InvFormQObservations AS
dbo.nrt_investigation_observation tnio with (nolock)
INNER JOIN dbo.nrt_investigation inv with (nolock) on tnio.public_health_case_uid = inv.public_health_case_uid and ISNULL(tnio.batch_id, 1) = ISNULL(inv.batch_id, 1)
inner join dbo.nrt_observation_coded ovc with (nolock) ON ovc.observation_uid = tnio.branch_id
inner join dbo.nrt_observation o with (nolock) ON o.observation_uid = ovc.observation_uid
inner join dbo.nrt_observation o with (nolock) ON o.observation_uid = ovc.observation_uid and ISNULL(o.batch_id,1) = ISNULL(ovc.batch_id,1)
WHERE branch_type_cd = 'InvFrmQ'

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FROM
dbo.nrt_investigation_observation tnio with (nolock)
INNER JOIN dbo.nrt_investigation inv with (nolock) on tnio.public_health_case_uid = inv.public_health_case_uid and ISNULL(tnio.batch_id, 1) = ISNULL(inv.batch_id, 1)
LEFT JOIN dbo.nrt_observation o with (nolock) ON o.observation_uid = tnio.branch_id
LEFT JOIN dbo.nrt_observation_txt ovt with (nolock) ON ovt.observation_uid = o.observation_uid
LEFT JOIN dbo.nrt_observation_txt ovt with (nolock) ON ovt.observation_uid = o.observation_uid and ISNULL(o.batch_id,1) = ISNULL(ovt.batch_id,1)
WHERE tnio.branch_type_cd = 'InvFrmQ' AND ovt.ovt_seq = 1;