Skip to content

Commit 8574f93

Browse files
Hotfix for v_getobscode and v_getobstxt (#247)
1 parent 3ba5ce8 commit 8574f93

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

db/upgrade/rdb_modern/views/001-v_getobscode.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ WITH InvFormQObservations AS
5252
dbo.nrt_investigation_observation tnio with (nolock)
5353
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)
5454
inner join dbo.nrt_observation_coded ovc with (nolock) ON ovc.observation_uid = tnio.branch_id
55-
inner join dbo.nrt_observation o with (nolock) ON o.observation_uid = ovc.observation_uid
55+
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)
5656
WHERE branch_type_cd = 'InvFrmQ'
5757

5858
)

db/upgrade/rdb_modern/views/004-v_getobstxt.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ FROM
1212
dbo.nrt_investigation_observation tnio with (nolock)
1313
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)
1414
LEFT JOIN dbo.nrt_observation o with (nolock) ON o.observation_uid = tnio.branch_id
15-
LEFT JOIN dbo.nrt_observation_txt ovt with (nolock) ON ovt.observation_uid = o.observation_uid
15+
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)
1616
WHERE tnio.branch_type_cd = 'InvFrmQ' AND ovt.ovt_seq = 1;

liquibase-service/src/main/resources/db/rdb_modern/views/001-v_getobscode-001.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ WITH InvFormQObservations AS
5252
dbo.nrt_investigation_observation tnio with (nolock)
5353
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)
5454
inner join dbo.nrt_observation_coded ovc with (nolock) ON ovc.observation_uid = tnio.branch_id
55-
inner join dbo.nrt_observation o with (nolock) ON o.observation_uid = ovc.observation_uid
55+
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)
5656
WHERE branch_type_cd = 'InvFrmQ'
5757

5858
)

liquibase-service/src/main/resources/db/rdb_modern/views/004-v_getobstxt-001.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ FROM
1212
dbo.nrt_investigation_observation tnio with (nolock)
1313
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)
1414
LEFT JOIN dbo.nrt_observation o with (nolock) ON o.observation_uid = tnio.branch_id
15-
LEFT JOIN dbo.nrt_observation_txt ovt with (nolock) ON ovt.observation_uid = o.observation_uid
15+
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)
1616
WHERE tnio.branch_type_cd = 'InvFrmQ' AND ovt.ovt_seq = 1;

0 commit comments

Comments
 (0)