use of org.hl7.v3.RCMRMT030101UK04EhrExtract in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConditionMapperTest method testConditionIsMappedCorrectlyWithRelatedClinicalContentReference.
@Test
public void testConditionIsMappedCorrectlyWithRelatedClinicalContentReference() {
when(dateTimeMapper.mapDateTime(any())).thenReturn(EHR_EXTRACT_AVAILABILITY_DATETIME);
final RCMRMT030101UK04EhrExtract ehrExtract = unmarshallEhrExtract("linkset_valid.xml");
final List<Condition> conditions = conditionMapper.mapResources(ehrExtract, patient, List.of(), PRACTISE_CODE);
conditionMapper.addReferences(buildBundleWithStatementRefObservations(), conditions, ehrExtract);
assertThat(conditions).isNotEmpty();
assertThat(conditions.get(0).getExtensionsByUrl(RELATED_CLINICAL_CONTENT_URL)).isNotEmpty();
assertRelatedClinicalContentExtension(conditions.get(0));
}
use of org.hl7.v3.RCMRMT030101UK04EhrExtract in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConditionMapperTest method testLinkSetWithNoDatesIsMappedCorrectly.
@Test
public void testLinkSetWithNoDatesIsMappedCorrectly() {
final RCMRMT030101UK04EhrExtract ehrExtract = unmarshallEhrExtract("linkset_no_dates.xml");
final List<Condition> conditions = conditionMapper.mapResources(ehrExtract, patient, List.of(), PRACTISE_CODE);
assertGeneratedComponentsAreCorrect(conditions.get(0));
assertThat(conditions.get(0).getId()).isEqualTo(LINKSET_ID);
assertThat(conditions.get(0).getClinicalStatus().getDisplay()).isEqualTo("Inactive");
assertThat(conditions.get(0).getAbatementDateTimeType()).isNull();
assertThat(conditions.get(0).getAssertedDateElement().getValue()).isEqualTo(EHR_EXTRACT_AVAILABILITY_DATETIME.getValue());
}
use of org.hl7.v3.RCMRMT030101UK04EhrExtract in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConditionMapperTest method testConditionIsMappedCorrectlyWithActualProblemReference.
@Test
public void testConditionIsMappedCorrectlyWithActualProblemReference() {
when(dateTimeMapper.mapDateTime(any())).thenReturn(EHR_EXTRACT_AVAILABILITY_DATETIME);
final RCMRMT030101UK04EhrExtract ehrExtract = unmarshallEhrExtract("linkset_valid.xml");
final List<Condition> conditions = conditionMapper.mapResources(ehrExtract, patient, List.of(), PRACTISE_CODE);
conditionMapper.addReferences(buildBundleWithNamedStatementObservation(), conditions, ehrExtract);
assertThat(conditions).isNotEmpty();
assertThat(conditions.get(0).getExtensionsByUrl(ACTUAL_PROBLEM_URL)).isNotEmpty();
assertActualProblemExtension(conditions.get(0));
}
Aggregations