use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ProcedureRequestMapper method mapToProcedureRequest.
public ProcedureRequest mapToProcedureRequest(RCMRMT030101UK04EhrExtract ehrExtract, RCMRMT030101UK04EhrComposition ehrComposition, RCMRMT030101UK04PlanStatement planStatement, Patient patient, List<Encounter> encounters, String practiseCode) {
var id = planStatement.getId().getRoot();
var procedureRequest = new ProcedureRequest();
procedureRequest.setStatus(ProcedureRequestStatus.ACTIVE).setIntent(ProcedureRequestIntent.PLAN).setAuthoredOnElement(getAuthoredOn(planStatement.getAvailabilityTime(), ehrExtract, ehrComposition)).setOccurrence(getOccurrenceDate(planStatement.getEffectiveTime())).setSubject(new Reference(patient)).setMeta(generateMeta(META_PROFILE)).setId(id);
procedureRequest.getIdentifier().add(buildIdentifier(id, practiseCode));
procedureRequest.getNote().add(getNote(planStatement.getText()));
procedureRequest.getReasonCode().add(codeableConceptMapper.mapToCodeableConcept(planStatement.getCode()));
procedureRequest.getRequester().setAgent(ParticipantReferenceUtil.getParticipantReference(planStatement.getParticipant(), ehrComposition));
setProcedureRequestContext(procedureRequest, ehrComposition, encounters);
return procedureRequest;
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ReferralRequestMapper method mapToReferralRequest.
public ReferralRequest mapToReferralRequest(RCMRMT030101UK04EhrComposition ehrComposition, RCMRMT030101UK04RequestStatement requestStatement, Patient patient, List<Encounter> encounters, String practiseCode) {
var referralRequest = new ReferralRequest();
var id = requestStatement.getId().get(0).getRoot();
referralRequest.setId(id);
referralRequest.setMeta(generateMeta(META_PROFILE));
referralRequest.getIdentifier().add(buildIdentifier(id, practiseCode));
referralRequest.setStatus(ReferralRequestStatus.UNKNOWN);
referralRequest.setIntent(ReferralCategory.ORDER);
referralRequest.getRequester().setAgent(ParticipantReferenceUtil.getParticipantReference(requestStatement.getParticipant(), ehrComposition));
referralRequest.setAuthoredOnElement(getAuthoredOn(requestStatement.getAvailabilityTime()));
referralRequest.setNote(getNotes(requestStatement));
referralRequest.setSubject(new Reference(patient));
setReferralRequestContext(referralRequest, ehrComposition, encounters);
setReferralRequestRecipient(referralRequest, requestStatement.getResponsibleParty());
setReferralRequestReasonCode(referralRequest, requestStatement.getCode());
return referralRequest;
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition 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.RCMRMT030101UK04EhrComposition 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.RCMRMT030101UK04EhrComposition 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;
}
Aggregations