HL7PatientTransforms { public static org.hl7.v3.PRPAMT201301UV02Patient create201301Patient(PRPAMT201306UV02ParameterList paramList, String aaId) { PRPAMT201301UV02Patient result = new PRPAMT201301UV02Patient(); PRPAMT201301UV02Person person = new PRPAMT201301UV02Person(); if (paramList == null) { return null; } if (CollectionUtils.isNotEmpty(paramList.getLivingSubjectAdministrativeGender())) { CE genderCode = paramList.getLivingSubjectAdministrativeGender().get(0).getValue().get(0); person.setAdministrativeGenderCode(genderCode); } if (CollectionUtils.isNotEmpty(paramList.getLivingSubjectBirthTime())) { person.setBirthTime(createBirthTime(paramList.getLivingSubjectBirthTime().get(0))); } if (CollectionUtils.isNotEmpty(paramList.getPatientAddress())) { for (PRPAMT201306UV02PatientAddress patAdd : paramList.getPatientAddress()) { for (ADExplicit newAdd : patAdd.getValue()) { person.getAddr().add(newAdd); } } } if (CollectionUtils.isNotEmpty(paramList.getPatientTelecom())) { for (PRPAMT201306UV02PatientTelecom telcom : paramList.getPatientTelecom()) { if (telcom != null) { for (TELExplicit newTelcom : telcom.getValue()) { person.getTelecom().add(newTelcom); } } } } if (CollectionUtils.isNotEmpty(paramList.getLivingSubjectName())) { for (PRPAMT201306UV02LivingSubjectName subjName : paramList.getLivingSubjectName()) { for (ENExplicit name : subjName.getValue()) { PNExplicit newName = HL7DataTransformHelper.convertENtoPN(name); newName = HL7ArrayTransforms.copyNullFlavors(name, newName); person.getName().add(newName); } } } if (CollectionUtils.isNotEmpty(paramList.getLivingSubjectId())) { for (PRPAMT201306UV02LivingSubjectId subjId : paramList.getLivingSubjectId()) { for (II id : subjId.getValue()) { if (id.getRoot().equalsIgnoreCase(aaId)) { result.getId().add(id); } else { PRPAMT201301UV02OtherIDs otherId = new PRPAMT201301UV02OtherIDs(); otherId.getId().add(id); person.getAsOtherIDs().add(otherId); } } } } person = HL7ArrayTransforms.copyNullFlavors(paramList, person); javax.xml.namespace.QName xmlqname = new javax.xml.namespace.QName("urn:hl7-org:v3", "patientPerson"); JAXBElement<PRPAMT201301UV02Person> jaxbPerson = new JAXBElement<>(xmlqname, PRPAMT201301UV02Person.class, person); jaxbPerson.setValue(person); result.setPatientPerson(jaxbPerson); return result; }  static org.hl7.v3.PRPAMT201301UV02Patient create201301Patient(PRPAMT201306UV02ParameterList paramList,
        String aaId); static PRPAMT201301UV02Patient create201301Patient(JAXBElement<PRPAMT201301UV02Person> person,
        String patId); static PRPAMT201301UV02Patient createPRPAMT201301UVPatient(PRPAMT201310UV02Patient patient); static PRPAMT201301UV02Patient createPRPAMT201301UVPatient(PRPAMT201302UV02Patient patient); static PRPAMT201301UV02Patient create201301Patient(JAXBElement<PRPAMT201301UV02Person> person, String patId,
        String assigningAuthority); static PRPAMT201301UV02Patient create201301Patient(JAXBElement<PRPAMT201301UV02Person> person, II id); static JAXBElement<PRPAMT201310UV02Person> create201310PatientPerson(
        JAXBElement<PRPAMT201301UV02Person> person201301); static PRPAMT201310UV02Patient create201310Patient(PRPAMT201301UV02Patient patient, String patientId,
        String orgId); static PRPAMT201310UV02Patient create201310Patient(JAXBElement<PRPAMT201310UV02Person> person,
        String patId); static PRPAMT201310UV02Patient create201310Patient(JAXBElement<PRPAMT201310UV02Person> person, String patId,
        String assigningAuthority); static PRPAMT201310UV02Patient create201310Patient(JAXBElement<PRPAMT201310UV02Person> person, II id); static PRPAMT201302UV02Patient create201302Patient(String remotePatId,
        JAXBElement<PRPAMT201301UV02Person> person, II localPatId); static PRPAMT201302UV02Patient create201302Patient(String remotePatId, String remoteAssigningAuthority,
        JAXBElement<PRPAMT201301UV02Person> person, II localPatId); static PRPAMT201302UV02Patient create201302Patient(II remotePatId,
        JAXBElement<PRPAMT201301UV02Person> person, II localPatId); static PRPAMT201302UV02Patient create201302Patient(JAXBElement<PRPAMT201310UV02Person> person,
        String remotePatId, II localPatId); static PRPAMT201302UV02Patient create201302Patient(JAXBElement<PRPAMT201310UV02Person> person,
        String remotePatId, String remoteAssigningAuthority, II localPatId); static PRPAMT201302UV02Patient create201302Patient(JAXBElement<PRPAMT201310UV02Person> person,
        II remotePatId, II localPatId); static JAXBElement<PRPAMT201301UV02Person> create201301PatientPerson(String patFirstName, String patLastName,
        String gender, String birthTime, String ssn); static JAXBElement<PRPAMT201301UV02Person> create201301PatientPerson(PNExplicit patName, CE gender,
        TSExplicit birthTime, PRPAMT201301UV02OtherIDs otherIds); static JAXBElement<PRPAMT201310UV02Person> create201310PatientPerson(String patFirstName, String patLastName,
        String gender, String birthTime, String ssn); static JAXBElement<PRPAMT201310UV02Person> create201310PatientPerson(PNExplicit patName, CE gender,
        TSExplicit birthTime, PRPAMT201310UV02OtherIDs otherIds); static JAXBElement<PRPAMT201302UV02PatientPatientPerson> create201302PatientPerson(String patFirstName,
        String patLastName, String gender, String birthTime, String ssn, II remotePatId); static JAXBElement<PRPAMT201302UV02PatientPatientPerson> create201302PatientPerson(PNExplicit patName,
        CE gender, TSExplicit birthTime, List<PRPAMT201301UV02OtherIDs> otherIds, II remotePatId); static JAXBElement<PRPAMT201302UV02PatientPatientPerson> create201302PatientPerson(
        List<PRPAMT201310UV02OtherIDs> otherIds, PNExplicit patName, CE gender, TSExplicit birthTime,
        II remotePatId); static JAXBElement<PRPAMT201302UV02PatientPatientPerson> create201302PatientPerson(PNExplicit patName,
        CE gender, TSExplicit birthTime, PRPAMT201302UV02OtherIDs otherIds); static PRPAMT201301UV02OtherIDs createPRPAMT201301UVOtherIDs(String ssn); static PRPAMT201310UV02OtherIDs createPRPAMT201310UVOtherIDs(String ssn); static PRPAMT201302UV02OtherIDs createPRPAMT201302UVOtherIDs(String ssn, II remotePatId); static JAXBElement<PRPAMT201301UV02BirthPlace> createPRPAMT201301UVBirthPlace(
        PRPAMT201310UV02BirthPlace birthPlace); static JAXBElement<PRPAMT201301UV02Person> create201301PatientPerson(PRPAMT201310UV02Person person); static JAXBElement<PRPAMT201301UV02Person> create201301PatientPerson(
        JAXBElement<PRPAMT201302UV02PatientPatientPerson> person); static JAXBElement<PRPAMT201301UV02BirthPlace> createPRPAMT201301UVBirthPlace(
        JAXBElement<PRPAMT201302UV02BirthPlace> value); static TSExplicit createBirthTime(PRPAMT201306UV02LivingSubjectBirthTime birthTime);  }
@Test public void create201301Patient() { String aaId = "1.1"; org.hl7.v3.PRPAMT201301UV02Patient patient; HL7PatientTransforms transforms = new HL7PatientTransforms(); patient = transforms.create201301Patient(createPRPAMT201306UV02ParameterList(), aaId); assertEquals(patient.getPatientPerson().getValue().getAdministrativeGenderCode().getCode(), "CONNECT"); assertEquals(patient.getPatientPerson().getValue().getBirthTime().getValue(), "12-10-1765"); assertEquals(patient.getId().get(0).getRoot(), "1.1"); assertEquals(patient.getPatientPerson().getValue().getTelecom().get(0).getUse().get(0), "001-002-2345"); assertEquals(patient.getPatientPerson().getValue().getAddr().get(0).getUse().get(0), "12601, FairLakes Circle"); }