use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConsultationListMapper method mapToCategory.
public ListResource mapToCategory(ListResource topic, RCMRMT030101UK04CompoundStatement compoundStatement) {
ListResource category = new ListResource();
category.setStatus(ListStatus.CURRENT).setMode(ListMode.SNAPSHOT).setTitle(getTitle(compoundStatement)).setCode(CodeableConceptUtils.createCodeableConcept(CATEGORY_CODE_CODE, LIST_CODE_SYSTEM, CATEGORY_CODE_DISPLAY, null)).setEncounter(topic.getEncounter()).setSubject(topic.getSubject()).setDateElement(getDate(compoundStatement, topic)).setOrderedBy(CodeableConceptUtils.createCodeableConcept(LIST_ORDERED_BY_CODE, LIST_ORDERED_BY_SYSTEM, LIST_ORDERED_BY_DISPLAY, null)).setMeta(generateMeta(LIST_META_PROFILE)).setId(compoundStatement.getId().get(0).getRoot());
return category;
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class EncounterMapper method generateCategoryLists.
private void generateCategoryLists(RCMRMT030101UK04CompoundStatement topicCompoundStatement, ListResource topic, List<ListResource> categories) {
var categoryCompoundStatements = getCategoryCompoundStatements(topicCompoundStatement);
categoryCompoundStatements.forEach(categoryCompoundStatement -> {
var category = consultationListMapper.mapToCategory(topic, categoryCompoundStatement);
List<Reference> entryReferences = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromCompoundStatement(categoryCompoundStatement, entryReferences);
entryReferences.forEach(reference -> addEntry(category, reference));
topic.addEntry(new ListEntryComponent(new Reference(category)));
categories.add(category);
});
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ResourceReferenceUtilTest method testTemplateResourcesReferencedAtCompoundStatementLevel.
@Test
public void testTemplateResourcesReferencedAtCompoundStatementLevel() {
final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement("compound_statement_template.xml");
List<Reference> references = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromCompoundStatement(compoundStatement, 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");
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ResourceReferenceUtilTest method testResourcesReferencedAtCompoundStatementLevel.
@ParameterizedTest
@MethodSource("compoundStatementResourceFiles")
public void testResourcesReferencedAtCompoundStatementLevel(String inputXML, String referenceString) {
final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement(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.extractChildReferencesFromCompoundStatement(compoundStatement, references);
assertThat(references.size()).isOne();
assertThat(references.get(0).getReference()).isEqualTo(referenceString);
}
use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ResourceFilterUtilTest method testIsDiagnosticReportResource.
@Test
public void testIsDiagnosticReportResource() {
final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement("diagnostic_report_resource.xml");
assertThat(ResourceFilterUtil.isDiagnosticReport(compoundStatement)).isTrue();
}
Aggregations