use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ResourceReferenceUtilTest method testResourcesReferencedAtEhrCompositionLevel.
@ParameterizedTest
@MethodSource("ehrCompositionResourceFiles")
public void testResourcesReferencedAtEhrCompositionLevel(String inputXML, String referenceString) {
final RCMRMT030101UK04EhrComposition ehrComposition = unmarshallEhrCompositionElement(inputXML);
lenient().when(immunizationChecker.isImmunization(any())).thenAnswer(new Answer<Boolean>() {
@Override
public Boolean answer(InvocationOnMock invocation) throws Throwable {
String input = (String) invocation.getArgument(0);
return input.equals("1664081000000114");
}
});
List<Reference> references = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromEhrComposition(ehrComposition, references);
assertThat(references.size()).isOne();
assertThat(references.get(0).getReference()).isEqualTo(referenceString);
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ResourceReferenceUtilTest method testMedicationResourcesReferencedAtEhrCompositionLevel.
@Test
public void testMedicationResourcesReferencedAtEhrCompositionLevel() {
final RCMRMT030101UK04EhrComposition ehrComposition = unmarshallEhrCompositionElement("ehr_composition_medication.xml");
List<Reference> references = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromEhrComposition(ehrComposition, references);
assertThat(references.size()).isEqualTo(THREE);
assertThat(references.get(0).getReference()).isEqualTo("MedicationStatement/A0A70B62-2649-4C8F-B3AB-618B8257C942-MS");
assertThat(references.get(1).getReference()).isEqualTo("MedicationRequest/A0A70B62-2649-4C8F-B3AB-618B8257C942");
assertThat(references.get(2).getReference()).isEqualTo("MedicationRequest/9B4B797A-D674-4362-B666-2ADC8551EEDA");
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ResourceReferenceUtilTest method testTemplateChildResourcesReferencedAsQuestionnaireAnswers.
@Test
public void testTemplateChildResourcesReferencedAsQuestionnaireAnswers() {
final RCMRMT030101UK04EhrComposition ehrComposition = unmarshallEhrCompositionElement("ehr_composition_template.xml");
List<Reference> references = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromTemplate(ehrComposition.getComponent().get(0).getCompoundStatement(), references);
assertThat(references.size()).isEqualTo(2);
assertThat(references.get(0).getReference()).isEqualTo("Observation/3DCC9FC9-1873-4004-9789-C4E5C52B02B9");
assertThat(references.get(1).getReference()).isEqualTo("Observation/278ADD5F-2AC7-48DC-966A-0BA7C029C793");
}
use of org.hl7.v3.RCMRMT030101UK04EhrComposition in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ResourceReferenceUtilTest method testTemplateResourcesReferencedAtEhrCompositionLevel.
@Test
public void testTemplateResourcesReferencedAtEhrCompositionLevel() {
final RCMRMT030101UK04EhrComposition ehrComposition = unmarshallEhrCompositionElement("ehr_composition_template.xml");
List<Reference> references = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromEhrComposition(ehrComposition, references);
assertThat(references.size()).isEqualTo(FOUR);
assertThat(references.get(0).getReference()).isEqualTo("QuestionnaireResponse/7334D39A-BBB3-424A-B5D3-E841BCA39BF7-QRSP");
assertThat(references.get(1).getReference()).isEqualTo("Observation/7334D39A-BBB3-424A-B5D3-E841BCA39BF7");
assertThat(references.get(2).getReference()).isEqualTo("Observation/3DCC9FC9-1873-4004-9789-C4E5C52B02B9");
assertThat(references.get(THREE).getReference()).isEqualTo("Observation/278ADD5F-2AC7-48DC-966A-0BA7C029C793");
}
Aggregations