use of org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent in project openmrs-module-fhir2 by openmrs.
the class EncounterParticipantTranslatorImplTest method setUp.
@Before
public void setUp() {
participantTranslator = new EncounterParticipantTranslatorImpl();
participantTranslator.setPractitionerDao(practitionerDao);
encounterProvider = new EncounterProvider();
provider = new Provider();
provider.setUuid(PROVIDER_UUID);
encounterProvider.setProvider(provider);
encounterParticipantComponent = new Encounter.EncounterParticipantComponent();
Reference reference = new Reference(PROVIDER_URI);
encounterParticipantComponent.setIndividual(reference);
Practitioner practitioner = new Practitioner();
practitioner.setId(PROVIDER_UUID);
}
use of org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent in project summary-care-record-api by NHSDigital.
the class ParticipantAgentMapper method mapAuthor1.
public static Participant.Author1 mapAuthor1(Bundle bundle, EncounterParticipantComponent encounterParticipant) {
var author = new Participant.Author1();
author.setTime(formatDateToHl7(encounterParticipant.getPeriod().getStartElement()));
var practitionerRoleReference = encounterParticipant.getIndividual().getReference();
var practitionerRole = getResourceByReference(bundle, practitionerRoleReference, PractitionerRole.class).orElseThrow(() -> new FhirValidationException(String.format("Bundle is missing PractitionerRole %s that is linked to Encounter", practitionerRoleReference)));
if (StringUtils.isNotBlank(practitionerRole.getOrganization().getReference())) {
setAgentDevice(bundle, practitionerRole.getOrganization(), author);
} else if (StringUtils.isNotBlank(practitionerRole.getPractitioner().getReference())) {
setParticipantAgents(bundle, practitionerRole.getPractitioner(), author);
}
return author;
}
use of org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent in project summary-care-record-api by NHSDigital.
the class DiagnosisMapper method mapInformant.
private void mapInformant(List<Resource> resources, Encounter encounter, Node informant) {
DateTimeType time = parseDate(xmlUtils.getValueByXPath(informant, DIAGNOSIS_PARTICIPANT_TIME_XPATH), DateTimeType.class);
participantMapper.map(informant).stream().peek(it -> resources.add(it)).filter(it -> it instanceof PractitionerRole || it instanceof RelatedPerson).forEach(it -> encounter.addParticipant(new EncounterParticipantComponent().setPeriod(new Period().setStartElement(time)).addType(getParticipationType("INF", "informant")).setIndividual(new Reference(it))));
}
use of org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent in project summary-care-record-api by NHSDigital.
the class FindingMapper method mapInformant.
private void mapInformant(List<Resource> resources, Encounter encounter, Node informant) {
DateTimeType time = parseDate(xmlUtils.getValueByXPath(informant, FINDING_PARTICIPANT_TIME_XPATH), DateTimeType.class);
participantMapper.map(informant).stream().peek(it -> resources.add(it)).filter(it -> it instanceof PractitionerRole || it instanceof RelatedPerson).map(Reference::new).forEach(it -> encounter.addParticipant(new EncounterParticipantComponent().setPeriod(new Period().setStartElement(time)).addType(getParticipationType("INF", "informant")).setIndividual(it)));
}
use of org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent in project integration-adaptor-111 by nhsconnect.
the class ParticipantMapper method mapEncounterParticipant.
public Encounter.EncounterParticipantComponent mapEncounterParticipant(POCDMT000002UK01Participant1 encounterParticipant) {
Practitioner practitioner = practitionerMapper.mapPractitioner(encounterParticipant.getAssociatedEntity());
Encounter.EncounterParticipantComponent encounterParticipantComponent = new Encounter.EncounterParticipantComponent().setType(retrieveTypeFromITK(encounterParticipant)).setIndividual(resourceUtil.createReference(practitioner)).setIndividualTarget(practitioner);
if (encounterParticipant.isSetTime()) {
encounterParticipantComponent.setPeriod(periodMapper.mapPeriod(encounterParticipant.getTime()));
}
return encounterParticipantComponent;
}
Aggregations