use of org.hl7.fhir.dstu3.model.Immunization.ImmunizationPractitionerComponent in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ImmunizationMapper method mapImmunization.
private Immunization mapImmunization(RCMRMT030101UK04EhrComposition ehrComposition, RCMRMT030101UK04ObservationStatement observationStatement, Patient patientResource, List<Encounter> encounterList, String practiseCode) {
Immunization immunization = new Immunization();
var id = observationStatement.getId().getRoot();
var practitioner = ParticipantReferenceUtil.getParticipantReference(observationStatement.getParticipant(), ehrComposition);
var encounter = getEncounterReference(encounterList, ehrComposition.getId());
immunization.setMeta(generateMeta(META_PROFILE));
immunization.addIdentifier(buildIdentifier(id, practiseCode));
immunization.addExtension(createVaccineProcedureExtension(observationStatement));
immunization.addExtension(createRecordedTimeExtension(ehrComposition));
immunization.setEncounter(encounter).addPractitioner(new ImmunizationPractitionerComponent(practitioner)).setStatus(ImmunizationStatus.COMPLETED).setNotGiven(false).setPrimarySource(false).setPatient(new Reference(patientResource)).setId(id);
buildNote(observationStatement).forEach(immunization::addNote);
setDateFields(immunization, observationStatement);
return immunization;
}
Aggregations