diff --git a/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/rdbmodern/dto/NrtObservationDto.java b/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/rdbmodern/dto/NrtObservationDto.java index 0bf3728..4927a41 100644 --- a/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/rdbmodern/dto/NrtObservationDto.java +++ b/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/rdbmodern/dto/NrtObservationDto.java @@ -152,17 +152,17 @@ public class NrtObservationDto { @SerializedName("interpretation_desc_txt") private String interpretationDescTxt; - @SerializedName("report_observation_id") - private Long reportObservationId; + @SerializedName("report_observation_uid") + private Long reportObservationUid; - @SerializedName("followup_observation_id") - private String followupObservationId; + @SerializedName("followup_observation_uid") + private String followupObservationUid; - @SerializedName("report_refr_id") - private Long reportRefrId; + @SerializedName("report_refr_uid") + private Long reportRefrUid; - @SerializedName("report_sprt_id") - private Long reportSprtId; + @SerializedName("report_sprt_uid") + private Long reportSprtUid; @SerializedName("morb_physician_id") private Long morbPhysicianId; @@ -220,4 +220,22 @@ public class NrtObservationDto { @SerializedName("max_datetime") private String maxDatetime; -} + + @SerializedName("transcriptionist_auth_type") + private String transcriptionistAuthType; + + @SerializedName("transcriptionist_id_assign_auth") + private String transcriptionistIdAssignAuth; + + @SerializedName("assistant_interpreter_auth_type") + private String assistantInterpreterAuthType; + + @SerializedName("assistant_interpreter_id_assign_auth") + private String assistantInterpreterIdAssignAuth; + + @SerializedName("accession_number") + private String accessionNumber; + + @SerializedName("morb_hosp_id") + private Long morbHospId; +} \ No newline at end of file diff --git a/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/repository/rdb_modern/model/NrtObservation.java b/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/repository/rdb_modern/model/NrtObservation.java index d5cf0e6..392232f 100644 --- a/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/repository/rdb_modern/model/NrtObservation.java +++ b/nnd-data-poll-service/src/main/java/gov/cdc/nnddatapollservice/repository/rdb_modern/model/NrtObservation.java @@ -1,5 +1,6 @@ package gov.cdc.nnddatapollservice.repository.rdb_modern.model; +import com.google.gson.annotations.SerializedName; import gov.cdc.nnddatapollservice.rdbmodern.dto.NrtObservationDto; import jakarta.persistence.Column; import jakarta.persistence.Entity; @@ -162,17 +163,17 @@ public class NrtObservation { @Column(name = "interpretation_desc_txt", length = 100) private String interpretationDescTxt; - @Column(name = "report_observation_id") - private Long reportObservationId; + @Column(name = "report_observation_uid") + private Long reportObservationUid; - @Column(name = "followup_observation_id", columnDefinition = "nvarchar(max)") - private String followupObservationId; + @Column(name = "followup_observation_uid", columnDefinition = "nvarchar(max)") + private String followupObservationUid; - @Column(name = "report_refr_id") - private Long reportRefrId; + @Column(name = "report_refr_uid") + private Long reportRefrUid; - @Column(name = "report_sprt_id") - private Long reportSprtId; + @Column(name = "report_sprt_uid") + private Long reportSprtUid; @Column(name = "morb_physician_id") private Long morbPhysicianId; @@ -222,9 +223,26 @@ public class NrtObservation { @Column(name = "morb_hosp_reporter_id") private Long morbHospReporterId; - @Column(name = "priority_cd", length = 20, columnDefinition = "varchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS") + @Column(name = "priority_cd", length = 20) private String priorityCd; + @Column(name = "transcriptionist_auth_type") + private String transcriptionistAuthType; + + @Column(name = "transcriptionist_id_assign_auth") + private String transcriptionistIdAssignAuth; + + @Column(name = "assistant_interpreter_auth_type") + private String assistantInterpreterAuthType; + + @Column(name = "assistant_interpreter_id_assign_auth") + private String assistantInterpreterIdAssignAuth; + + @Column(name = "accession_number") + private String accessionNumber; + + @Column(name = "morb_hosp_id") + private Long morbHospId; // @Column(name = "refresh_datetime", columnDefinition = "datetime2(7) GENERATED ALWAYS AS ROW START NOT NULL", updatable = false) // private Timestamp refreshDatetime; @@ -300,9 +318,20 @@ public NrtObservation(NrtObservationDto dto) throws ParseException { this.healthCareId = dto.getHealthCareId(); // Added this field this.morbHospReporterId = dto.getMorbHospReporterId(); // Added this field this.priorityCd = dto.getPriorityCd(); // Added this field + this.transcriptionistAuthType= dto.getTranscriptionistAuthType(); + this.transcriptionistIdAssignAuth= dto.getTranscriptionistIdAssignAuth(); + this.assistantInterpreterAuthType= dto.getAssistantInterpreterAuthType(); + this.assistantInterpreterIdAssignAuth= dto.getAssistantInterpreterIdAssignAuth(); + this.accessionNumber= dto.getAccessionNumber(); + this.morbHospId= dto.getMorbHospId(); + this.reportObservationUid=dto.getReportObservationUid(); + this.followupObservationUid=dto.getFollowupObservationUid(); + this.reportRefrUid=dto.getReportRefrUid(); + this.reportSprtUid=dto.getReportSprtUid(); + this.morbPhysicianId=dto.getMorbPhysicianId(); + this.morbReporterId=dto.getMorbReporterId(); } - private Timestamp parseTimestamp(String dateString) throws ParseException { if (dateString == null || dateString.isEmpty()) { return null; diff --git a/nnd-data-poll-service/src/main/resources/sql/rdb_modern/create_rdb_modern_table.sql b/nnd-data-poll-service/src/main/resources/sql/rdb_modern/create_rdb_modern_table.sql index ae01bfb..93049e8 100644 --- a/nnd-data-poll-service/src/main/resources/sql/rdb_modern/create_rdb_modern_table.sql +++ b/nnd-data-poll-service/src/main/resources/sql/rdb_modern/create_rdb_modern_table.sql @@ -1,79 +1,86 @@ ------------Tables -CREATE TABLE dbo.nrt_observation ( - observation_uid bigint NOT NULL, - class_cd varchar(10) NULL, - mood_cd varchar(10) NULL, - act_uid bigint NULL, - cd_desc_txt varchar(1000) NULL, - record_status_cd varchar(20) NULL, - jurisdiction_cd varchar(20) NULL, - program_jurisdiction_oid bigint NULL, - prog_area_cd varchar(20) NULL, - pregnant_ind_cd varchar(20) NULL, - local_id varchar(50) NULL, - activity_to_time datetime NULL, - effective_from_time datetime NULL, - rpt_to_state_time datetime NULL, - electronic_ind char(1) NULL, - version_ctrl_nbr smallint NOT NULL, - ordering_person_id bigint NULL, - patient_id bigint NULL, - result_observation_uid nvarchar(max) NULL, - author_organization_id bigint NULL, - ordering_organization_id bigint NULL, - performing_organization_id bigint NULL, - material_id bigint NULL, - obs_domain_cd_st_1 varchar(20) NULL, - processing_decision_cd varchar(20) NULL, - cd varchar(50) NULL, - shared_ind char(1) NULL, - add_user_id bigint NULL, - add_user_name varchar(50) NULL, - add_time datetime NULL, - last_chg_user_id bigint NULL, - last_chg_user_name varchar(50) NULL, - last_chg_time datetime NULL, - ctrl_cd_display_form varchar(20) NULL, - status_cd char(1) NULL, - cd_system_cd varchar(50) NULL, - cd_system_desc_txt varchar(100) NULL, - ctrl_cd_user_defined_1 varchar(20) NULL, - alt_cd varchar(50) NULL, - alt_cd_desc_txt varchar(1000) NULL, - alt_cd_system_cd varchar(1000) NULL, - alt_cd_system_desc_txt varchar(100) NULL, - method_cd varchar(2000) NULL, - method_desc_txt varchar(2000) NULL, - target_site_cd varchar(20) NULL, - target_site_desc_txt varchar(100) NULL, - txt varchar(1000) NULL, - interpretation_cd varchar(20) NULL, - interpretation_desc_txt varchar(100) NULL, - report_observation_id bigint NULL, - followup_observation_id nvarchar(MAX) NULL, - report_refr_id bigint NULL, - report_sprt_id bigint NULL, - morb_physician_id bigint NULL, - morb_reporter_id bigint NULL, - transcriptionist_id bigint NULL, - transcriptionist_val varchar(20) NULL, - transcriptionist_first_nm varchar(50) NULL, - transcriptionist_last_nm varchar(50) NULL, - assistant_interpreter_id bigint NULL, - assistant_interpreter_val varchar(20) NULL, - assistant_interpreter_first_nm varchar(50) NULL, - assistant_interpreter_last_nm varchar(50) NULL, - result_interpreter_id bigint NULL, - specimen_collector_id bigint NULL, - copy_to_provider_id bigint NULL, - lab_test_technician_id bigint NULL, - health_care_id bigint NULL, - morb_hosp_reporter_id bigint NULL, - priority_cd varchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, - refresh_datetime datetime2(7) GENERATED ALWAYS AS ROW START NOT NULL, - max_datetime datetime2(7) GENERATED ALWAYS AS ROW END HIDDEN NOT NULL, +CREATE TABLE dbo.nrt_observation +( + observation_uid bigint NOT NULL, + class_cd varchar(10) NULL, + mood_cd varchar(10) NULL, + act_uid bigint NULL, + cd_desc_txt varchar(1000) NULL, + record_status_cd varchar(20) NULL, + jurisdiction_cd varchar(20) NULL, + program_jurisdiction_oid bigint NULL, + prog_area_cd varchar(20) NULL, + pregnant_ind_cd varchar(20) NULL, + local_id varchar(50) NULL, + activity_to_time datetime NULL, + effective_from_time datetime NULL, + rpt_to_state_time datetime NULL, + electronic_ind char(1) NULL, + version_ctrl_nbr smallint NOT NULL, + ordering_person_id bigint NULL, + patient_id bigint NULL, + result_observation_uid nvarchar(max) NULL, + author_organization_id bigint NULL, + ordering_organization_id bigint NULL, + performing_organization_id bigint NULL, + material_id bigint NULL, + obs_domain_cd_st_1 varchar(20) NULL, + processing_decision_cd varchar(20) NULL, + cd varchar(50) NULL, + shared_ind char(1) NULL, + add_user_id bigint NULL, + add_user_name varchar(50) NULL, + add_time datetime NULL, + last_chg_user_id bigint NULL, + last_chg_user_name varchar(50) NULL, + last_chg_time datetime NULL, + ctrl_cd_display_form varchar(20) NULL, + status_cd char(1) NULL, + cd_system_cd varchar(50) NULL, + cd_system_desc_txt varchar(100) NULL, + ctrl_cd_user_defined_1 varchar(20) NULL, + alt_cd varchar(50) NULL, + alt_cd_desc_txt varchar(1000) NULL, + alt_cd_system_cd varchar(300) NULL, + alt_cd_system_desc_txt varchar(100) NULL, + method_cd varchar(2000) NULL, + method_desc_txt varchar(2000) NULL, + target_site_cd varchar(20) NULL, + target_site_desc_txt varchar(100) NULL, + txt varchar(1000) NULL, + interpretation_cd varchar(20) NULL, + interpretation_desc_txt varchar(100) NULL, + report_observation_uid bigint NULL, + followup_observation_uid nvarchar(MAX) NULL, + report_refr_uid bigint NULL, + report_sprt_uid NULL, + morb_physician_id bigint NULL, + morb_reporter_id bigint NULL, + transcriptionist_id bigint NULL, + transcriptionist_val varchar(20) NULL, + transcriptionist_first_nm varchar(50) NULL, + transcriptionist_last_nm varchar(50) NULL, + assistant_interpreter_id bigint NULL, + assistant_interpreter_val varchar(20) NULL, + assistant_interpreter_first_nm varchar(50) NULL, + assistant_interpreter_last_nm varchar(50) NULL, + result_interpreter_id bigint NULL, + specimen_collector_id bigint NULL, + copy_to_provider_id bigint NULL, + lab_test_technician_id bigint NULL, + health_care_id bigint NULL, + morb_hosp_reporter_id bigint NULL, + priority_cd varchar(20) NULL, + refresh_datetime datetime2(7) GENERATED ALWAYS AS ROW START NOT NULL, + max_datetime datetime2(7) GENERATED ALWAYS AS ROW END HIDDEN NOT NULL, + transcriptionist_auth_type varchar(100) NULL, + transcriptionist_id_assign_auth varchar(199) NULL, + assistant_interpreter_auth_type varchar(100) NULL, + assistant_interpreter_id_assign_auth varchar(199) NULL, + accession_number varchar(199) NULL, + morb_hosp_id bigint NULL, PERIOD FOR SYSTEM_TIME (refresh_datetime, max_datetime) );