test_class.declarator: transformer
test_class.modifier: private
test_class.original_string: private SourcePatientIdentifierPIDTransformer transformer;
test_class.type: SourcePatientIdentifierPIDTransformer
test_class.var_name: transformer
test_class.file: commons/ihe/xds/src/test/java/org/openehealth/ipf/commons/ihe/xds/core/transform/hl7/pid/SourcePatientIdentifierPIDTransformerTest.java
test_class.identifier: SourcePatientIdentifierPIDTransformerTest
test_case.body: @Test
      public void testToHL7() {
          PatientInfo patientInfo = new PatientInfo();
          Identifiable id1 = new Identifiable();
          id1.setId("id1");
          AssigningAuthority assigningAuthority1 = new AssigningAuthority();
          assigningAuthority1.setUniversalId("1.1.1.1");
          assigningAuthority1.setUniversalIdType("ISO");
          id1.setAssigningAuthority(assigningAuthority1);
          
          Identifiable id2 = new Identifiable();
          id2.setId("id2");
          AssigningAuthority assigningAuthority2 = new AssigningAuthority();
          assigningAuthority2.setUniversalId("2.2.2.2");
          assigningAuthority2.setUniversalIdType("ISO");
          id2.setAssigningAuthority(assigningAuthority2);
          
          patientInfo.getIds().add(id1);
          patientInfo.getIds().add(id2);
  
          List<String> result = transformer.toHL7(patientInfo);
          assertEquals(2, result.size());
          assertEquals("id1^^^&1.1.1.1&ISO", result.get(0));
          assertEquals("id2^^^&2.2.2.2&ISO", result.get(1));
      }
test_case.class_method_signature: SourcePatientIdentifierPIDTransformerTest.testToHL7()
test_case.full_signature: @Test public void testToHL7()
test_case.identifier: testToHL7
test_case.invocations: setId setUniversalId setUniversalIdType setAssigningAuthority setId setUniversalId setUniversalIdType setAssigningAuthority add getIds add getIds toHL7 assertEquals size assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testToHL7()
focal_class.file: commons/ihe/xds/src/main/java/org/openehealth/ipf/commons/ihe/xds/core/transform/hl7/pid/SourcePatientIdentifierPIDTransformer.java
focal_class.identifier: SourcePatientIdentifierPIDTransformer
focal_class.interfaces: implements PIDTransformer
focal_class.class_method_signature: SourcePatientIdentifierPIDTransformer.fromHL7(String hl7Data, PatientInfo patientInfo)
focal_class.full_signature: @Override public void fromHL7(String hl7Data, PatientInfo patientInfo)
focal_class.identifier: fromHL7
focal_class.modifiers: @Override public
focal_class.parameters: (String hl7Data, PatientInfo patientInfo)
focal_class.return: void
focal_class.signature: void fromHL7(String hl7Data, PatientInfo patientInfo)
focal_class.class_method_signature: SourcePatientIdentifierPIDTransformer.toHL7(PatientInfo patientInfo)
focal_class.full_signature: @Override public List<String> toHL7(PatientInfo patientInfo)
focal_class.identifier: toHL7
focal_class.modifiers: @Override public
focal_class.parameters: (PatientInfo patientInfo)
focal_class.return: List<String>
focal_class.signature: List<String> toHL7(PatientInfo patientInfo)
focal_method.body: @Override
      public List<String> toHL7(PatientInfo patientInfo) {
          notNull(patientInfo, "patientInfo cannot be null");
  
          List<String> result = new ArrayList<String>();
          for (Identifiable id : patientInfo.getIds()) {
              String part = Hl7v2Based.render(id);
              if (part != null) {
                  result.add(part);
              }
          }
  
          return result.isEmpty() ? null : result;
      }
focal_method.class_method_signature: SourcePatientIdentifierPIDTransformer.toHL7(PatientInfo patientInfo)
focal_method.full_signature: @Override public List<String> toHL7(PatientInfo patientInfo)
focal_method.identifier: toHL7
focal_method.invocations: notNull getIds render add isEmpty
focal_method.modifiers: @Override public
focal_method.parameters: (PatientInfo patientInfo)
focal_method.return: List<String>
focal_method.signature: List<String> toHL7(PatientInfo patientInfo)