Search in sources :

Example 46 with PractitionerRole

use of org.hl7.fhir.r4.model.PractitionerRole in project integration-adaptor-111 by nhsconnect.

the class EncounterMapper method mapEncounter.

public Encounter mapEncounter(POCDMT000002UK01ClinicalDocument1 clinicalDocument, List<PractitionerRole> authorPractitionerRoles, Optional<PractitionerRole> responsibleParty, Coding interaction) {
    Encounter encounter = new Encounter();
    encounter.setIdElement(resourceUtil.newRandomUuid());
    encounter.setStatus(FINISHED);
    encounter.setLocation(getLocationComponents(clinicalDocument));
    encounter.setPeriod(getPeriod(clinicalDocument));
    setType(encounter, interaction);
    setServiceProvider(encounter, clinicalDocument);
    setIdentifiers(encounter, clinicalDocument);
    setSubject(encounter, clinicalDocument);
    encounter.setParticipant(getEncounterParticipantComponents(clinicalDocument, authorPractitionerRoles, responsibleParty, encounter));
    setAppointment(encounter, clinicalDocument);
    setEncounterReasonAndType(encounter, clinicalDocument);
    return encounter;
}
Also used : Encounter(org.hl7.fhir.dstu3.model.Encounter) POCDMT000002UK01Encounter(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Encounter)

Example 47 with PractitionerRole

use of org.hl7.fhir.r4.model.PractitionerRole in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composePractitionerPractitionerPractitionerRoleComponent.

protected void composePractitionerPractitionerPractitionerRoleComponent(Complex parent, String parentType, String name, Practitioner.PractitionerPractitionerRoleComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "practitionerRole", name, element, index);
    if (element.hasOrganization())
        composeReference(t, "Practitioner", "organization", element.getOrganization(), -1);
    if (element.hasRole())
        composeCodeableConcept(t, "Practitioner", "role", element.getRole(), -1);
    for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "Practitioner", "specialty", element.getSpecialty().get(i), i);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Practitioner", "identifier", element.getIdentifier().get(i), i);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "Practitioner", "telecom", element.getTelecom().get(i), i);
    if (element.hasPeriod())
        composePeriod(t, "Practitioner", "period", element.getPeriod(), -1);
    for (int i = 0; i < element.getLocation().size(); i++) composeReference(t, "Practitioner", "location", element.getLocation().get(i), i);
    for (int i = 0; i < element.getHealthcareService().size(); i++) composeReference(t, "Practitioner", "healthcareService", element.getHealthcareService().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 48 with PractitionerRole

use of org.hl7.fhir.r4.model.PractitionerRole in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composePractitionerRolePractitionerRoleNotAvailableComponent.

protected void composePractitionerRolePractitionerRoleNotAvailableComponent(Complex parent, String parentType, String name, PractitionerRole.PractitionerRoleNotAvailableComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "notAvailable", name, element, index);
    if (element.hasDescriptionElement())
        composeString(t, "PractitionerRole", "description", element.getDescriptionElement(), -1);
    if (element.hasDuring())
        composePeriod(t, "PractitionerRole", "during", element.getDuring(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 49 with PractitionerRole

use of org.hl7.fhir.r4.model.PractitionerRole in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composePractitionerRole.

protected void composePractitionerRole(Complex parent, String parentType, String name, PractitionerRole element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "PractitionerRole", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "PractitionerRole", "identifier", element.getIdentifier().get(i), i);
    if (element.hasActiveElement())
        composeBoolean(t, "PractitionerRole", "active", element.getActiveElement(), -1);
    if (element.hasPeriod())
        composePeriod(t, "PractitionerRole", "period", element.getPeriod(), -1);
    if (element.hasPractitioner())
        composeReference(t, "PractitionerRole", "practitioner", element.getPractitioner(), -1);
    if (element.hasOrganization())
        composeReference(t, "PractitionerRole", "organization", element.getOrganization(), -1);
    for (int i = 0; i < element.getCode().size(); i++) composeCodeableConcept(t, "PractitionerRole", "code", element.getCode().get(i), i);
    for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "PractitionerRole", "specialty", element.getSpecialty().get(i), i);
    for (int i = 0; i < element.getLocation().size(); i++) composeReference(t, "PractitionerRole", "location", element.getLocation().get(i), i);
    for (int i = 0; i < element.getHealthcareService().size(); i++) composeReference(t, "PractitionerRole", "healthcareService", element.getHealthcareService().get(i), i);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "PractitionerRole", "telecom", element.getTelecom().get(i), i);
    for (int i = 0; i < element.getAvailableTime().size(); i++) composePractitionerRolePractitionerRoleAvailableTimeComponent(t, "PractitionerRole", "availableTime", element.getAvailableTime().get(i), i);
    for (int i = 0; i < element.getNotAvailable().size(); i++) composePractitionerRolePractitionerRoleNotAvailableComponent(t, "PractitionerRole", "notAvailable", element.getNotAvailable().get(i), i);
    if (element.hasAvailabilityExceptionsElement())
        composeString(t, "PractitionerRole", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
    for (int i = 0; i < element.getEndpoint().size(); i++) composeReference(t, "PractitionerRole", "endpoint", element.getEndpoint().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 50 with PractitionerRole

use of org.hl7.fhir.r4.model.PractitionerRole in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composePractitionerRolePractitionerRoleNotAvailableComponent.

protected void composePractitionerRolePractitionerRoleNotAvailableComponent(Complex parent, String parentType, String name, PractitionerRole.PractitionerRoleNotAvailableComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "notAvailable", name, element, index);
    if (element.hasDescriptionElement())
        composeString(t, "PractitionerRole", "description", element.getDescriptionElement(), -1);
    if (element.hasDuring())
        composePeriod(t, "PractitionerRole", "during", element.getDuring(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Aggregations

PractitionerRole (org.hl7.fhir.r4.model.PractitionerRole)26 Reference (org.hl7.fhir.r4.model.Reference)19 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)16 Coding (org.hl7.fhir.r4.model.Coding)15 Identifier (org.hl7.fhir.r4.model.Identifier)13 ArrayList (java.util.ArrayList)12 Practitioner (org.hl7.fhir.r4.model.Practitioner)12 Resource (org.hl7.fhir.r4.model.Resource)12 List (java.util.List)11 PractitionerRole (org.hl7.fhir.dstu3.model.PractitionerRole)11 RelatedPerson (org.hl7.fhir.r4.model.RelatedPerson)10 Optional (java.util.Optional)9 DateTimeType (org.hl7.fhir.r4.model.DateTimeType)7 EncounterParticipantComponent (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent)7 Period (org.hl7.fhir.r4.model.Period)7 Test (org.junit.jupiter.api.Test)7 Identifiable (org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable)7 Component (org.springframework.stereotype.Component)7 ContactPoint (org.hl7.fhir.r4.model.ContactPoint)6 RequiredArgsConstructor (lombok.RequiredArgsConstructor)5