use of org.hl7.fhir.dstu3.model.ProcedureRequest in project integration-adaptor-111 by nhsconnect.
the class ProcedureRequestMapper method mapProcedureRequest.
public ProcedureRequest mapProcedureRequest(POCDMT000002UK01ClinicalDocument1 clinicalDocument, Reference patient, ReferralRequest referralRequest) {
ProcedureRequest procedureRequest = new ProcedureRequest();
if (clinicalDocument.isSetComponentOf()) {
if (clinicalDocument.getComponentOf().getEncompassingEncounter() != null) {
if (clinicalDocument.getComponentOf().getEncompassingEncounter().isSetDischargeDispositionCode()) {
Coding coding = new Coding();
CE dischargeCode = clinicalDocument.getComponentOf().getEncompassingEncounter().getDischargeDispositionCode();
if (dischargeCode.isSetDisplayName()) {
coding.setDisplay(dischargeCode.getDisplayName());
}
if (dischargeCode.isSetCode()) {
coding.setCode(dischargeCode.getCode());
}
if (dischargeCode.isSetCodeSystem()) {
coding.setSystem(dischargeCode.getCodeSystem());
}
if (StringUtils.isNotBlank(coding.getCode()) || StringUtils.isNotBlank(coding.getDisplay()) || StringUtils.isNotBlank(coding.getSystem())) {
procedureRequest.setIdElement(resourceUtil.newRandomUuid());
procedureRequest.setStatus(ProcedureRequest.ProcedureRequestStatus.ACTIVE).setIntent(ProcedureRequest.ProcedureRequestIntent.PLAN).setPriority(ProcedureRequest.ProcedureRequestPriority.ROUTINE).setCode(new CodeableConcept().addCoding(coding)).setSubject(patient).setDoNotPerform(false).setOccurrence(periodMapper.mapPeriod(clinicalDocument.getEffectiveTime())).setReasonReference(referralRequest.getReasonReference());
}
}
}
}
return procedureRequest;
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_procedurerequest_example.
@Test
public void test_procedurerequest_example() throws FileNotFoundException, IOException, Exception {
System.out.println("procedurerequest-example.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\procedurerequest-example.ttl"));
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest in project nia-patient-switching-standard-adaptor by NHSDigital.
the class UnknownPractitionerHandlerTest method updateUnknownPractitionersRefsAddUnknownOnce.
@Test
public void updateUnknownPractitionersRefsAddUnknownOnce() {
when(idGeneratorService.generateUuid()).thenReturn(UNKNOWN_PRACTITIONER_ID);
Bundle bundle = bundle(new Observation(), new ProcedureRequest(), ENCOUNTER_WITHOUT_RECORDER);
unknownPractitionerHandler.updateUnknownPractitionersRefs(bundle);
verifyUnknownPractitionerAdded(bundle);
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest 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.fhir.dstu3.model.ProcedureRequest in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ProcedureRequestMapperTest method mapProcedureRequestWithParticipant2.
@Test
public void mapProcedureRequestWithParticipant2() {
var ehrExtract = unmarshallCodeElement("participant2_example.xml");
var planStatement = getPlanStatement(ehrExtract);
setUpCodeableConceptMock();
ProcedureRequest procedureRequest = procedureRequestMapper.mapToProcedureRequest(ehrExtract, getEhrComposition(ehrExtract), planStatement, SUBJECT, ENCOUNTERS, PRACTISE_CODE);
assertFixedValues(planStatement, procedureRequest);
assertThat(procedureRequest.getReasonCodeFirstRep().getCodingFirstRep().getDisplay()).isEqualTo(planStatement.getCode().getDisplayName());
assertThat(procedureRequest.getRequester().getAgent().getReference()).isEqualTo("Practitioner/2D70F602-6BB1-47E0-B2EC-39912A59787D");
assertThat(procedureRequest.getContext().getResource().getIdElement().getValue()).isEqualTo(ENCOUNTER_ID);
}
Aggregations