diff --git a/liquibase-service/src/main/resources/db/rdb/routines/051-sp_organization_event-001.sql b/liquibase-service/src/main/resources/db/rdb/routines/051-sp_organization_event-001.sql index e44f7c76a..78df7c6fc 100644 --- a/liquibase-service/src/main/resources/db/rdb/routines/051-sp_organization_event-001.sql +++ b/liquibase-service/src/main/resources/db/rdb/routines/051-sp_organization_event-001.sql @@ -108,10 +108,10 @@ BEGIN (SELECT (SELECT tl.tele_locator_uid AS [ph_tl_uid], elp.cd AS [ph_elp_cd], elp.use_cd AS [ph_elp_use_cd], - REPLACE(tl.phone_nbr_txt, ' ', '') telephone_nbr, - tl.extension_txt extension_txt, - STRING_ESCAPE(tl.email_address, 'json') email_address, - elp.locator_desc_txt as [phone_comments] + REPLACE(tl.phone_nbr_txt, ' ', '') [telephone_nbr], + NULLIF(LTRIM(RTRIM(tl.extension_txt)), '') AS [extension_txt], + NULLIF(LTRIM(RTRIM(STRING_ESCAPE(tl.email_address, 'json'))), '') AS [email_address], + NULLIF(LTRIM(RTRIM(elp.locator_desc_txt)), '') AS [phone_comments] FROM nbs_odse.dbo.Entity_locator_participation elp WITH (NOLOCK) JOIN nbs_odse.dbo.Tele_locator tl WITH (NOLOCK) ON elp.locator_uid = tl.tele_locator_uid WHERE elp.entity_uid = o.organization_uid diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/010-createPatient/expected.json b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/010-createPatient/expected.json similarity index 100% rename from reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/010-createPatient/expected.json rename to reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/010-createPatient/expected.json diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/010-createPatient/query.sql b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/010-createPatient/query.sql similarity index 100% rename from reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/010-createPatient/query.sql rename to reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/010-createPatient/query.sql diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/010-createPatient/setup.sql b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/010-createPatient/setup.sql similarity index 100% rename from reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/010-createPatient/setup.sql rename to reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/010-createPatient/setup.sql diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/020-createBmirdCaseInvestigation/expected.json b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/020-createBmirdCaseInvestigation/expected.json similarity index 100% rename from reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/020-createBmirdCaseInvestigation/expected.json rename to reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/020-createBmirdCaseInvestigation/expected.json diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/020-createBmirdCaseInvestigation/query.sql b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/020-createBmirdCaseInvestigation/query.sql similarity index 100% rename from reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/020-createBmirdCaseInvestigation/query.sql rename to reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/020-createBmirdCaseInvestigation/query.sql diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/020-createBmirdCaseInvestigation/setup.sql b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/020-createBmirdCaseInvestigation/setup.sql similarity index 100% rename from reporting-pipeline-service/src/test/resources/testData/functional/bmirdCase/020-createBmirdCaseInvestigation/setup.sql rename to reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/020-createBmirdCaseInvestigation/setup.sql diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/expected.json b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/expected.json new file mode 100644 index 000000000..fa4fedfaf --- /dev/null +++ b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/expected.json @@ -0,0 +1,54 @@ +{ + "0": [ + { + "CONFIRMATION_DT": "2026-06-08T00:00:00.000" + } + ], + "1": [ + { + "CASE_RPT_MMWR_WK": 23, + "CASE_RPT_MMWR_YR": 2026, + "CONFIRMATION_DT": "2026-06-08T00:00:00.000", + "CONFIRMATION_METHOD": "Active Surveillance", + "DETECT_METH_DESC_TXT": "Patient self-referral", + "DISEASE": "Acanthamoeba Disease (Excluding Keratitis)", + "DISEASE_CD": "50225", + "HSPTLIZD_IND": "Yes", + "HSPTL_ADMISSION_DT": "2026-06-07T00:00:00.000", + "HSPTL_DISCHARGE_DT": "2026-06-08T00:00:00.000", + "HSPTL_DURATION_DAYS": 1, + "HSP_DETAIL": "ORG10000001GA01
CHOA - Scottish Rite
1001 Johnson Ferry Rd NE
Atlanta, Georgia 30034
Dekalb County
404-785-5252
", + "HSP_KEY": 3.0, + "HSP_QEC": "2", + "HSP_UID": 10003007.0, + "INVESTIGATION_CREATED_BY": "Kent, Ariella", + "INVESTIGATION_CREATE_DATE": "2026-06-08T17:11:05.093", + "INVESTIGATION_LAST_UPDTD_BY": "Kent, Ariella", + "INVESTIGATION_LAST_UPDTD_DATE": "2026-06-08T17:11:05.093", + "INVESTIGATION_STATUS": "Open", + "INV_CASE_STATUS": "Confirmed", + "INV_LOCAL_ID": "CAS10000010031GA01", + "INV_SHARE_IND": "T", + "INV_START_DT": "2026-06-08T00:00:00.000", + "JURISDICTION_CD": "130005", + "JURISDICTION_NM": "Dekalb County", + "PATIENT_COUNTRY": "United States", + "PATIENT_CURRENT_SEX": "Male", + "PATIENT_DOB": "1978-01-18T00:00:00.000", + "PATIENT_FIRST_NAME": "Obi Wan", + "PATIENT_LAST_NAME": "Kenobi", + "PATIENT_LOCAL_ID": "PSN1000001000GA01", + "PATIENT_RACE_CALC": "Unknown", + "PATIENT_STATE": "Georgia", + "PROGRAM_AREA": "GCD", + "PROGRAM_JURISDICTION_OID": 1300500009, + "REPORTING_FACILITY_DETAIL": "ORG10000001GA01
CHOA - Scottish Rite
1001 Johnson Ferry Rd NE
Atlanta, Georgia 30034
Dekalb County
404-785-5252
", + "REPORTING_FACILITY_KEY": 3.0, + "REPORTING_FACILITY_QEC": "2", + "REPORTING_FACILITY_UID": 10003007.0, + "RPT_PRV_KEY": 1.0, + "RPT_SRC_CD_DESC": "Hospital", + "TRANSMISSION_MODE": "Airborne" + } + ] +} diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/query.sql b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/query.sql new file mode 100644 index 000000000..f93899690 --- /dev/null +++ b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/query.sql @@ -0,0 +1,156 @@ +-- dbo.CONFIRMATION_METHOD_GROUP | operations: insert +-- Query: 0 +-- Step: 1 +-- Logical comparison marked this identity as not comparison-safe. +SELECT + [CONFIRMATION_DT] +FROM [RDB_MODERN].[dbo].[CONFIRMATION_METHOD_GROUP] +WHERE [INVESTIGATION_KEY] = (SELECT INVESTIGATION_KEY FROM RDB_MODERN.dbo.INVESTIGATION WHERE INV_LOCAL_ID = N'CAS10000010031GA01') +; +-- dbo.DM_INV_GENERIC_V2 | operations: insert +-- Query: 2 +-- Step: 1 +SELECT + [BINATIONAL_RPTNG_CRIT], + [CASE_RPT_MMWR_WK], + [CASE_RPT_MMWR_YR], + [CITY_OF_EXP_1], + [CITY_OF_EXP_2], + [CITY_OF_EXP_3], + [CITY_OF_EXP_ALL], + [CNTRY_OF_EXP_1], + [CNTRY_OF_EXP_2], + [CNTRY_OF_EXP_3], + [CNTRY_OF_EXP_ALL], + [CNTRY_USUAL_RESID], + [CNTY_OF_EXP_1], + [CNTY_OF_EXP_2], + [CNTY_OF_EXP_3], + [CNTY_OF_EXP_ALL], + [CONFIRMATION_DT], + [CONFIRMATION_METHOD], + [CONTACT_INV_COMMENTS], + [CONTACT_INV_PRIORITY], + [CONTACT_INV_STATUS], + [CTT_INFECTIOUS_FRM_DT], + [CTT_INFECTIOUS_TO_DT], + [DAYCARE_ASSOC_IND], + [DETECT_METH_DESC_TXT], + [DIAGNOSIS_DT], + [DIE_FRM_ILLNESS_IND], + [DISEASE], + [DISEASE_CD], + [DISEASE_IMPORTED_IND], + [DueDate], + [EARLIEST_RPT_TO_CNTY_DT], + [EARLIEST_RPT_TO_ST_DT], + [EARLIEST_SPECIMEN_COLLECT_DATE], + [EXPRSSN], + [FIRST_RPT_TO_PHD_DT], + [FOOD_HANDLR_IND], + [HSPTLIZD_IND], + [HSPTL_ADMISSION_DT], + [HSPTL_DISCHARGE_DT], + [HSPTL_DURATION_DAYS], + [HSP_DETAIL], + [HSP_KEY], + [HSP_QEC], + [HSP_UID], + [ILLNESS_DURATION], + [ILLNESS_DURATION_UNIT], + [ILLNESS_END_DT], + [ILLNESS_ONSET_DT], + [IMMEDIATE_NND_DESC], + [IMM_NTNL_NTFBL_CNDTN], + [IMPORT_FRM_CITY], + [IMPORT_FRM_CNTRY], + [IMPORT_FRM_CNTY], + [IMPORT_FRM_STATE], + [INNC_NOTIFICATION_DT], + [INVESTIGATION_CREATED_BY], + [INVESTIGATION_CREATE_DATE], + [INVESTIGATION_LAST_UPDTD_BY], + [INVESTIGATION_LAST_UPDTD_DATE], + [INVESTIGATION_STATUS], + [INV_ASSIGNED_DT], + [INV_CASE_STATUS], + [INV_COMMENTS], + [INV_DEATH_DT], + [INV_LOCAL_ID], + [INV_RPT_DT], + [INV_SHARE_IND], + [INV_START_DT], + [INV_STATE_CASE_ID], + [JURISDICTION_CD], + [JURISDICTION_NM], + [LABORATORY_INFORMATION], + [LEGACY_CASE_ID], + [NOTIFICATION_LAST_UPDATED_DATE], + [NOTIFICATION_LOCAL_ID], + [NOTIFICATION_STATUS], + [NOTIF_COMMENT], + [ORGANIZATION_UID], + [OUTBREAK_IND], + [OUTBREAK_NAME], + [PATIENT_AGE_AT_ONSET], + [PATIENT_AGE_REPORTED], + [PATIENT_AGE_RPTD_UNIT], + [PATIENT_BIRTH_COUNTRY], + [PATIENT_CITY], + [PATIENT_COUNTRY], + [PATIENT_COUNTY], + [PATIENT_COUNTY_CODE], + [PATIENT_CURRENT_SEX], + [PATIENT_DECEASED_DT], + [PATIENT_DECEASED_IND], + [PATIENT_DOB], + [PATIENT_EMAIL], + [PATIENT_ETHNICITY], + [PATIENT_FIRST_NAME], + [PATIENT_GEN_COMMENTS], + [PATIENT_LAST_NAME], + [PATIENT_LOCAL_ID], + [PATIENT_MARITAL_STS], + [PATIENT_MIDDLE_NAME], + [PATIENT_NAME_SUFFIX], + [PATIENT_ONST_AGE_UNIT], + [PATIENT_PHONE_EXT_WORK], + [PATIENT_PHONE_WORK], + [PATIENT_PREGNANT_IND], + [PATIENT_RACE_CALC], + [PATIENT_STATE], + [PATIENT_STREET_ADDR_1], + [PATIENT_STREET_ADDR_2], + [PATIENT_TEL_CELL], + [PATIENT_TEL_HOME], + [PATIENT_ZIP], + [PHC_INV_DETAIL], + [PHC_INV_KEY], + [PHC_INV_QEC], + [PHC_INV_UID], + [PHYS_DETAIL], + [PHYS_KEY], + [PHYS_QEC], + [PHYS_UID], + [PROGRAM_AREA], + [PROGRAM_JURISDICTION_OID], + [PROVIDER_LOCAL_ID], + [PROVIDER_UID], + [REPORTING_FACILITY_DETAIL], + [REPORTING_FACILITY_KEY], + [REPORTING_FACILITY_QEC], + [REPORTING_FACILITY_UID], + [RPTNG_CNTY], + [RPT_PRV_DETAIL], + [RPT_PRV_KEY], + [RPT_PRV_QEC], + [RPT_PRV_UID], + [RPT_SRC_CD_DESC], + [ST_OR_PROV_OF_EXP_1], + [ST_OR_PROV_OF_EXP_2], + [ST_OR_PROV_OF_EXP_3], + [ST_OR_PROV_OF_EXP_ALL], + [TRANSMISSION_MODE] +FROM [RDB_MODERN].[dbo].[DM_INV_GENERIC_V2] +WHERE [INV_LOCAL_ID] = N'CAS10000010031GA01' +; \ No newline at end of file diff --git a/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/setup.sql b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/setup.sql new file mode 100644 index 000000000..a3aaab7ba --- /dev/null +++ b/reporting-pipeline-service/src/test/resources/testData/functional/casesBmirdGeneric/030-createGenericCaseInvestigation/setup.sql @@ -0,0 +1,115 @@ +USE [NBS_ODSE]; +DECLARE @superuser_id bigint = 10009282; +DECLARE @elruser_id bigint = 10000015; + +-- Adjust the UID declarations below manually so they remain unique across other tests. +DECLARE @dbo_Entity_entity_uid bigint = 1000001000; +DECLARE @dbo_Postal_locator_postal_locator_uid bigint = 1000001002; +DECLARE @dbo_Tele_locator_tele_locator_uid bigint = 1000001004; +DECLARE @dbo_Tele_locator_tele_locator_uid_2 bigint = 1000001005; +DECLARE @dbo_Tele_locator_tele_locator_uid_3 bigint = 1000001006; +DECLARE @dbo_Tele_locator_tele_locator_uid_4 bigint = 1000001007; +DECLARE @dbo_Act_act_uid bigint = 10000010031; +DECLARE @dbo_Person_local_id nvarchar(40) = N'PSN' + CONVERT(nvarchar(20), ABS(CONVERT(bigint, @dbo_Entity_entity_uid))) + N'GA01'; +DECLARE @dbo_Public_health_case_local_id nvarchar(40) = N'CAS' + CONVERT(nvarchar(20), ABS(CONVERT(bigint, @dbo_Act_act_uid))) + N'GA01'; +DECLARE @dbo_NBS_act_entity_nbs_act_entity_uid bigint; +DECLARE @dbo_NBS_act_entity_nbs_act_entity_uid_output TABLE ([value] bigint); +DECLARE @dbo_NBS_act_entity_nbs_act_entity_uid_2 bigint; +DECLARE @dbo_NBS_act_entity_nbs_act_entity_uid_2_output TABLE ([value] bigint); +DECLARE @dbo_NBS_act_entity_nbs_act_entity_uid_3 bigint; +DECLARE @dbo_NBS_act_entity_nbs_act_entity_uid_3_output TABLE ([value] bigint); + +-- Alter EPI columns that are not configured to the correct size on RDB_MODERN.dbo.D_INVESTIGATION_REPEAT +ALTER TABLE [RDB_MODERN].[dbo].[D_INVESTIGATION_REPEAT] + ALTER COLUMN [EPI_CITY_OF_EXP] varchar(2000) NULL; +ALTER TABLE [RDB_MODERN].[dbo].[D_INVESTIGATION_REPEAT] + ALTER COLUMN [EPI_CNTRY_OF_EXP] varchar(2000) NULL; +ALTER TABLE [RDB_MODERN].[dbo].[D_INVESTIGATION_REPEAT] + ALTER COLUMN [EPI_CNTY_OF_EXP] varchar(2000) NULL; +ALTER TABLE [RDB_MODERN].[dbo].[D_INVESTIGATION_REPEAT] + ALTER COLUMN [EPI_ST_OR_PROV_OF_EXP] varchar(2000) NULL; + +-- STEP 1: Created a generic case investigation for existing patient +-- dbo.Postal_locator +-- step: 3 +INSERT INTO [dbo].[Postal_locator] ([postal_locator_uid], [add_time], [add_user_id], [city_desc_txt], [cntry_cd], [cnty_cd], [record_status_cd], [record_status_time], [state_cd], [street_addr1], [zip_cd]) VALUES (@dbo_Postal_locator_postal_locator_uid, N'2026-06-08T17:11:04.810', @superuser_id, N'Atlanta', N'840', N'13135', N'ACTIVE', N'2026-06-08T17:11:04.810', N'13', N'123 Main St.', N'30024'); +-- dbo.Entity_locator_participation +-- step: 3 +INSERT INTO [dbo].[Entity_locator_participation] ([entity_uid], [locator_uid], [cd], [class_cd], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [use_cd], [version_ctrl_nbr], [as_of_date]) VALUES (@dbo_Entity_entity_uid, @dbo_Postal_locator_postal_locator_uid, N'H', N'PST', N'2026-06-08T17:11:04.960', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.960', N'A', N'2026-06-08T17:11:04.960', N'H', 1, N'2026-06-08T00:00:00'); +-- dbo.Tele_locator +-- step: 3 +INSERT INTO [dbo].[Tele_locator] ([tele_locator_uid], [add_time], [add_user_id], [extension_txt], [phone_nbr_txt], [record_status_cd]) VALUES (@dbo_Tele_locator_tele_locator_uid, N'2026-06-08T17:11:04.810', @superuser_id, N'', N'456-232-3222', N'ACTIVE'); +-- dbo.Entity_locator_participation +-- step: 3 +INSERT INTO [dbo].[Entity_locator_participation] ([entity_uid], [locator_uid], [cd], [class_cd], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [use_cd], [version_ctrl_nbr], [as_of_date]) VALUES (@dbo_Entity_entity_uid, @dbo_Tele_locator_tele_locator_uid, N'PH', N'TELE', N'2026-06-08T17:11:04.960', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.960', N'A', N'2026-06-08T17:11:04.960', N'H', 1, N'2026-06-08T00:00:00'); +-- dbo.Tele_locator +-- step: 3 +INSERT INTO [dbo].[Tele_locator] ([tele_locator_uid], [add_time], [add_user_id], [extension_txt], [phone_nbr_txt], [record_status_cd]) VALUES (@dbo_Tele_locator_tele_locator_uid_2, N'2026-06-08T17:11:04.810', @superuser_id, N'', N'232-322-2222', N'ACTIVE'); +-- dbo.Entity_locator_participation +-- step: 3 +INSERT INTO [dbo].[Entity_locator_participation] ([entity_uid], [locator_uid], [cd], [class_cd], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [use_cd], [version_ctrl_nbr], [as_of_date]) VALUES (@dbo_Entity_entity_uid, @dbo_Tele_locator_tele_locator_uid_2, N'PH', N'TELE', N'2026-06-08T17:11:04.960', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.960', N'A', N'2026-06-08T17:11:04.960', N'WP', 1, N'2026-06-08T00:00:00'); +-- dbo.Tele_locator +-- step: 3 +INSERT INTO [dbo].[Tele_locator] ([tele_locator_uid], [add_time], [add_user_id], [email_address], [record_status_cd]) VALUES (@dbo_Tele_locator_tele_locator_uid_3, N'2026-06-08T17:11:04.810', @superuser_id, N'fdsfs@dsds.com', N'ACTIVE'); +-- dbo.Entity_locator_participation +-- step: 3 +INSERT INTO [dbo].[Entity_locator_participation] ([entity_uid], [locator_uid], [cd], [class_cd], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [use_cd], [version_ctrl_nbr], [as_of_date]) VALUES (@dbo_Entity_entity_uid, @dbo_Tele_locator_tele_locator_uid_3, N'NET', N'TELE', N'2026-06-08T17:11:04.960', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.960', N'A', N'2026-06-08T17:11:04.960', N'H', 1, N'2026-06-08T00:00:00'); +-- dbo.Tele_locator +-- step: 3 +INSERT INTO [dbo].[Tele_locator] ([tele_locator_uid], [add_time], [add_user_id], [phone_nbr_txt], [record_status_cd]) VALUES (@dbo_Tele_locator_tele_locator_uid_4, N'2026-06-08T17:11:04.810', @superuser_id, N'232-322-2222', N'ACTIVE'); +-- dbo.Entity_locator_participation +-- step: 3 +INSERT INTO [dbo].[Entity_locator_participation] ([entity_uid], [locator_uid], [cd], [class_cd], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [use_cd], [version_ctrl_nbr], [as_of_date]) VALUES (@dbo_Entity_entity_uid, @dbo_Tele_locator_tele_locator_uid_4, N'CP', N'TELE', N'2026-06-08T17:11:04.960', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.960', N'A', N'2026-06-08T17:11:04.960', N'MC', 1, N'2026-06-08T00:00:00'); +-- dbo.Act +-- step: 3 +INSERT INTO [dbo].[Act] ([act_uid], [class_cd], [mood_cd]) VALUES (@dbo_Act_act_uid, N'CASE', N'EVN'); +-- dbo.Public_health_case +-- step: 3 +INSERT INTO [dbo].[Public_health_case] ([public_health_case_uid], [activity_from_time], [add_time], [add_user_id], [case_class_cd], [case_type_cd], [cd], [cd_desc_txt], [detection_method_cd], [disease_imported_cd], [effective_duration_amt], [effective_duration_unit_cd], [group_case_cnt], [investigation_status_cd], [jurisdiction_cd], [last_chg_time], [last_chg_user_id], [local_id], [mmwr_week], [mmwr_year], [outbreak_ind], [outbreak_name], [outcome_cd], [prog_area_cd], [record_status_cd], [record_status_time], [rpt_source_cd], [status_cd], [transmission_mode_cd], [transmission_mode_desc_txt], [txt], [program_jurisdiction_oid], [shared_ind], [version_ctrl_nbr], [hospitalized_ind_cd], [hospitalized_admin_time], [hospitalized_discharge_time], [hospitalized_duration_amt], [pregnant_ind_cd], [day_care_ind_cd], [food_handler_ind_cd], [imported_country_cd], [imported_state_cd], [imported_city_desc_txt], [imported_county_cd], [priority_cd], [contact_inv_txt], [contact_inv_status_cd]) VALUES (@dbo_Act_act_uid, N'2026-06-08T00:00:00', N'2026-06-08T17:11:05.093', @superuser_id, N'C', N'I', N'50225', N'Acanthamoeba Disease (Excluding Keratitis)', N'S', N'', N'', N'', 1, N'O', N'130005', N'2026-06-08T17:11:05.093', @superuser_id, @dbo_Public_health_case_local_id, N'23', N'2026', N'', N'', N'', N'GCD', N'OPEN', N'2026-06-08T17:11:05.093', N'HO', N'A', N'A', N'A', N'', 1300500009, N'T', 1, N'Y', N'2026-06-07T00:00:00', N'2026-06-08T00:00:00', 1, N'', N'', N'', N'', N'', N'', N'', N'', N'', N''); +-- dbo.Confirmation_method +-- step: 3 +INSERT INTO [dbo].[Confirmation_method] ([public_health_case_uid], [confirmation_method_cd], [confirmation_method_time]) VALUES (@dbo_Act_act_uid, N'AS', N'2026-06-08T00:00:00'); +-- dbo.Act_id +-- step: 3 +INSERT INTO [dbo].[Act_id] ([act_uid], [act_id_seq], [root_extension_txt], [status_cd], [status_time], [type_cd]) VALUES (@dbo_Act_act_uid, 1, N'', N'A', N'2026-06-08T17:11:05.120', N'STATE'); +-- step: 3 +INSERT INTO [dbo].[Act_id] ([act_uid], [act_id_seq], [root_extension_txt], [status_cd], [status_time], [type_cd]) VALUES (@dbo_Act_act_uid, 2, N'', N'A', N'2026-06-08T17:11:05.123', N'CITY'); +-- step: 3 +INSERT INTO [dbo].[Act_id] ([act_uid], [act_id_seq], [root_extension_txt], [status_cd], [status_time], [type_cd]) VALUES (@dbo_Act_act_uid, 3, N'', N'A', N'2026-06-08T17:11:05.123', N'LEGACY'); +-- dbo.Participation +-- step: 3 +INSERT INTO [dbo].[Participation] ([subject_entity_uid], [act_uid], [type_cd], [act_class_cd], [add_time], [add_user_id], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [subject_class_cd], [type_desc_txt]) VALUES (@dbo_Entity_entity_uid, @dbo_Act_act_uid, N'SubjOfPHC', N'CASE', N'2026-06-08T17:11:04.810', @superuser_id, N'2026-06-08T17:11:04.810', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.810', N'A', N'2026-06-08T17:11:04.810', N'PSN', N'Subject Of Public Health Case'); +-- step: 3 +INSERT INTO [dbo].[Participation] ([subject_entity_uid], [act_uid], [type_cd], [act_class_cd], [add_time], [add_user_id], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [subject_class_cd], [type_desc_txt]) VALUES (10003007, @dbo_Act_act_uid, N'HospOfADT', N'CASE', N'2026-06-08T17:11:04.810', @superuser_id, N'2026-06-08T17:11:04.810', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.810', N'A', N'2026-06-08T17:11:04.810', N'ORG', N'Hospital Of ADT'); +-- step: 3 +INSERT INTO [dbo].[Participation] ([subject_entity_uid], [act_uid], [type_cd], [act_class_cd], [add_time], [add_user_id], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [status_cd], [status_time], [subject_class_cd], [type_desc_txt]) VALUES (10003007, @dbo_Act_act_uid, N'OrgAsReporterOfPHC', N'CASE', N'2026-06-08T17:11:04.810', @superuser_id, N'2026-06-08T17:11:04.810', @superuser_id, N'ACTIVE', N'2026-06-08T17:11:04.810', N'A', N'2026-06-08T17:11:04.810', N'ORG', N'Organization As Reporter Of PHC'); +-- dbo.NBS_act_entity +-- step: 3 +INSERT INTO [dbo].[NBS_act_entity] ([act_uid], [add_time], [add_user_id], [entity_uid], [entity_version_ctrl_nbr], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [type_cd]) OUTPUT INSERTED.[nbs_act_entity_uid] INTO @dbo_NBS_act_entity_nbs_act_entity_uid_output ([value]) VALUES (@dbo_Act_act_uid, N'2026-06-08T17:11:05.093', @superuser_id, @dbo_Entity_entity_uid, 1, N'2026-06-08T17:11:05.093', @superuser_id, N'OPEN', N'2026-06-08T17:11:05.093', N'SubjOfPHC'); +SELECT TOP 1 @dbo_NBS_act_entity_nbs_act_entity_uid = [value] FROM @dbo_NBS_act_entity_nbs_act_entity_uid_output; +-- step: 3 +INSERT INTO [dbo].[NBS_act_entity] ([act_uid], [add_time], [add_user_id], [entity_uid], [entity_version_ctrl_nbr], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [type_cd]) OUTPUT INSERTED.[nbs_act_entity_uid] INTO @dbo_NBS_act_entity_nbs_act_entity_uid_2_output ([value]) VALUES (@dbo_Act_act_uid, N'2026-06-08T17:11:05.093', @superuser_id, 10003007, 1, N'2026-06-08T17:11:05.093', @superuser_id, N'OPEN', N'2026-06-08T17:11:05.093', N'HospOfADT'); +SELECT TOP 1 @dbo_NBS_act_entity_nbs_act_entity_uid_2 = [value] FROM @dbo_NBS_act_entity_nbs_act_entity_uid_2_output; +-- step: 3 +INSERT INTO [dbo].[NBS_act_entity] ([act_uid], [add_time], [add_user_id], [entity_uid], [entity_version_ctrl_nbr], [last_chg_time], [last_chg_user_id], [record_status_cd], [record_status_time], [type_cd]) OUTPUT INSERTED.[nbs_act_entity_uid] INTO @dbo_NBS_act_entity_nbs_act_entity_uid_3_output ([value]) VALUES (@dbo_Act_act_uid, N'2026-06-08T17:11:05.093', @superuser_id, 10003007, 1, N'2026-06-08T17:11:05.093', @superuser_id, N'OPEN', N'2026-06-08T17:11:05.093', N'OrgAsReporterOfPHC'); +SELECT TOP 1 @dbo_NBS_act_entity_nbs_act_entity_uid_3 = [value] FROM @dbo_NBS_act_entity_nbs_act_entity_uid_3_output; +-- dbo.Person +-- step: 3 +UPDATE [dbo].[Person] SET [last_chg_time] = N'2026-06-08T17:11:04.940', [record_status_time] = N'2026-06-08T17:11:04.940', [status_time] = N'2026-06-08T17:11:04.940', [version_ctrl_nbr] = ISNULL([version_ctrl_nbr], 0) + 1 WHERE [person_uid] = 10000001; +-- dbo.Entity_locator_participation +-- step: 3 +UPDATE [dbo].[Entity_locator_participation] SET [last_chg_time] = N'2026-06-08T17:11:04.940', [record_status_time] = N'2026-06-08T17:11:04.940', [status_time] = N'2026-06-08T17:11:04.940' WHERE [entity_uid] = 10000001 AND [locator_uid] = 10000003; +-- step: 3 +UPDATE [dbo].[Entity_locator_participation] SET [last_chg_time] = N'2026-06-08T17:11:04.940', [record_status_time] = N'2026-06-08T17:11:04.940', [status_time] = N'2026-06-08T17:11:04.940' WHERE [entity_uid] = 10000001 AND [locator_uid] = 10000002; +-- step: 3 +UPDATE [dbo].[Entity_locator_participation] SET [last_chg_time] = N'2026-06-08T17:11:04.940', [record_status_time] = N'2026-06-08T17:11:04.940', [status_time] = N'2026-06-08T17:11:04.940' WHERE [entity_uid] = 10000001 AND [locator_uid] = 10000006; +-- step: 3 +UPDATE [dbo].[Entity_locator_participation] SET [last_chg_time] = N'2026-06-08T17:11:04.940', [record_status_time] = N'2026-06-08T17:11:04.940', [status_time] = N'2026-06-08T17:11:04.940' WHERE [entity_uid] = 10000001 AND [locator_uid] = 10000004; +-- step: 3 +UPDATE [dbo].[Entity_locator_participation] SET [last_chg_time] = N'2026-06-08T17:11:04.940', [record_status_time] = N'2026-06-08T17:11:04.940', [status_time] = N'2026-06-08T17:11:04.940' WHERE [entity_uid] = 10000001 AND [locator_uid] = 10000005; +-- dbo.PublicHealthCaseFact +-- step: 3 +INSERT INTO [dbo].[PublicHealthCaseFact] ([public_health_case_uid], [age_reported_unit_cd], [age_reported], [birth_time], [birth_time_calc], [case_class_cd], [case_type_cd], [city_desc_txt], [confirmation_method_cd], [confirmation_method_time], [county], [cntry_cd], [cnty_cd], [curr_sex_cd], [deceased_ind_cd], [detection_method_cd], [detection_method_desc_txt], [ELP_class_cd], [ethnic_group_ind], [ethnic_group_ind_desc], [event_date], [event_type], [group_case_cnt], [investigation_status_cd], [jurisdiction_cd], [marital_status_cd], [marital_status_desc_txt], [mart_record_creation_time], [mmwr_week], [mmwr_year], [organizationName], [PAR_type_cd], [postal_locator_uid], [person_cd], [person_uid], [PHC_add_time], [PHC_code], [PHC_code_desc], [PHC_code_short_desc], [prog_area_cd], [PST_record_status_time], [PST_record_status_cd], [race_concatenated_txt], [race_concatenated_desc_txt], [record_status_cd], [rpt_source_cd], [rpt_source_desc_txt], [shared_ind], [state], [state_cd], [status_cd], [street_addr1], [ELP_use_cd], [zip_cd], [patientName], [jurisdiction], [investigationstartdate], [program_jurisdiction_oid], [report_date], [person_parent_uid], [person_local_id], [sub_addr_as_of_date], [LOCAL_ID], [age_reported_unit_desc_txt], [case_class_desc_txt], [cntry_desc_txt], [curr_sex_desc_txt], [investigation_status_desc_txt], [prog_area_desc_txt], [confirmation_method_desc_txt], [LASTUPDATE], [HSPTL_ADMISSION_DT], [HSPTL_DISCHARGE_DT], [hospitalized_ind]) VALUES (@dbo_Act_act_uid, N'Y', 36, N'1990-01-01T00:00:00', N'1990-01-01T00:00:00', N'C', N'I', N'Atlanta', N'AS', N'2026-06-08T00:00:00', N'Gwinnett County', N'840', N'13135', N'M', N'N', N'S', N'Patient self-referral', N'PST', N'2186-5', N'Not Hispanic or Latino', N'2026-06-08T17:11:05.093', N'P', 1.0, N'O', N'130005', N'M', N'Married', N'2026-06-08T17:11:14.127', 23, 2026, N'CHOA - Scottish Rite', N'SubjOfPHC', @dbo_Postal_locator_postal_locator_uid, N'PAT', @dbo_Entity_entity_uid, N'2026-06-08T17:11:05.093', N'50225', N'Acanthamoeba Disease (Excluding Keratitis)', N'Acanthamoeba Disease (Excluding Keratitis)', N'GCD', N'2026-06-08T17:11:04.810', N'ACTIVE', N'2028-9', N'Asian', N'OPEN', N'HO', N'Hospital', N'T', N'Georgia', N'13', N'A', N'123 Main St.', N'H', N'30024', N'Singh, Surma', N'Dekalb County', N'2026-06-08T00:00:00', 1300500009, N'2026-06-08T17:11:05.093', 10000001, @dbo_Person_local_id, N'2026-06-08T00:00:00', @dbo_Public_health_case_local_id, N'Years', N'Confirmed', N'UNITED STATES', N'Male', N'Open', N'GCD', N' Active Surveillance', N'2026-06-08T17:11:05.093', N'2026-06-07T00:00:00', N'2026-06-08T00:00:00', N'Y'); +-- dbo.SubjectRaceInfo +-- step: 3 +INSERT INTO [dbo].[SubjectRaceInfo] ([morbReport_uid], [public_health_case_uid], [race_cd], [race_category_cd]) VALUES (0, @dbo_Act_act_uid, N'2028-9', N'2028-9'); diff --git a/reporting-pipeline-service/src/test/resources/testData/unit/organizationEvent/expected.json b/reporting-pipeline-service/src/test/resources/testData/unit/organizationEvent/expected.json index bc6a6e89d..bde815bab 100644 --- a/reporting-pipeline-service/src/test/resources/testData/unit/organizationEvent/expected.json +++ b/reporting-pipeline-service/src/test/resources/testData/unit/organizationEvent/expected.json @@ -21,7 +21,7 @@ "last_chg_time": "2026-04-03 14:43:38", "organization_name": "[{\"on_org_uid\":20001000,\"organization_name\":\"Wellstar Cobb Medical Center\"}]", "organization_address": "[{\"addr_elp_cd\":\"O\",\"addr_elp_use_cd\":\"WP\",\"addr_pl_uid\":20001002,\"street_addr1\":\"3950 Austell Rd SW\",\"street_addr2\":\"\",\"city\":\"Austell\",\"zip\":\"30106\",\"cnty_cd\":\"13067\",\"state\":\"13\",\"cntry_cd\":\"840\",\"state_desc\":\"Georgia\",\"county\":\"Cobb County\",\"within_city_limits_ind\":null,\"country\":\"United States\",\"address_comments\":\"Emergency room address\",\"county_desc\":\"Cobb County\"}]", - "organization_telephone": "[{\"ph_tl_uid\":20001001,\"ph_elp_cd\":\"PH\",\"ph_elp_use_cd\":\"WP\",\"telephone_nbr\":\"770-732-4000\",\"extension_txt\":\"\",\"email_address\":\"\",\"phone_comments\":\"\"}]", + "organization_telephone": "[{\"ph_tl_uid\":20001001,\"ph_elp_cd\":\"PH\",\"ph_elp_use_cd\":\"WP\",\"telephone_nbr\":\"770-732-4000\",\"extension_txt\":null,\"email_address\":null,\"phone_comments\":null}]", "organization_fax": null, "organization_entity_id": "[{\"entity_uid\":20001000,\"type_cd\":\"FI\",\"record_status_cd\":\"ACTIVE\",\"root_extension_txt\":\"110035\",\"entity_id_seq\":1,\"assigning_authority_cd\":\"CMS\",\"facility_id_auth\":\"CMS Provider\"},{\"entity_uid\":20001000,\"type_cd\":\"QEC\",\"record_status_cd\":\"ACTIVE\",\"root_extension_txt\":\"99\",\"entity_id_seq\":2,\"assigning_authority_cd\":null,\"facility_id_auth\":null}]" }