Repository: CDCgov/NEDSS-DataReporting
Pull request #419: CNDE-2548: Update schema for multiple ordering providers
Author: login: upasanapattnaik-eq
Created: 2025-05-13T18:17:47Z | Merged: 2025-05-14T18:59:32Z

## Notes

Update `nrt_observation` and `lab_test_result` to log multiple ordering providers associated to an Order Observation. 
- Post-processing sproc update
- nrt_observation schema change to accomodate list of providers

## JIRA

- **CNDE-2548**: [Jira Ticket](https://cdc-nbs.atlassian.net/browse/CNDE-2548)

## Checklist

- [x] PR focuses on a single story.
- [ ] New unit tests added and ensured they pass.
- [ ] Service has been tested in local and it works as expected.
- [ ] Documentation has been updated for this code change (if needed).
- [ ] Code follows the Java Coding Conventions (https://www.oracle.com/java/technologies/javase/codeconventions-programmingpractices.html).

## Types of changes

What types of changes does this PR introduces?

- [ ] Bugfix
- [x] New feature
- [ ] Breaking change

## Testing

- [ ] Does this PR has >90% code coverage?
- [ ] Is the screenshot attached for code coverage?
- [ ] Does the `gradle build` pass in your local? 
- [ ] Is the `gradle build` logs attached?


Diff:
diff --git a/db/upgrade/rdb_modern/routines/016-sp_d_labtest_result_postprocessing.sql b/db/upgrade/rdb_modern/routines/016-sp_d_labtest_result_postprocessing.sql
index 25824fd95..ecf80f79d 100644
--- a/db/upgrade/rdb_modern/routines/016-sp_d_labtest_result_postprocessing.sql
+++ b/db/upgrade/rdb_modern/routines/016-sp_d_labtest_result_postprocessing.sql
@@ -191,10 +191,6 @@ BEGIN
         SET @PROC_STEP_NAME = 'GENERATING #TMP_Lab_Test_Result1 ';
 
 
-        IF OBJECT_ID('#TMP_Lab_Test_Result1', 'U') IS NOT NULL
-            DROP TABLE  #TMP_Lab_Test_Result1;
-
-
         SELECT
             tst.lab_test_key,
             tst.root_ordered_test_pntr,
@@ -236,13 +232,19 @@ BEGIN
             /*get lab_test_technician: Associated to Root Order*/
                  LEFT JOIN dbo.d_provider AS per6 with (nolock)
                            ON no3.lab_test_technician_id = per6.provider_uid
-            /* Ordering Provider */
+            /* Ordering Provider
+             * CNDE-2548: Account for Multiple ORD associated to a lab
+             * */
                  LEFT JOIN	dbo.d_provider 	AS prv with (nolock)
-                              ON no2.ordering_person_id = prv.provider_uid
+                              ON EXISTS (SELECT 1 FROM STRING_SPLIT(no2.ordering_person_id, ',') nprv
+                                         WHERE cast(nprv.value as bigint) = prv.provider_uid)
+
+            --ON no2.ordering_person_id = prv.provider_uid
             /* Reporting_Lab*/
                  LEFT JOIN dbo.d_Organization	AS org with (nolock)
                            ON no2.author_organization_id = org.Organization_uid
-            /* Ordering Facility */
+            /* Ordering Facility*/
+
                  LEFT JOIN dbo.d_Organization	AS org2 with (nolock)
                            ON no2.ordering_organization_id = org2.Organization_uid
 
@@ -267,7 +269,7 @@ BEGIN
             EXISTS (SELECT 1 FROM STRING_SPLIT(tst.associated_phc_uids, ',') i
                     WHERE cast(i.value as bigint) = inv.case_uid);
 
-        IF @pDebug = 'true' SELECT 'DEBUG: TMP_Lab_Test_Result1',* FROM #TMP_Lab_Test_Result1;
+        IF @pDebug = 'true' SELECT @PROC_STEP_NAME,* FROM #TMP_Lab_Test_Result1;
 
 
         SELECT @ROWCOUNT_NO = @@ROWCOUNT;
diff --git a/db/upgrade/rdb_modern/tables/017-create_nrt_observation.sql b/db/upgrade/rdb_modern/tables/017-create_nrt_observation.sql
index 550d21ab3..2eaf46626 100644
--- a/db/upgrade/rdb_modern/tables/017-create_nrt_observation.sql
+++ b/db/upgrade/rdb_modern/tables/017-create_nrt_observation.sql
@@ -1,88 +1,88 @@
 IF NOT EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_observation' and xtype = 'U')
 CREATE TABLE dbo.nrt_observation
 (
-    observation_uid                         bigint                                          NOT NULL PRIMARY KEY,
-    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                  bigint                                          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                         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,
-    accession_number                        varchar(199)                                    NULL,
-    morb_hosp_id                            bigint                                          NULL,
-    transcriptionist_id_assign_auth         varchar(199)                                    NULL,
-    transcriptionist_auth_type              varchar(100)                                    NULL,
-    assistant_interpreter_id_assign_auth    varchar(199)                                    NULL,
-    assistant_interpreter_auth_type         varchar(100)                                    NULL,
-    priority_cd                             varchar(20)                                     NULL,
-    record_status_time                      datetime                                        NULL,
-    status_time                             datetime                                        NULL,
-    batch_id                                bigint                                          NULL,
-    associated_phc_uids                     nvarchar(max)                                   NULL,
-    refresh_datetime                        datetime2(7) GENERATED ALWAYS AS ROW START      NOT NULL,
-    max_datetime                            datetime2(7) GENERATED ALWAYS AS ROW END HIDDEN NOT NULL,
+    observation_uid                      bigint                                          NOT NULL PRIMARY KEY,
+    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                   nvarchar(max)                                   NULL,
+    patient_id                           bigint                                          NULL,
+    result_observation_uid               bigint                                          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                      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,
+    accession_number                     varchar(199)                                    NULL,
+    morb_hosp_id                         bigint                                          NULL,
+    transcriptionist_id_assign_auth      varchar(199)                                    NULL,
+    transcriptionist_auth_type           varchar(100)                                    NULL,
+    assistant_interpreter_id_assign_auth varchar(199)                                    NULL,
+    assistant_interpreter_auth_type      varchar(100)                                    NULL,
+    priority_cd                          varchar(20)                                     NULL,
+    record_status_time                   datetime                                        NULL,
+    status_time                          datetime                                        NULL,
+    batch_id                             bigint                                          NULL,
+    associated_phc_uids                  nvarchar(max)                                   NULL,
+    refresh_datetime                     datetime2(7) GENERATED ALWAYS AS ROW START      NOT NULL,
+    max_datetime                         datetime2(7) GENERATED ALWAYS AS ROW END HIDDEN NOT NULL,
     PERIOD FOR SYSTEM_TIME (refresh_datetime, max_datetime)
 );
 
diff --git a/liquibase-service/src/main/resources/db/rdb_modern/routines/017-sp_d_labtest_result_postprocessing-001.sql b/liquibase-service/src/main/resources/db/rdb_modern/routines/017-sp_d_labtest_result_postprocessing-001.sql
index 25824fd95..ecf80f79d 100644
--- a/liquibase-service/src/main/resources/db/rdb_modern/routines/017-sp_d_labtest_result_postprocessing-001.sql
+++ b/liquibase-service/src/main/resources/db/rdb_modern/routines/017-sp_d_labtest_result_postprocessing-001.sql
@@ -191,10 +191,6 @@ BEGIN
         SET @PROC_STEP_NAME = 'GENERATING #TMP_Lab_Test_Result1 ';
 
 
-        IF OBJECT_ID('#TMP_Lab_Test_Result1', 'U') IS NOT NULL
-            DROP TABLE  #TMP_Lab_Test_Result1;
-
-
         SELECT
             tst.lab_test_key,
             tst.root_ordered_test_pntr,
@@ -236,13 +232,19 @@ BEGIN
             /*get lab_test_technician: Associated to Root Order*/
                  LEFT JOIN dbo.d_provider AS per6 with (nolock)
                            ON no3.lab_test_technician_id = per6.provider_uid
-            /* Ordering Provider */
+            /* Ordering Provider
+             * CNDE-2548: Account for Multiple ORD associated to a lab
+             * */
                  LEFT JOIN	dbo.d_provider 	AS prv with (nolock)
-                              ON no2.ordering_person_id = prv.provider_uid
+                              ON EXISTS (SELECT 1 FROM STRING_SPLIT(no2.ordering_person_id, ',') nprv
+                                         WHERE cast(nprv.value as bigint) = prv.provider_uid)
+
+            --ON no2.ordering_person_id = prv.provider_uid
             /* Reporting_Lab*/
                  LEFT JOIN dbo.d_Organization	AS org with (nolock)
                            ON no2.author_organization_id = org.Organization_uid
-            /* Ordering Facility */
+            /* Ordering Facility*/
+
                  LEFT JOIN dbo.d_Organization	AS org2 with (nolock)
                            ON no2.ordering_organization_id = org2.Organization_uid
 
@@ -267,7 +269,7 @@ BEGIN
             EXISTS (SELECT 1 FROM STRING_SPLIT(tst.associated_phc_uids, ',') i
                     WHERE cast(i.value as bigint) = inv.case_uid);
 
-        IF @pDebug = 'true' SELECT 'DEBUG: TMP_Lab_Test_Result1',* FROM #TMP_Lab_Test_Result1;
+        IF @pDebug = 'true' SELECT @PROC_STEP_NAME,* FROM #TMP_Lab_Test_Result1;
 
 
         SELECT @ROWCOUNT_NO = @@ROWCOUNT;
diff --git a/liquibase-service/src/main/resources/db/rdb_modern/tables/017-create_nrt_observation-001.sql b/liquibase-service/src/main/resources/db/rdb_modern/tables/017-create_nrt_observation-001.sql
index f7cea74ac..16e01f406 100644
--- a/liquibase-service/src/main/resources/db/rdb_modern/tables/017-create_nrt_observation-001.sql
+++ b/liquibase-service/src/main/resources/db/rdb_modern/tables/017-create_nrt_observation-001.sql
@@ -365,5 +365,11 @@ IF EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_observation' and xtype = '
                     ADD associated_phc_uids NVARCHAR(MAX);
             END;
 
-    END;
-
+--CNDE-2548
+        IF EXISTS(SELECT 1 FROM sys.columns col JOIN sys.types t on col.user_type_id = t.user_type_id
+                  WHERE col.name = N'ordering_person_id' AND t.name = 'bigint' AND col.object_id = Object_ID(N'nrt_observation'))
+           BEGIN
+                ALTER TABLE dbo.nrt_observation
+                ALTER COLUMN ordering_person_id NVARCHAR(max)
+            END;
+    END;
\ No newline at end of file
diff --git a/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/dto/ObservationTransformed.java b/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/dto/ObservationTransformed.java
index edd8a82cb..cf6deef75 100644
--- a/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/dto/ObservationTransformed.java
+++ b/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/dto/ObservationTransformed.java
@@ -12,7 +12,7 @@ public class ObservationTransformed {
     private String followUpObservationUid;
 
     private Long patientId;
-    private Long orderingPersonId;
+    private String orderingPersonId;
     private Long morbPhysicianId;
     private Long morbReporterId;
     private Long morbHospReporterId;
diff --git a/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/reporting/ObservationReporting.java b/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/reporting/ObservationReporting.java
index 3cf056146..b1f6d141a 100644
--- a/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/reporting/ObservationReporting.java
+++ b/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/repository/model/reporting/ObservationReporting.java
@@ -58,7 +58,7 @@ public class ObservationReporting {
     private String followupObservationUid;
 
     private Long patientId;
-    private Long orderingPersonId;
+    private String orderingPersonId;
     private Long morbPhysicianId;
     private Long morbReporterId;
     private Long morbHospReporterId;
diff --git a/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/util/ProcessObservationDataUtil.java b/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/util/ProcessObservationDataUtil.java
index 0a6d03755..8c242776a 100644
--- a/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/util/ProcessObservationDataUtil.java
+++ b/observation-service/src/main/java/gov/cdc/etldatapipeline/observation/util/ProcessObservationDataUtil.java
@@ -89,6 +89,7 @@ private void transformPersonParticipations(String personParticipations, String o
         try {
             JsonNode personParticipationsJsonArray = parseJsonArray(personParticipations);
 
+            List<String> orderers = new ArrayList<>();
             for (JsonNode jsonNode : personParticipationsJsonArray) {
                 assertDomainCdMatches(obsDomainCdSt1, ORDER, RESULT);
 
@@ -104,7 +105,7 @@ private void transformPersonParticipations(String personParticipations, String o
                     if ("PSN".equals(subjectClassCd)) {
                         switch (typeCd) {
                             case "ORD":
-                                observationTransformed.setOrderingPersonId(entityId);
+                                orderers.add(String.valueOf(entityId));
                                 break;
                             case "PATSBJ", "SubjOfMorbReport":
                                 observationTransformed.setPatientId(entityId);
@@ -152,6 +153,9 @@ private void transformPersonParticipations(String personParticipations, String o
                     }
                 }
             }
+            if(!orderers.isEmpty()) {
+                observationTransformed.setOrderingPersonId(String.join(",", orderers));
+            }
         } catch (IllegalArgumentException ex) {
             logger.info(ex.getMessage(), "PersonParticipations", personParticipations);
         } catch (Exception e) {
diff --git a/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/ObservationDataProcessTests.java b/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/ObservationDataProcessTests.java
index 69f372fc8..17f6e359f 100644
--- a/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/ObservationDataProcessTests.java
+++ b/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/ObservationDataProcessTests.java
@@ -104,14 +104,14 @@ void consolidatedDataTransformationTest() {
         ObservationTransformed observationTransformed = transformer.transformObservationData(observation, BATCH_ID);
 
         Long patId = observationTransformed.getPatientId();
-        Long ordererId = observationTransformed.getOrderingPersonId();
+        String ordererId = observationTransformed.getOrderingPersonId();
         Long authorOrgId = observationTransformed.getAuthorOrganizationId();
         Long ordererOrgId = observationTransformed.getOrderingOrganizationId();
         Long performerOrgId = observationTransformed.getPerformingOrganizationId();
         Long materialId = observationTransformed.getMaterialId();
         String resultObsUid = observationTransformed.getResultObservationUid();
 
-        Assertions.assertEquals(10000055L, ordererId);
+        Assertions.assertEquals("10000055", ordererId);
         Assertions.assertEquals(10000066L, patId);
         Assertions.assertEquals(34567890L, authorOrgId);
         Assertions.assertEquals(23456789L, ordererOrgId);
@@ -445,7 +445,7 @@ void testTransformObservationNullError(String payload){
         expected.setObservationUid(100000001L);
         expected.setReportObservationUid(100000001L);
         expected.setPatientId(10000066L);
-        expected.setOrderingPersonId(10000055L);
+        expected.setOrderingPersonId("10000055");
         expected.setAssistantInterpreterId(10000077L);
         expected.setAssistantInterpreterVal("22582");
         expected.setAssistantInterpreterFirstNm("Cara");
diff --git a/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/service/ObservationServiceTest.java b/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/service/ObservationServiceTest.java
index 7ec3b773c..f5a934974 100644
--- a/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/service/ObservationServiceTest.java
+++ b/observation-service/src/test/java/gov/cdc/etldatapipeline/observation/service/ObservationServiceTest.java
@@ -231,7 +231,7 @@ private ObservationReporting constructObservationReporting(Long observationUid,
         observation.setClassCd("OBS");
         observation.setMoodCd("ENV");
         observation.setLocalId("OBS10003388MA01");
-        observation.setOrderingPersonId(10000055L);
+        observation.setOrderingPersonId("10000055");
         observation.setPatientId(10000066L);
         observation.setPerformingOrganizationId(null);      // not null when obsDomainCdSt1=Result
         observation.setAuthorOrganizationId(34567890L);     // null when obsDomainCdSt1=Result


Reviews:
user: login: sveselev
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T23:39:15Z
user: login: sveselev
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T23:39:25Z
user: login: sveselev
body: LGTM!
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T23:40:53Z

Review comments:
diff_hunk: @@ -104,7 +105,7 @@ private void transformPersonParticipations(String personParticipations, String o
                     if ("PSN".equals(subjectClassCd)) {
                         switch (typeCd) {
                             case "ORD":
-                                observationTransformed.setOrderingPersonId(entityId);
+                                orderers.add(String.valueOf(entityId));
path: observation-service/src/main/java/gov/cdc/etldatapipeline/observation/util/ProcessObservationDataUtil.java
user: login: sveselev
body: 👍
created_at: 2025-05-13T23:39:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -152,6 +153,9 @@ private void transformPersonParticipations(String personParticipations, String o
                     }
                 }
             }
+            if(!orderers.isEmpty()) {
+                observationTransformed.setOrderingPersonId(String.join(",", orderers));
path: observation-service/src/main/java/gov/cdc/etldatapipeline/observation/util/ProcessObservationDataUtil.java
user: login: sveselev
body: 👍
created_at: 2025-05-13T23:39:25Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-14T18:56:40Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=CDCgov_NEDSS-DataReporting&pullRequest=419) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=CDCgov_NEDSS-DataReporting&pullRequest=419&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=CDCgov_NEDSS-DataReporting&pullRequest=419&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=CDCgov_NEDSS-DataReporting&pullRequest=419&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=CDCgov_NEDSS-DataReporting&pullRequest=419&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [18.2% Duplication on New Code](https://sonarcloud.io/component_measures?id=CDCgov_NEDSS-DataReporting&pullRequest=419&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=CDCgov_NEDSS-DataReporting&pullRequest=419)


author_association: NONE