use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class TemplateMapper method createQuestionnaireResponse.
private QuestionnaireResponse createQuestionnaireResponse(RCMRMT030101UK04CompoundStatement compoundStatement, String practiseCode, Patient patient, Optional<Reference> encounter, Observation parentObservation, RCMRMT030101UK04EhrComposition ehrComposition, RCMRMT030101UK04EhrExtract ehrExtract) {
var questionnaireResponse = new QuestionnaireResponse();
var id = compoundStatement.getId().get(0).getRoot();
questionnaireResponse.addItem(createdLinkedId(compoundStatement)).setAuthoredElement(getAuthored(ehrComposition, ehrExtract)).setSubject(new Reference(patient)).setStatus(COMPLETED).setParent(List.of(new Reference(parentObservation))).setIdentifier(buildIdentifier(id, practiseCode)).setMeta(generateMeta(QUESTIONNAIRE_META_PROFILE)).setId(QUESTIONNAIRE_REFERENCE.formatted(id));
encounter.ifPresent(questionnaireResponse::setContext);
return questionnaireResponse;
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class DiagnosticReportMapper method createDiagnosticReport.
private DiagnosticReport createDiagnosticReport(RCMRMT030101UK04CompoundStatement compoundStatement, Patient patient, RCMRMT030101UK04EhrComposition composition, List<Encounter> encounters, String practiceCode) {
final DiagnosticReport diagnosticReport = new DiagnosticReport();
final String id = compoundStatement.getId().get(0).getRoot();
diagnosticReport.setMeta(generateMeta(META_PROFILE_URL_SUFFIX));
diagnosticReport.setId(id);
diagnosticReport.addIdentifier(buildIdentifier(id, practiceCode));
diagnosticReport.setCode(createCode());
diagnosticReport.setStatus(DiagnosticReportStatus.UNKNOWN);
diagnosticReport.setSubject(new Reference(patient));
diagnosticReport.setSpecimen(getSpecimenReferences(compoundStatement));
createIdentifierExtension(compoundStatement.getId()).ifPresent(diagnosticReport::addIdentifier);
buildContext(composition, encounters).ifPresent(diagnosticReport::setContext);
setResultReferences(compoundStatement, diagnosticReport);
return diagnosticReport;
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class SpecimenMapper method createSpecimen.
private Specimen createSpecimen(RCMRMT030101UK04CompoundStatement specimenCompoundStatement, Patient patient, String practiceCode) {
Specimen specimen = new Specimen();
final String id = specimenCompoundStatement.getId().get(0).getRoot();
specimen.setId(id);
specimen.setMeta(generateMeta(SPECIMEN_META_PROFILE_SUFFIX));
specimen.addIdentifier(buildIdentifier(id, practiceCode));
specimen.setSubject(new Reference(patient));
specimen.setNote(getNote(specimenCompoundStatement));
getAccessionIdentifier(specimenCompoundStatement).ifPresent(specimen::setAccessionIdentifier);
getType(specimenCompoundStatement).ifPresent(specimen::setType);
getCollectedDateTime(specimenCompoundStatement).ifPresent(specimen::setCollection);
return specimen;
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class BloodPressureMapper method mapObservation.
private Observation mapObservation(RCMRMT030101UK04EhrExtract ehrExtract, RCMRMT030101UK04EhrComposition ehrComposition, RCMRMT030101UK04CompoundStatement compoundStatement, Patient patient, List<Encounter> encounters, String practiseCode) {
var observationStatements = getObservationStatementsFromCompoundStatement(compoundStatement);
var id = compoundStatement.getId().get(0);
Observation observation = new Observation().addIdentifier(buildIdentifier(id.getRoot(), practiseCode)).setStatus(ObservationStatus.FINAL).setCode(getCode(compoundStatement.getCode())).setComponent(getComponent(observationStatements)).setComment(getComment(observationStatements, getNarrativeStatementsFromCompoundStatement(compoundStatement))).setSubject(new Reference(patient)).setIssuedElement(getIssued(ehrExtract, ehrComposition)).addPerformer(getParticipantReference(compoundStatement.getParticipant(), ehrComposition));
observation.setId(id.getRoot());
observation.getMeta().getProfile().add(new UriType(META_PROFILE));
addEffective(observation, getEffective(compoundStatement.getEffectiveTime(), compoundStatement.getAvailabilityTime()));
addContextToObservation(observation, encounters, ehrComposition);
return observation;
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConsultationListMapper method mapToTopic.
public ListResource mapToTopic(ListResource consultation, RCMRMT030101UK04CompoundStatement compoundStatement) {
ListResource topic = new ListResource();
topic.setStatus(ListStatus.CURRENT).setMode(ListMode.SNAPSHOT).setTitle(getTitle(compoundStatement)).setCode(CodeableConceptUtils.createCodeableConcept(TOPIC_CODE_CODE, LIST_CODE_SYSTEM, TOPIC_CODE_DISPLAY, null)).setEncounter(consultation.getEncounter()).setSubject(consultation.getSubject()).setDateElement(getDate(compoundStatement, consultation)).setOrderedBy(CodeableConceptUtils.createCodeableConcept(LIST_ORDERED_BY_CODE, LIST_ORDERED_BY_SYSTEM, LIST_ORDERED_BY_DISPLAY, null)).setMeta(generateMeta(LIST_META_PROFILE)).setId(getTopicId(compoundStatement));
return topic;
}
Aggregations