Search in sources :

Example 1 with POCDMT000002UK01Person

use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person in project integration-adaptor-111 by nhsconnect.

the class GuardianMapperTest method mockGuardianPerson.

private void mockGuardianPerson(POCDMT000002UK01Guardian guardian) {
    POCDMT000002UK01Person guardianPerson = mock(POCDMT000002UK01Person.class);
    when(guardian.isSetGuardianPerson()).thenReturn(true);
    when(guardian.getGuardianPerson()).thenReturn(guardianPerson);
    PN personName = mock(PN.class);
    when(guardianPerson.sizeOfNameArray()).thenReturn(1);
    when(guardianPerson.getNameArray(0)).thenReturn(personName);
    when(humanNameMapper.mapHumanName(any())).thenReturn(humanName);
}
Also used : POCDMT000002UK01Person(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person) PN(uk.nhs.connect.iucds.cda.ucr.PN)

Example 2 with POCDMT000002UK01Person

use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person in project integration-adaptor-111 by nhsconnect.

the class RelatedPersonMapperTest method createPerson.

private POCDMT000002UK01Person createPerson() {
    POCDMT000002UK01Person person = POCDMT000002UK01Person.Factory.newInstance();
    PN pn = PN.Factory.newInstance();
    PN[] pnArray = { pn };
    person.setNameArray(pnArray);
    return person;
}
Also used : POCDMT000002UK01Person(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person) PN(uk.nhs.connect.iucds.cda.ucr.PN)

Example 3 with POCDMT000002UK01Person

use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person in project integration-adaptor-111 by nhsconnect.

the class PractitionerMapperTest method createPerson.

private POCDMT000002UK01Person createPerson() {
    POCDMT000002UK01Person person = POCDMT000002UK01Person.Factory.newInstance();
    PN pn = PN.Factory.newInstance();
    PN[] pnArray = { pn };
    person.setNameArray(pnArray);
    return person;
}
Also used : POCDMT000002UK01Person(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person) PN(uk.nhs.connect.iucds.cda.ucr.PN)

Example 4 with POCDMT000002UK01Person

use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person in project integration-adaptor-111 by nhsconnect.

the class GuardianMapper method mapGuardian.

public Patient.ContactComponent mapGuardian(POCDMT000002UK01Guardian guardian) {
    Patient.ContactComponent contactComponent = new Patient.ContactComponent();
    if (guardian.isSetGuardianPerson()) {
        POCDMT000002UK01Person guardianPerson = guardian.getGuardianPerson();
        if (guardianPerson.sizeOfNameArray() > 0) {
            contactComponent.setName(humanNameMapper.mapHumanName(guardianPerson.getNameArray(0)));
        }
    }
    if (guardian.sizeOfAddrArray() > 0) {
        contactComponent.setAddress(addressMapper.mapAddress(guardian.getAddrArray(0)));
    }
    if (guardian.isSetGuardianOrganization()) {
        Organization managingOrganization = organizationMapper.mapOrganization(guardian.getGuardianOrganization());
        contactComponent.setOrganization(resourceUtil.createReference(managingOrganization));
        contactComponent.setOrganizationTarget(managingOrganization);
    }
    return contactComponent;
}
Also used : Organization(org.hl7.fhir.dstu3.model.Organization) Patient(org.hl7.fhir.dstu3.model.Patient) POCDMT000002UK01Person(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person)

Aggregations

POCDMT000002UK01Person (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Person)4 PN (uk.nhs.connect.iucds.cda.ucr.PN)3 Organization (org.hl7.fhir.dstu3.model.Organization)1 Patient (org.hl7.fhir.dstu3.model.Patient)1