use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class EncounterMapper method generateFlatConsultation.
private void generateFlatConsultation(ListResource consultation, List<ListResource> topics, RCMRMT030101UK04EhrComposition ehrComposition) {
var topic = consultationListMapper.mapToTopic(consultation, null);
List<Reference> entryReferences = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromEhrComposition(ehrComposition, entryReferences);
entryReferences.forEach(reference -> addEntry(topic, reference));
consultation.addEntry(new ListEntryComponent(new Reference(topic)));
topics.add(topic);
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class EncounterMapper method setEncounterLocation.
private void setEncounterLocation(Encounter encounter, RCMRMT030101UK04EhrComposition ehrComposition) {
if (ehrComposition.getLocation() != null) {
var location = new EncounterLocationComponent();
location.setLocation(new Reference(LOCATION_REFERENCE.formatted(ehrComposition.getId().getRoot())));
encounter.setLocation(List.of(location));
}
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition 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;
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ImmunizationMapper method createRecordedTimeExtension.
private Extension createRecordedTimeExtension(RCMRMT030101UK04EhrComposition ehrComposition) {
var extension = new Extension();
extension.setUrl(RECORDED_DATE_EXTENSION_URL);
if (ehrComposition.getAuthor() != null) {
return extension.setValue(new StringType(ehrComposition.getAuthor().getTime().getValue()));
} else if (ehrComposition.getEffectiveTime() != null && ehrComposition.getAvailabilityTime().getNullFlavor() == null) {
return extension.setValue(new StringType(DateFormatUtil.parseToDateTimeType(ehrComposition.getAvailabilityTime().getValue()).asStringValue()));
}
return null;
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ObservationCommentMapper method mapObservation.
private Observation mapObservation(RCMRMT030101UK04EhrExtract ehrExtract, RCMRMT030101UK04EhrComposition ehrComposition, RCMRMT030101UK04NarrativeStatement narrativeStatement, Patient patient, List<Encounter> encounters, String practiseCode) {
var narrativeStatementId = narrativeStatement.getId();
var observation = new Observation();
observation.setId(narrativeStatement.getId().getRoot());
observation.setMeta(generateMeta(META_URL));
observation.setStatus(FINAL);
observation.setSubject(new Reference(patient));
observation.setIssuedElement(createIssued(ehrExtract, ehrComposition));
observation.setCode(createCodeableConcept());
observation.addPerformer(createPerformer(ehrComposition, narrativeStatement));
observation.addIdentifier(buildIdentifier(narrativeStatementId.getRoot(), practiseCode));
setObservationEffective(observation, narrativeStatement.getAvailabilityTime());
setObservationComment(observation, narrativeStatement.getText());
addContextToObservation(observation, encounters, ehrComposition);
return observation;
}
Aggregations