Search in sources :

Example 1 with ON

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

the class HealthcareServiceMapper method mapSingleHealthcareService.

private HealthcareService mapSingleHealthcareService(POCDMT000002UK01InformationRecipient informationRecipient) {
    POCDMT000002UK01IntendedRecipient intendedRecipient = informationRecipient.getIntendedRecipient();
    HealthcareService healthcareService = new HealthcareService().setActive(true);
    healthcareService.setIdElement(resourceUtil.newRandomUuid());
    Organization organization = new Organization();
    if (intendedRecipient.isSetReceivedOrganization()) {
        POCDMT000002UK01Organization receivedOrganization = intendedRecipient.getReceivedOrganization();
        organization = organizationMapper.mapOrganization(informationRecipient);
        healthcareService.setProvidedBy(resourceUtil.createReference(organization));
        healthcareService.setProvidedByTarget(organization);
        if (receivedOrganization.sizeOfNameArray() > 0) {
            ON name = receivedOrganization.getNameArray(0);
            healthcareService.setName(nodeUtil.getAllText(name.getDomNode()));
        }
    }
    Location location = locationMapper.mapRecipientToLocation(intendedRecipient, organization);
    healthcareService.addLocation(resourceUtil.createReference(location));
    if (intendedRecipient.sizeOfTelecomArray() > 0) {
        for (TEL tel : intendedRecipient.getTelecomArray()) {
            healthcareService.addTelecom(contactPointMapper.mapContactPoint(tel));
        }
    }
    return healthcareService;
}
Also used : Organization(org.hl7.fhir.dstu3.model.Organization) POCDMT000002UK01Organization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization) POCDMT000002UK01IntendedRecipient(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01IntendedRecipient) HealthcareService(org.hl7.fhir.dstu3.model.HealthcareService) TEL(uk.nhs.connect.iucds.cda.ucr.TEL) POCDMT000002UK01Organization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization) ON(uk.nhs.connect.iucds.cda.ucr.ON) Location(org.hl7.fhir.dstu3.model.Location)

Aggregations

HealthcareService (org.hl7.fhir.dstu3.model.HealthcareService)1 Location (org.hl7.fhir.dstu3.model.Location)1 Organization (org.hl7.fhir.dstu3.model.Organization)1 ON (uk.nhs.connect.iucds.cda.ucr.ON)1 POCDMT000002UK01IntendedRecipient (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01IntendedRecipient)1 POCDMT000002UK01Organization (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization)1 TEL (uk.nhs.connect.iucds.cda.ucr.TEL)1