Skip to content

Commit

Permalink
CNDE-1802: RTR remove redundant fields from the Investigation (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
sveselev authored Oct 29, 2024
1 parent 93f2ac0 commit 0ea1b11
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,6 @@ public class Investigation {
@Column(name = "program_area_description")
private String programAreaDescription;

@Column(name = "notification_local_id")
private String notificationLocalId;

@Column(name = "notification_add_time")
private String notificationAddTime;

@Column(name = "notification_record_status_cd")
private String notificationRecordStatusCd;

@Column(name = "notification_last_chg_time")
private String notificationLastChgTime;

@Column(name = "case_management_uid")
private Long caseManagementUid;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public class InvestigationReporting {
private String coinfectionId;
private String contactInvTxt;
private String programAreaDescription;
private String notificationLocalId;
private String notificationAddTime;
private String notificationRecordStatusCd;
private String notificationLastChgTime;
private Long caseManagementUid;
private Long nacPageCaseUid;
private String nacLastChgTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,181 +9,207 @@ databaseChangeLog:
- changeSet:
id: 1
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 001-fn_get_value_by_cd_ques-001.sql
splitStatements: false
- changeSet:
id: 2
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 002-fn_get_value_by_cvg-001.sql
splitStatements: false
- changeSet:
id: 3
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 003-fn-get_user_name-001.sql
splitStatements: false
- changeSet:
id: 4
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 004-fn_get_value_by_cd_codeset-001.sql
splitStatements: false
- changeSet:
id: 5
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 005-sp_organization_event-001.sql
splitStatements: false
- changeSet:
id: 6
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 006-sp_provider_event-001.sql
splitStatements: false
- changeSet:
id: 7
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 007-sp_patient_race_event-001.sql
splitStatements: false
- changeSet:
id: 8
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 008-sp_patient_event-001.sql
splitStatements: false
- changeSet:
id: 9
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 009-sp_observation_event-001.sql
splitStatements: false
- changeSet:
id: 10
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 010-sp_investigation_event-001.sql
splitStatements: false
- changeSet:
id: 11
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 011-sp_ldf_provider_event-001.sql
splitStatements: false
- changeSet:
id: 12
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 012-sp_ldf_organization_event-001.sql
splitStatements: false
- changeSet:
id: 13
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 013-sp_ldf_patient_event-001.sql
splitStatements: false
- changeSet:
id: 14
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 014-sp_ldf_observation_event-001.sql
splitStatements: false
- changeSet:
id: 15
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 015-sp_ldf_phc_event-001.sql
splitStatements: false
- changeSet:
id: 16
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 016-sp_ldf_intervention_event-001.sql
splitStatements: false
- changeSet:
id: 17
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 017-sp_ldf_data_event-001.sql
splitStatements: false
- changeSet:
id: 18
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 018-sp_public_health_case_fact_datamart_event-001.sql
splitStatements: false
- changeSet:
id: 19
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 001-v_inv_form_code_data-001.sql
splitStatements: false
- changeSet:
id: 20
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 001-fn_get_record_status-001.sql
splitStatements: false
- changeSet:
id: 21
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 020-sp_notification_event-001.sql
splitStatements: false
- changeSet:
id: 22
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 020-sp_notification_event-002.sql
splitStatements: false
- changeSet:
id: 23
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 010-sp_investigation_event-002.sql
splitStatements: false
- changeSet:
id: 24
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 009-sp_observation_event-002.sql
splitStatements: false
- changeSet:
id: 25
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 009-sp_observation_event-003.sql
splitStatements: false
- changeSet:
id: 26
author: liquibase
runOnChange: true
changes:
- sqlFile:
path: 008-sp_patient_event-002.sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,10 @@ databaseChangeLog:
- sqlFile:
path: 020-sp_lab101_datamart_postprocessing-001.sql
splitStatements: false
- changeSet:
id: 59
author: liquibase
changes:
- sqlFile:
path: 007-create_nrt_investigation-002.sql
splitStatements: false
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BEGIN
results.jurisdiction_cd,
results.pregnant_ind_cd,
results.pregnant_ind,
results.local_id local_id,
results.local_id,
results.rpt_form_cmplt_time,
results.activity_to_time,
results.activity_from_time,
Expand Down Expand Up @@ -123,11 +123,6 @@ BEGIN
results.coinfection_id,
results.contact_inv_txt,
pac.prog_area_desc_txt program_area_description,
notification.notification_uid,
notification.notification_local_id,
notification.notification_add_time,
notification.notification_record_status_cd,
notification.notification_last_chg_time,
cm.case_management_uid,
investigation_act_entity.nac_page_case_uid,
investigation_act_entity.nac_last_chg_time,
Expand Down Expand Up @@ -633,19 +628,6 @@ BEGIN
WHERE
phc.public_health_case_uid in (SELECT value FROM STRING_SPLIT(@phc_id_list
, ','))) AS results
LEFT JOIN
(SELECT DISTINCT act_rel.target_act_uid,
notification.notification_uid,
notification.local_id notification_local_id,
notification.add_time notification_add_time,
notification.record_status_cd notification_record_status_cd,
notification.last_chg_time notification_last_chg_time
from act_relationship act_rel WITH (NOLOCK)
INNER JOIN notification WITH (NOLOCK) on act_rel.source_act_uid = notification.notification_uid AND act_rel.source_class_cd = 'NOTF'
where act_rel.target_class_cd = 'CASE'
group by target_act_uid,notification_uid, local_id, notification.add_time, notification.record_status_cd,notification.last_chg_time
) as notification
on notification.target_act_uid = results.public_health_case_uid
LEFT JOIN nbs_srte.dbo.jurisdiction_code jc WITH (NOLOCK) ON results.jurisdiction_cd = jc.code
LEFT JOIN act WITH (NOLOCK) ON act.act_uid = results.public_health_case_uid
LEFT JOIN nbs_srte.dbo.program_area_code pac WITH (NOLOCK) on results.prog_area_cd = pac.prog_area_cd
Expand Down Expand Up @@ -700,7 +682,7 @@ BEGIN

IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION;

DECLARE @ErrorMessage NVARCHAR(4000) = ERROR_MESSAGE();
DECLARE @ErrorMessage NVARCHAR(4000) = ERROR_MESSAGE();
INSERT INTO [rdb_modern].[dbo].[job_flow_log]
( batch_id
, [Dataflow_Name]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
IF EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_investigation' and xtype = 'U')
BEGIN

IF EXISTS(SELECT 1 FROM sys.columns WHERE name = N'notification_local_id' AND Object_ID = Object_ID(N'nrt_investigation'))
BEGIN
ALTER TABLE dbo.nrt_investigation DROP COLUMN notification_local_id;
END;

IF EXISTS(SELECT 1 FROM sys.columns WHERE name = N'notification_add_time' AND Object_ID = Object_ID(N'nrt_investigation'))
BEGIN
ALTER TABLE dbo.nrt_investigation DROP COLUMN notification_add_time;
END;

IF EXISTS(SELECT 1 FROM sys.columns WHERE name = N'notification_record_status_cd' AND Object_ID = Object_ID(N'nrt_investigation'))
BEGIN
ALTER TABLE dbo.nrt_investigation DROP COLUMN notification_record_status_cd;
END;

IF EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'notification_last_chg_time' AND Object_ID = Object_ID(N'nrt_investigation'))
BEGIN
ALTER TABLE dbo.nrt_investigation DROP COLUMN notification_last_chg_time;
END;

END;

0 comments on commit 0ea1b11

Please sign in to comment.