use of org.hl7.fhir.dstu3.model.ProcedureRequest in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ProcedureRequestMapperTest method mapProcedureRequestWithValidData.
@Test
public void mapProcedureRequestWithValidData() {
var ehrExtract = unmarshallCodeElement("full_valid_data_example.xml");
var planStatement = getPlanStatement(ehrExtract);
setUpCodeableConceptMock();
ProcedureRequest procedureRequest = procedureRequestMapper.mapToProcedureRequest(ehrExtract, getEhrComposition(ehrExtract), planStatement, SUBJECT, ENCOUNTERS, PRACTISE_CODE);
assertFixedValues(planStatement, procedureRequest);
assertThat(procedureRequest.getNoteFirstRep().getText()).isEqualTo(planStatement.getText());
assertThat(procedureRequest.getOccurrenceDateTimeType().getValue()).isEqualTo(DateFormatUtil.parseToDateTimeType(planStatement.getEffectiveTime().getCenter().getValue()).getValue());
assertThat(procedureRequest.getAuthoredOn()).isEqualTo(DateFormatUtil.parseToDateTimeType(planStatement.getAvailabilityTime().getValue()).getValue());
assertThat(procedureRequest.getReasonCodeFirstRep().getCodingFirstRep().getDisplay()).isEqualTo(planStatement.getCode().getDisplayName());
assertThat(procedureRequest.getRequester().getAgent().getReference()).isEqualTo("Practitioner/8D1610C2-5E48-4ED5-882B-5A4A172AFA35");
assertThat(procedureRequest.getContext().getResource().getIdElement().getValue()).isEqualTo(ENCOUNTER_ID);
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ProcedureRequestMapperTest method mapProcedureRequestWithEhrExtractAvailabilityTime.
@Test
public void mapProcedureRequestWithEhrExtractAvailabilityTime() {
var ehrExtract = unmarshallCodeElement("ehr_extract_availability_time_example.xml");
var planStatement = getPlanStatement(ehrExtract);
setUpCodeableConceptMock();
ProcedureRequest procedureRequest = procedureRequestMapper.mapToProcedureRequest(ehrExtract, getEhrComposition(ehrExtract), planStatement, SUBJECT, ENCOUNTERS, PRACTISE_CODE);
assertFixedValues(planStatement, procedureRequest);
assertThat(procedureRequest.getAuthoredOn()).isEqualTo(DateFormatUtil.parseToDateTimeType(ehrExtract.getAvailabilityTime().getValue()).getValue());
assertThat(procedureRequest.getReasonCodeFirstRep().getCodingFirstRep().getDisplay()).isEqualTo(planStatement.getCode().getDisplayName());
assertThat(procedureRequest.getContext().getResource().getIdElement().getValue()).isEqualTo(ENCOUNTER_ID);
}
Aggregations