Search in sources :

Example 6 with ResourceInteractionComponent

use of org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent in project org.hl7.fhir.core by hapifhir.

the class CapabilityStatementComparer method compareRestResourceInteractions.

private void compareRestResourceInteractions(StructuralMatch<Element> combined, CapabilityStatementRestResourceComponent left, CapabilityStatementRestResourceComponent right, String path, CapabilityStatementComparison res, CapabilityStatementRestResourceComponent union, CapabilityStatementRestResourceComponent intersection) {
    List<ResourceInteractionComponent> matchR = new ArrayList<>();
    for (ResourceInteractionComponent l : left.getInteraction()) {
        ResourceInteractionComponent r = findInList(right.getInteraction(), l);
        if (r == null) {
            union.getInteraction().add(l);
            combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path)));
        } else {
            matchR.add(r);
            ResourceInteractionComponent cdM = mergeRestResourceInteractions(l, r);
            ResourceInteractionComponent cdI = intersectRestResourceInteractions(l, r);
            union.getInteraction().add(cdM);
            intersection.getInteraction().add(cdI);
            StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
            compareStrings(path, sm.getMessages(), l.getDocumentation(), r.getDocumentation(), "documentation", IssueSeverity.INFORMATION, res);
            compareExpectations(sm, l, r, path, res, union, intersection);
            combined.getChildren().add(sm);
        }
    }
    for (ResourceInteractionComponent r : right.getInteraction()) {
        if (!matchR.contains(r)) {
            union.getInteraction().add(r);
            combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this concept", path), r));
        }
    }
}
Also used : ResourceInteractionComponent(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent) BackboneElement(org.hl7.fhir.r4b.model.BackboneElement) Element(org.hl7.fhir.r4b.model.Element) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)3 ResourceInteractionComponent (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent)3 ResourceInteractionComponent (org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent)2 Cell (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell)2 Row (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row)2 Nonnull (javax.annotation.Nonnull)1 CanonicalType (org.hl7.fhir.r4.model.CanonicalType)1 CapabilityStatementRestResourceComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent)1 CapabilityStatementRestResourceOperationComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)1 ResourceInteractionComponent (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent)1 CodeType (org.hl7.fhir.r4.model.CodeType)1 ResourceType (org.hl7.fhir.r4.model.Enumerations.ResourceType)1 StringType (org.hl7.fhir.r4.model.StringType)1 BackboneElement (org.hl7.fhir.r4b.model.BackboneElement)1 Element (org.hl7.fhir.r4b.model.Element)1 BackboneElement (org.hl7.fhir.r5.model.BackboneElement)1 Element (org.hl7.fhir.r5.model.Element)1