Search in sources :

Example 1 with CapabilityStatementRestResourceOperationComponent

use of org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent in project ipf by oehf.

the class TestIti83Success method testGetConformance.

@Test
public void testGetConformance() {
    var conf = client.capabilities().ofType(CapabilityStatement.class).execute();
    assertEquals(1, conf.getRest().size());
    var component = conf.getRest().iterator().next();
    CapabilityStatementRestResourceOperationComponent operation = component.getResource().stream().filter(resource -> "Patient".equals(resource.getType())).flatMap(resource -> resource.getOperation().stream()).findFirst().get();
    assertEquals(Iti83Constants.PIXM_OPERATION_NAME.substring(1), operation.getName());
// printAsXML(conf);
}
Also used : FhirEventTypeCode(org.openehealth.ipf.commons.ihe.fhir.audit.codes.FhirEventTypeCode) CapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent) Identifier(org.hl7.fhir.r4.model.Identifier) StandardCharsets(java.nio.charset.StandardCharsets) Test(org.junit.jupiter.api.Test) org.openehealth.ipf.commons.audit.codes(org.openehealth.ipf.commons.audit.codes) CapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement) BeforeAll(org.junit.jupiter.api.BeforeAll) Iti83Constants(org.openehealth.ipf.commons.ihe.fhir.iti83.Iti83Constants) Assertions(org.junit.jupiter.api.Assertions) Parameters(org.hl7.fhir.r4.model.Parameters) AuditUtils(org.openehealth.ipf.commons.audit.utils.AuditUtils) FhirParticipantObjectIdTypeCode(org.openehealth.ipf.commons.ihe.fhir.audit.codes.FhirParticipantObjectIdTypeCode) CapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement) CapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent) Test(org.junit.jupiter.api.Test)

Example 2 with CapabilityStatementRestResourceOperationComponent

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

the class CapabilityStatementComparer method addRestOperationRow.

private Row addRestOperationRow(HierarchicalTableGenerator gen, List<Row> rows, StructuralMatch<Element> t, CapabilityStatementComparison comparison) {
    Row r = gen.new Row();
    rows.add(r);
    r.getCells().add(gen.new Cell(null, null, "operation", null, null));
    CapabilityStatementRestResourceOperationComponent left = t.hasLeft() ? (CapabilityStatementRestResourceOperationComponent) t.getLeft() : null;
    CapabilityStatementRestResourceOperationComponent right = t.hasRight() ? (CapabilityStatementRestResourceOperationComponent) t.getRight() : null;
    r.getCells().add(style(gen.new Cell(null, null, left != null ? left.getName() : "", null, null), left != null ? left.getName() : null, right != null ? right.getName() : null, true));
    r.getCells().add(style(gen.new Cell(null, null, left != null ? left.getDocumentation() : "", null, null), left != null ? left.getDocumentation() : null, right != null ? right.getDocumentation() : null, true));
    r.getCells().add(style(gen.new Cell(null, null, right != null ? right.getName() : "", null, null), left != null ? left.getName() : null, right != null ? right.getName() : null, false));
    r.getCells().add(style(gen.new Cell(null, null, right != null ? right.getDocumentation() : "", null, null), left != null ? left.getDocumentation() : null, right != null ? right.getDocumentation() : null, true));
    r.getCells().add(cellForMessages(gen, t.getMessages()));
    return r;
}
Also used : Row(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row) Cell(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell) CapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)

Example 3 with CapabilityStatementRestResourceOperationComponent

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

the class CapabilityStatementComparer method intersectOperations.

private CapabilityStatementRestResourceOperationComponent intersectOperations(CapabilityStatementRestResourceOperationComponent l, CapabilityStatementRestResourceOperationComponent r) {
    CapabilityStatementRestResourceOperationComponent res = new CapabilityStatementRestResourceOperationComponent();
    res.setName(l.getName());
    if (l.hasDocumentation() && r.hasDocumentation()) {
        res.setDocumentation(l.getDocumentation());
    }
    return res;
}
Also used : CapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)

Example 4 with CapabilityStatementRestResourceOperationComponent

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

the class CapabilityStatementComparer method compareOperations.

private void compareOperations(StructuralMatch<Element> combined, List<CapabilityStatementRestResourceOperationComponent> left, List<CapabilityStatementRestResourceOperationComponent> right, String path, CapabilityStatementComparison res, List<CapabilityStatementRestResourceOperationComponent> union, List<CapabilityStatementRestResourceOperationComponent> intersection) {
    List<CapabilityStatementRestResourceOperationComponent> matchR = new ArrayList<>();
    for (CapabilityStatementRestResourceOperationComponent l : left) {
        CapabilityStatementRestResourceOperationComponent r = findInList(right, l);
        if (r == null) {
            union.add(l);
            combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this Search Parameter", path)));
        } else {
            matchR.add(r);
            CapabilityStatementRestResourceOperationComponent cdM = mergeOperations(l, r);
            CapabilityStatementRestResourceOperationComponent cdI = intersectOperations(l, r);
            union.add(cdM);
            intersection.add(cdI);
            StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
            compareStrings(path, sm.getMessages(), l.getDocumentation(), r.getDocumentation(), "documentation", IssueSeverity.INFORMATION, res);
            compareItemProperty(sm, "definition", l.getDefinitionElement(), r.getDefinitionElement(), path, res, cdM.getDefinitionElement(), cdI.getDefinitionElement(), IssueSeverity.ERROR);
            compareExpectations(sm, l, r, path, res, cdM, cdI);
            combined.getChildren().add(sm);
        }
    }
    for (CapabilityStatementRestResourceOperationComponent r : right) {
        if (!matchR.contains(r)) {
            union.add(r);
            combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this Search Parameter", path), r));
        }
    }
}
Also used : BackboneElement(org.hl7.fhir.r4b.model.BackboneElement) Element(org.hl7.fhir.r4b.model.Element) ArrayList(java.util.ArrayList) CapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)

Example 5 with CapabilityStatementRestResourceOperationComponent

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

the class CapabilityStatementComparer method intersectOperations.

private CapabilityStatementRestResourceOperationComponent intersectOperations(CapabilityStatementRestResourceOperationComponent l, CapabilityStatementRestResourceOperationComponent r) {
    CapabilityStatementRestResourceOperationComponent res = new CapabilityStatementRestResourceOperationComponent();
    res.setName(l.getName());
    if (l.hasDocumentation() && r.hasDocumentation()) {
        res.setDocumentation(l.getDocumentation());
    }
    return res;
}
Also used : CapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)

Aggregations

ArrayList (java.util.ArrayList)4 CapabilityStatementRestResourceOperationComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)4 StringType (org.hl7.fhir.r4.model.StringType)3 CapabilityStatementRestResourceOperationComponent (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)3 CapabilityStatementRestResourceOperationComponent (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent)3 Nonnull (javax.annotation.Nonnull)2 CanonicalType (org.hl7.fhir.r4.model.CanonicalType)2 CapabilityStatement (org.hl7.fhir.r4.model.CapabilityStatement)2 CapabilityStatementRestResourceComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent)2 Cell (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell)2 Row (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row)2 StandardCharsets (java.nio.charset.StandardCharsets)1 Calendar (java.util.Calendar)1 CapabilityStatementImplementationComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent)1 CapabilityStatementRestComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent)1 CapabilityStatementRestSecurityComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent)1 CapabilityStatementSoftwareComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent)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