Skip to content

Commit 7e3529f

Browse files
ericnagelhawley-skylighteliSkylight
authored
Test updates after new Golden Backup (#930)
Co-authored-by: Patrick Hawley <patrick.hawley@skylight.digital> Co-authored-by: Eli <elijah.reyes@skylight.digital>
1 parent 7ce6894 commit 7e3529f

21 files changed

Lines changed: 258 additions & 82 deletions

File tree

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
nbs-mssql:
3-
image: ghcr.io/cdcent/nedssdb:8a35ca
3+
image: ghcr.io/cdcent/nedssdb:6.0.17.0-replacement-beta
44
platform: linux/amd64
55
environment:
66
- DATABASE_VERSION=6.0.18.1

reporting-pipeline-service/src/main/resources/db/changelog/migrations/v17.3/rdb/onboarding/000-nrt_metadata_load-001.sql

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,76 @@ GO
105105
IF OBJECT_ID('dbo.nrt_srte_Condition_code', 'U') IS NOT NULL
106106
begin
107107
truncate table dbo.nrt_srte_Condition_code;
108-
insert into dbo.nrt_srte_Condition_code select * from nbs_srte.dbo.Condition_code;
108+
insert into dbo.nrt_srte_Condition_code (
109+
condition_cd,
110+
condition_codeset_nm,
111+
condition_seq_num,
112+
assigning_authority_cd,
113+
assigning_authority_desc_txt,
114+
code_system_cd,
115+
code_system_desc_txt,
116+
condition_desc_txt,
117+
condition_short_nm,
118+
effective_from_time,
119+
effective_to_time,
120+
indent_level_nbr,
121+
investigation_form_cd,
122+
is_modifiable_ind,
123+
nbs_uid,
124+
nnd_ind,
125+
parent_is_cd,
126+
prog_area_cd,
127+
reportable_morbidity_ind,
128+
reportable_summary_ind,
129+
status_cd,
130+
status_time,
131+
nnd_entity_identifier,
132+
nnd_summary_entity_identifier,
133+
summary_investigation_form_cd,
134+
contact_tracing_enable_ind,
135+
vaccine_enable_ind,
136+
treatment_enable_ind,
137+
lab_report_enable_ind,
138+
morb_report_enable_ind,
139+
port_req_ind_cd,
140+
family_cd,
141+
coinfection_grp_cd
142+
)
143+
select
144+
condition_cd,
145+
condition_codeset_nm,
146+
condition_seq_num,
147+
assigning_authority_cd,
148+
assigning_authority_desc_txt,
149+
code_system_cd,
150+
code_system_desc_txt,
151+
condition_desc_txt,
152+
condition_short_nm,
153+
effective_from_time,
154+
effective_to_time,
155+
indent_level_nbr,
156+
investigation_form_cd,
157+
is_modifiable_ind,
158+
nbs_uid,
159+
nnd_ind,
160+
parent_is_cd,
161+
prog_area_cd,
162+
reportable_morbidity_ind,
163+
reportable_summary_ind,
164+
status_cd,
165+
status_time,
166+
nnd_entity_identifier,
167+
nnd_summary_entity_identifier,
168+
summary_investigation_form_cd,
169+
contact_tracing_enable_ind,
170+
vaccine_enable_ind,
171+
treatment_enable_ind,
172+
lab_report_enable_ind,
173+
morb_report_enable_ind,
174+
port_req_ind_cd,
175+
family_cd,
176+
coinfection_grp_cd
177+
from nbs_srte.dbo.Condition_code;
109178
end;
110179
GO
111180

@@ -366,7 +435,7 @@ DECLARE @condition_cd_list VARCHAR(MAX)
366435

367436
IF OBJECT_ID('dbo.nrt_srte_Condition_code', 'U') IS NOT NULL
368437
BEGIN
369-
SELECT @condition_cd_list = STRING_AGG(CAST(CONDITION_CD AS VARCHAR), ',')
438+
SELECT @condition_cd_list = STRING_AGG(CAST(CONDITION_CD AS VARCHAR), ',')
370439
FROM dbo.nrt_srte_Condition_code
371440

372441
IF @condition_cd_list IS NOT NULL

reporting-pipeline-service/src/main/resources/db/changelog/migrations/v17.3/rdb/onboarding/001-nrt_keys_backfill-001.sql

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -392,23 +392,6 @@ IF EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_ldf_group_key' and xtype =
392392
END;
393393
GO
394394

395-
-----------------------------------------------------------------------
396-
-- 020: nrt_condition_key
397-
-----------------------------------------------------------------------
398-
IF EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_condition_key' and xtype = 'U')
399-
AND EXISTS (SELECT 1 FROM sysobjects WHERE name = 'CONDITION' and xtype = 'U')
400-
BEGIN
401-
SET IDENTITY_INSERT [dbo].nrt_condition_key ON
402-
INSERT INTO [dbo].nrt_condition_key(CONDITION_KEY, CONDITION_CD, PROGRAM_AREA_CD)
403-
SELECT c.CONDITION_KEY, c.CONDITION_CD, c.PROGRAM_AREA_CD
404-
FROM [dbo].CONDITION c WITH(NOLOCK)
405-
LEFT JOIN [dbo].nrt_condition_key k ON k.CONDITION_KEY = c.CONDITION_KEY AND COALESCE(k.CONDITION_CD, '') = COALESCE(c.CONDITION_CD, '') AND COALESCE(k.PROGRAM_AREA_CD, '') = COALESCE(c.PROGRAM_AREA_CD, '')
406-
WHERE k.CONDITION_KEY IS NULL AND k.CONDITION_CD IS NULL AND k.PROGRAM_AREA_CD IS NULL
407-
ORDER BY c.CONDITION_KEY;
408-
SET IDENTITY_INSERT [dbo].nrt_condition_key OFF
409-
END;
410-
GO
411-
412395
-----------------------------------------------------------------------
413396
-- Reseed Identity Columns (Matching original 0999 pattern)
414397
-----------------------------------------------------------------------

reporting-pipeline-service/src/main/resources/db/changelog/migrations/v17.3/rdb/routines/340-sp_nrt_srte_condition_code_postprocessing-001.sql

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,17 @@ BEGIN
248248
CONDITION_CD,
249249
PROGRAM_AREA_CD
250250
)
251-
SELECT
252-
CONDITION_CD,
253-
PROGRAM_AREA_CD
254-
FROM #CONDITION_INIT
255-
WHERE CONDITION_KEY IS NULL;
251+
SELECT DISTINCT
252+
src.CONDITION_CD,
253+
src.PROGRAM_AREA_CD
254+
FROM #CONDITION_INIT src
255+
WHERE src.CONDITION_KEY IS NULL
256+
AND NOT EXISTS (
257+
SELECT 1
258+
FROM dbo.nrt_condition_key k WITH (UPDLOCK, HOLDLOCK)
259+
WHERE COALESCE(k.CONDITION_CD, '') = COALESCE(src.CONDITION_CD, '')
260+
AND COALESCE(k.PROGRAM_AREA_CD, '') = COALESCE(src.PROGRAM_AREA_CD, '')
261+
);
256262

257263
SELECT @ROWCOUNT_NO = @@ROWCOUNT;
258264

@@ -303,7 +309,13 @@ BEGIN
303309
INNER JOIN dbo.nrt_condition_key k
304310
ON COALESCE(k.CONDITION_CD, '') = COALESCE(src.CONDITION_CD, '')
305311
AND COALESCE(k.PROGRAM_AREA_CD, '') = COALESCE(src.PROGRAM_AREA_CD, '')
306-
WHERE src.CONDITION_KEY IS NULL;
312+
WHERE src.CONDITION_KEY IS NULL
313+
AND NOT EXISTS (
314+
SELECT 1
315+
FROM dbo.CONDITION c
316+
WHERE COALESCE(c.CONDITION_CD, '') = COALESCE(src.CONDITION_CD, '')
317+
AND COALESCE(c.PROGRAM_AREA_CD, '') = COALESCE(src.PROGRAM_AREA_CD, '')
318+
);
307319

308320

309321
SELECT @ROWCOUNT_NO = @@ROWCOUNT;

reporting-pipeline-service/src/main/resources/db/changelog/migrations/v17.3/rdb/tables/252-create_nrt_condition_key-001.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,28 @@ IF NOT EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_condition_key' and xty
2323

2424
END
2525

26+
IF EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_condition_key' and xtype = 'U')
27+
AND NOT EXISTS (
28+
SELECT 1
29+
FROM sys.key_constraints
30+
WHERE [type] = 'PK'
31+
AND [name] = 'pk_nrt_condition_key'
32+
AND [parent_object_id] = OBJECT_ID('[dbo].nrt_condition_key')
33+
)
34+
BEGIN
35+
ALTER TABLE [dbo].nrt_condition_key
36+
ADD CONSTRAINT pk_nrt_condition_key PRIMARY KEY (CONDITION_KEY);
37+
END
38+
39+
IF EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_condition_key' and xtype = 'U')
40+
AND NOT EXISTS (
41+
SELECT 1
42+
FROM sys.indexes
43+
WHERE [name] = 'ux_nrt_condition_key_cd_prog_area'
44+
AND [object_id] = OBJECT_ID('[dbo].nrt_condition_key')
45+
)
46+
BEGIN
47+
CREATE UNIQUE INDEX ux_nrt_condition_key_cd_prog_area
48+
ON [dbo].nrt_condition_key (condition_cd, program_area_cd);
49+
END
50+

reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/query.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ SELECT
4545
[EARLIEST_RPT_TO_CNTY_DT],
4646
[EARLIEST_RPT_TO_ST_DT],
4747
[EARLIEST_SPECIMEN_COLLECT_DATE],
48-
[EXPRSSN],
4948
[FIRST_RPT_TO_PHD_DT],
5049
[FOOD_HANDLR_IND],
5150
[HSPTLIZD_IND],
@@ -89,7 +88,6 @@ SELECT
8988
[NOTIFICATION_LOCAL_ID],
9089
[NOTIFICATION_STATUS],
9190
[NOTIF_COMMENT],
92-
[ORGANIZATION_UID],
9391
[OUTBREAK_IND],
9492
[OUTBREAK_NAME],
9593
[PATIENT_AGE_AT_ONSET],
@@ -135,7 +133,6 @@ SELECT
135133
[PROGRAM_AREA],
136134
[PROGRAM_JURISDICTION_OID],
137135
[PROVIDER_LOCAL_ID],
138-
[PROVIDER_UID],
139136
[REPORTING_FACILITY_DETAIL],
140137
[REPORTING_FACILITY_KEY],
141138
[REPORTING_FACILITY_QEC],

reporting-pipeline-service/src/test/resources/testData/functional/stdContactTracingPartTwo/010-PartOneSetup/expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
],
380380
"21": [
381381
{
382+
"ADD_DATE_KEY": 13276,
382383
"CLOSED_BY_KEY": 1,
383384
"CONDITION_CD": "10312",
384385
"DELIVERING_HOSP_KEY": 1,
@@ -393,6 +394,7 @@
393394
"INTERVIEWER_ASSIGNED_KEY": 2,
394395
"INVESTIGATOR_KEY": 2,
395396
"INVSTGTR_FLD_FOLLOW_UP_KEY": 4,
397+
"LAST_CHG_DATE_KEY": 13276,
396398
"MOTHER_OB_GYN_KEY": 1,
397399
"ORDERING_FACILITY_KEY": 4,
398400
"ORG_AS_REPORTER_KEY": 4,
@@ -483,6 +485,7 @@
483485
"JURISDICTION_CD": "130001",
484486
"JURISDICTION_NM": "Fulton County",
485487
"LAST_CHG_TIME": "2026-05-06T22:36:22.750",
488+
"OUTBREAK_IND": "",
486489
"PATIENT_AGE_AT_ONSET": 41,
487490
"PATIENT_AGE_AT_ONSET_UNIT": "Years",
488491
"PATIENT_PREGNANT_IND": "Yes",
@@ -675,7 +678,6 @@
675678
"SPECIMEN_COLLECTOR_KEY": 1
676679
},
677680
{
678-
"PROGRAM_AREA_CD": null,
679681
"COPY_TO_PROVIDER_KEY": 1,
680682
"LAB_RPT_DT_KEY": 13276,
681683
"LAB_TEST_TECHNICIAN_KEY": 1,
@@ -756,6 +758,7 @@
756758
"JURISDICTION_CD": "130001",
757759
"JURISDICTION_NM": "Fulton County",
758760
"MDH_PREV_STD_HIST": "No",
761+
"OUTBREAK_IND": "",
759762
"ORDERING_FACILITY_KEY": 4,
760763
"PATIENT_AGE_AT_ONSET": 41,
761764
"PATIENT_AGE_AT_ONSET_UNIT": "Years",

reporting-pipeline-service/src/test/resources/testData/functional/stdContactTracingPartTwo/070-AddContactSyphilis/expected.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@
581581
],
582582
"29": [
583583
{
584+
"ADD_DATE_KEY": 13276,
584585
"CLOSED_BY_KEY": 1,
585586
"CONDITION_CD": "10312",
586587
"DELIVERING_HOSP_KEY": 1,
@@ -595,6 +596,7 @@
595596
"INTERVIEWER_ASSIGNED_KEY": 1,
596597
"INVESTIGATOR_KEY": 2,
597598
"INVSTGTR_FLD_FOLLOW_UP_KEY": 2,
599+
"LAST_CHG_DATE_KEY": 13276,
598600
"MOTHER_OB_GYN_KEY": 1,
599601
"ORDERING_FACILITY_KEY": 1,
600602
"ORG_AS_REPORTER_KEY": 1,
@@ -607,6 +609,7 @@
607609
"SURVEILLANCE_INVESTIGATOR_KEY": 1
608610
},
609611
{
612+
"ADD_DATE_KEY": 13276,
610613
"CLOSED_BY_KEY": 1,
611614
"CONDITION_CD": "10312",
612615
"DELIVERING_HOSP_KEY": 1,
@@ -621,6 +624,7 @@
621624
"INTERVIEWER_ASSIGNED_KEY": 2,
622625
"INVESTIGATOR_KEY": 2,
623626
"INVSTGTR_FLD_FOLLOW_UP_KEY": 4,
627+
"LAST_CHG_DATE_KEY": 13276,
624628
"MOTHER_OB_GYN_KEY": 1,
625629
"ORDERING_FACILITY_KEY": 4,
626630
"ORG_AS_REPORTER_KEY": 4,
@@ -693,6 +697,8 @@
693697
"CURR_PROCESS_STATE": "Field Follow-up",
694698
"DISEASE": "Syphilis, secondary",
695699
"DISEASE_CD": "10312",
700+
"EVENT_DATE": "2026-04-25T00:00:00.000",
701+
"EVENT_DATE_TYPE": "Investigation Start Date",
696702
"INVESTIGATION_CREATED_BY": "Kent, Ariella",
697703
"INVESTIGATION_CREATE_DATE": "2026-05-06T22:43:44.750",
698704
"INVESTIGATION_LAST_UPDTD_BY": "Kent, Ariella",
@@ -737,6 +743,7 @@
737743
"JURISDICTION_CD": "130001",
738744
"JURISDICTION_NM": "Fulton County",
739745
"LAST_CHG_TIME": "2026-05-06T22:36:22.750",
746+
"OUTBREAK_IND": "",
740747
"PATIENT_AGE_AT_ONSET": 41,
741748
"PATIENT_AGE_AT_ONSET_UNIT": "Years",
742749
"PATIENT_PREGNANT_IND": "Yes",
@@ -763,6 +770,7 @@
763770
"INV_LOCAL_ID": "CAS1000009024GA01",
764771
"INV_SHARE_IND": "T",
765772
"INV_START_DT": "2026-04-25T00:00:00.000",
773+
"INV_STATE_CASE_ID": "CAS1000009024GA01",
766774
"JURISDICTION_CD": "130001",
767775
"JURISDICTION_NM": "Fulton County",
768776
"LAST_CHG_TIME": "2026-05-06T22:43:44.750",
@@ -954,7 +962,6 @@
954962
"SPECIMEN_COLLECTOR_KEY": 1
955963
},
956964
{
957-
"PROGRAM_AREA_CD": null,
958965
"COPY_TO_PROVIDER_KEY": 1,
959966
"LAB_RPT_DT_KEY": 13276,
960967
"LAB_TEST_TECHNICIAN_KEY": 1,
@@ -1036,6 +1043,7 @@
10361043
"JURISDICTION_NM": "Fulton County",
10371044
"MDH_PREV_STD_HIST": "No",
10381045
"ORDERING_FACILITY_KEY": 4,
1046+
"OUTBREAK_IND": "",
10391047
"PATIENT_AGE_AT_ONSET": 41,
10401048
"PATIENT_AGE_AT_ONSET_UNIT": "Years",
10411049
"PATIENT_AGE_REPORTED": " 41 Years",

0 commit comments

Comments
 (0)