use of org.hl7.fhir.r4.model.PractitionerRole in project integration-adaptor-111 by nhsconnect.
the class PractitionerRoleMapper method mapAuthorRoles.
public List<PractitionerRole> mapAuthorRoles(POCDMT000002UK01Author[] authors) {
List<PractitionerRole> roles = new ArrayList<>();
stream(authors).filter(it -> it.getTypeCode().equals(AUTHOR_TYPE_CODE)).map(author -> {
PractitionerRole role = new PractitionerRole();
role.setIdElement(resourceUtil.newRandomUuid());
POCDMT000002UK01AssignedAuthor assignedAuthor = author.getAssignedAuthor();
role.setCode(asList(getCode(assignedAuthor.getCode())));
Organization organization = organizationMapper.mapOrganization(assignedAuthor.getRepresentedOrganization());
role.setOrganization(resourceUtil.createReference(organization));
role.setOrganizationTarget(organization);
Practitioner practitioner = practitionerMapper.mapPractitioner(assignedAuthor);
role.setPractitioner(resourceUtil.createReference(practitioner));
role.setPractitionerTarget(practitioner);
return role;
}).forEach(roles::add);
return roles;
}
use of org.hl7.fhir.r4.model.PractitionerRole in project integration-adaptor-111 by nhsconnect.
the class EncounterMapperTest method mapEncounterWithMultipleParticipantTypes.
@Test
public void mapEncounterWithMultipleParticipantTypes() {
Encounter encounter = encounterMapper.mapEncounter(clinicalDocument, newArrayList(new PractitionerRole()), Optional.of(new PractitionerRole()), DISCHARGE_DETAILS.toCoding());
verifyEncounter(encounter);
verifyParticipants(encounter);
}
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.hasPractitioner())
composeReference(t, "PractitionerRole", "practitioner", element.getPractitioner(), -1);
if (element.hasOrganization())
composeReference(t, "PractitionerRole", "organization", element.getOrganization(), -1);
for (int i = 0; i < element.getRole().size(); i++) composeCodeableConcept(t, "PractitionerRole", "role", element.getRole().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);
if (element.hasPeriod())
composePeriod(t, "PractitionerRole", "period", element.getPeriod(), -1);
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);
}
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);
}
use of org.hl7.fhir.r4.model.PractitionerRole in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composePractitionerRolePractitionerRoleAvailableTimeComponent.
protected void composePractitionerRolePractitionerRoleAvailableTimeComponent(Complex parent, String parentType, String name, PractitionerRole.PractitionerRoleAvailableTimeComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "availableTime", name, element, index);
for (int i = 0; i < element.getDaysOfWeek().size(); i++) composeEnum(t, "PractitionerRole", "daysOfWeek", element.getDaysOfWeek().get(i), i);
if (element.hasAllDayElement())
composeBoolean(t, "PractitionerRole", "allDay", element.getAllDayElement(), -1);
if (element.hasAvailableStartTimeElement())
composeTime(t, "PractitionerRole", "availableStartTime", element.getAvailableStartTimeElement(), -1);
if (element.hasAvailableEndTimeElement())
composeTime(t, "PractitionerRole", "availableEndTime", element.getAvailableEndTimeElement(), -1);
}
Aggregations