test_class.declarator: transformer
test_class.modifier: private
test_class.original_string: private PatientInfoTransformer transformer;
test_class.type: PatientInfoTransformer
test_class.var_name: transformer
test_class.file: commons/ihe/xds/src/test/java/org/openehealth/ipf/commons/ihe/xds/core/transform/hl7/PatientInfoTransformerTest.java
test_class.identifier: PatientInfoTransformerTest
test_case.body: @Test
      public void testFromHL7() {
          List<String> hl7PID = Arrays.asList(
              "PID-3|abcdef",
              "PID-3|fedcba",
              "PID-5|Joman",
              "PID-7|1234",
              "PID-8|A",
              "PID-9|Not used",
              "PID-11|Jo Str. 3");
          
          PatientInfo patientInfo = transformer.fromHL7(hl7PID);
          assertNotNull(patientInfo);
          assertEquals(2, patientInfo.getIds().size());
          assertEquals("abcdef", patientInfo.getIds().get(0).getId());
          assertEquals("fedcba", patientInfo.getIds().get(1).getId());
          assertEquals("Joman", patientInfo.getName().getFamilyName());
          assertEquals("1234", patientInfo.getDateOfBirth());
          assertEquals("A", patientInfo.getGender());
          assertEquals("Jo Str. 3", patientInfo.getAddress().getStreetAddress());
      }
test_case.class_method_signature: PatientInfoTransformerTest.testFromHL7()
test_case.full_signature: @Test public void testFromHL7()
test_case.identifier: testFromHL7
test_case.invocations: asList fromHL7 assertNotNull assertEquals size getIds assertEquals getId get getIds assertEquals getId get getIds assertEquals getFamilyName getName assertEquals getDateOfBirth assertEquals getGender assertEquals getStreetAddress getAddress
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFromHL7()
focal_class.declarator: PID_PREFIX = "PID-"
focal_class.modifier: private static final
focal_class.original_string: private static final String PID_PREFIX = "PID-";
focal_class.type: String
focal_class.var_name: PID_PREFIX
focal_class.declarator: pidTransformers
focal_class.modifier: private static final
focal_class.original_string: private static final Map<Integer, PIDTransformer> pidTransformers;
focal_class.type: Map<Integer, PIDTransformer>
focal_class.var_name: pidTransformers
focal_class.file: commons/ihe/xds/src/main/java/org/openehealth/ipf/commons/ihe/xds/core/transform/hl7/PatientInfoTransformer.java
focal_class.identifier: PatientInfoTransformer
focal_class.class_method_signature: PatientInfoTransformer.fromHL7(List<String> hl7PID)
focal_class.full_signature: public PatientInfo fromHL7(List<String> hl7PID)
focal_class.identifier: fromHL7
focal_class.modifiers: public
focal_class.parameters: (List<String> hl7PID)
focal_class.return: PatientInfo
focal_class.signature: PatientInfo fromHL7(List<String> hl7PID)
focal_class.class_method_signature: PatientInfoTransformer.toHL7(PatientInfo patientInfo)
focal_class.full_signature: public List<String> toHL7(PatientInfo patientInfo)
focal_class.identifier: toHL7
focal_class.modifiers: public
focal_class.parameters: (PatientInfo patientInfo)
focal_class.return: List<String>
focal_class.signature: List<String> toHL7(PatientInfo patientInfo)
focal_class.class_method_signature: PatientInfoTransformer.getPidNumber(String pidNoStr)
focal_class.full_signature: private Integer getPidNumber(String pidNoStr)
focal_class.identifier: getPidNumber
focal_class.modifiers: private
focal_class.parameters: (String pidNoStr)
focal_class.return: Integer
focal_class.signature: Integer getPidNumber(String pidNoStr)
focal_method.body: public PatientInfo fromHL7(List<String> hl7PID) {
          if (hl7PID == null || hl7PID.isEmpty()) {
              return null;
          }
          
          PatientInfo patientInfo = new PatientInfo();
          
          for (String hl7PIDLine : hl7PID) {
              String[] fields = PipeParser.split(hl7PIDLine.trim(), "|");
              if (fields.length == 2) {
                  Integer pidNo = getPidNumber(fields[0]);
                  PIDTransformer transformer = pidTransformers.get(pidNo);
                  if (transformer != null) {            
                      transformer.fromHL7(fields[1], patientInfo);
                  }
              }
          }
          
          return patientInfo;
      }
focal_method.class_method_signature: PatientInfoTransformer.fromHL7(List<String> hl7PID)
focal_method.full_signature: public PatientInfo fromHL7(List<String> hl7PID)
focal_method.identifier: fromHL7
focal_method.invocations: isEmpty split trim getPidNumber get fromHL7
focal_method.modifiers: public
focal_method.parameters: (List<String> hl7PID)
focal_method.return: PatientInfo
focal_method.signature: PatientInfo fromHL7(List<String> hl7PID)