Search in sources :

Example 1 with CapabilityStatementRestSecurityComponent

use of org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent in project elexis-server by elexis.

the class ServerCapabilityStatementProvider method getSmartOnFhirCapabilityStatementRestSecurityComponent.

private CapabilityStatementRestSecurityComponent getSmartOnFhirCapabilityStatementRestSecurityComponent(HttpServletRequest theRequest) {
    CapabilityStatementRestSecurityComponent csrsc = new CapabilityStatementRestSecurityComponent();
    CodeableConcept smartOnFhirConcept = new CodeableConcept();
    Coding coding = new Coding();
    coding.setSystem("http://hl7.org/fhir/restful-security-service");
    coding.setCode("SMART-on-FHIR");
    smartOnFhirConcept.addCoding(coding);
    smartOnFhirConcept.setText("OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)");
    Extension oauthExtension = new Extension();
    oauthExtension.setUrl("http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris");
    Extension oauthTokenExtension = new Extension();
    oauthTokenExtension.setUrl("token");
    oauthTokenExtension.setValue(new UriType(keycloakDeployment.getTokenUrl()));
    oauthExtension.getExtension().add(oauthTokenExtension);
    // Extension oauthAuthorizeExtension = new Extension();
    // oauthAuthorizeExtension.setUrl("authorize");
    // oauthAuthorizeExtension.setValue(new UriType(keycloakDeployment.getAuthUrl()));
    // oauthExtension.getExtension().add(oauthAuthorizeExtension);
    // 
    // oauthRegisterExtension.setUrl("register");
    // oauthRegisterExtension.setValue(new UriType(baseUrl + "/openid/register"));
    // oauthExtension.getExtension().add(oauthRegisterExtension);
    // 
    // Extension oauthManageExtension = new Extension();
    // oauthManageExtension.setUrl("manage");
    // oauthManageExtension.setValue(new UriType(baseUrl + "/openid/manage"));
    // oauthExtension.getExtension().add(oauthManageExtension);
    csrsc.getService().add(smartOnFhirConcept);
    csrsc.getExtension().add(oauthExtension);
    return csrsc;
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Coding(org.hl7.fhir.r4.model.Coding) CapabilityStatementRestSecurityComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) UriType(org.hl7.fhir.r4.model.UriType)

Example 2 with CapabilityStatementRestSecurityComponent

use of org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent in project org.hl7.fhir.core by hapifhir.

the class CapabilityStatementComparer method compareRestSecurityService.

private void compareRestSecurityService(CapabilityStatementRestSecurityComponent left, CapabilityStatementRestSecurityComponent right, StructuralMatch<Element> combined, CapabilityStatementRestSecurityComponent union, CapabilityStatementRestSecurityComponent intersection, CapabilityStatement csU, CapabilityStatement csI, CapabilityStatementComparison res, String path) {
    List<CodeableConcept> matchR = new ArrayList<>();
    for (CodeableConcept l : left.getService()) {
        CodeableConcept r = findInList(right.getService(), l);
        if (r == null) {
            union.getService().add(l);
            combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path)));
        } else {
            matchR.add(r);
            CodeableConcept cdM = CodeableConcept.merge(l, r);
            CodeableConcept cdI = CodeableConcept.intersect(l, r);
            union.getService().add(cdM);
            intersection.getService().add(cdI);
            StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
            compare(sm, l, r, path, res);
            combined.getChildren().add(sm);
        }
    }
    for (CodeableConcept r : right.getService()) {
        if (!matchR.contains(r)) {
            union.getService().add(r);
            combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this concept", path), r));
        }
    }
}
Also used : BackboneElement(org.hl7.fhir.r4b.model.BackboneElement) Element(org.hl7.fhir.r4b.model.Element) ArrayList(java.util.ArrayList) CodeableConcept(org.hl7.fhir.r4b.model.CodeableConcept)

Example 3 with CapabilityStatementRestSecurityComponent

use of org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent in project org.hl7.fhir.core by hapifhir.

the class CapabilityStatementComparer method compareRestSecurity.

private void compareRestSecurity(CapabilityStatementRestComponent l, CapabilityStatementRestComponent r, StructuralMatch<Element> smp, CapabilityStatementRestSecurityComponent merge, CapabilityStatementRestSecurityComponent intersect, CapabilityStatement csU, CapabilityStatement csI, CapabilityStatementComparison res, String path) {
    CapabilityStatementRestSecurityComponent ls = l.hasSecurity() ? l.getSecurity() : null;
    CapabilityStatementRestSecurityComponent rs = r.hasSecurity() ? r.getSecurity() : null;
    StructuralMatch<Element> sm = new StructuralMatch<Element>(ls, rs);
    smp.getChildren().add(sm);
    compareBooleans(path, sm.getMessages(), l.getSecurity().getCorsElement(), r.getSecurity().getCorsElement(), "security.cors", IssueSeverity.WARNING, res);
    compareStrings(path, sm.getMessages(), l.getSecurity().getDescription(), r.getSecurity().getDescription(), "security.description", IssueSeverity.INFORMATION, res);
    compareRestSecurityService(ls, rs, sm, merge, intersect, csU, csI, res, path + ".security");
}
Also used : CapabilityStatementRestSecurityComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestSecurityComponent) BackboneElement(org.hl7.fhir.r4b.model.BackboneElement) Element(org.hl7.fhir.r4b.model.Element)

Example 4 with CapabilityStatementRestSecurityComponent

use of org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent in project org.hl7.fhir.core by hapifhir.

the class CapabilityStatementComparer method compareRestSecurityService.

private void compareRestSecurityService(CapabilityStatementRestSecurityComponent left, CapabilityStatementRestSecurityComponent right, StructuralMatch<Element> combined, CapabilityStatementRestSecurityComponent union, CapabilityStatementRestSecurityComponent intersection, CapabilityStatement csU, CapabilityStatement csI, CapabilityStatementComparison res, String path) {
    List<CodeableConcept> matchR = new ArrayList<>();
    for (CodeableConcept l : left.getService()) {
        CodeableConcept r = findInList(right.getService(), l);
        if (r == null) {
            union.getService().add(l);
            combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path)));
        } else {
            matchR.add(r);
            CodeableConcept cdM = CodeableConcept.merge(l, r);
            CodeableConcept cdI = CodeableConcept.intersect(l, r);
            union.getService().add(cdM);
            intersection.getService().add(cdI);
            StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
            compare(sm, l, r, path, res);
            combined.getChildren().add(sm);
        }
    }
    for (CodeableConcept r : right.getService()) {
        if (!matchR.contains(r)) {
            union.getService().add(r);
            combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this concept", path), r));
        }
    }
}
Also used : BackboneElement(org.hl7.fhir.r5.model.BackboneElement) Element(org.hl7.fhir.r5.model.Element) ArrayList(java.util.ArrayList) CodeableConcept(org.hl7.fhir.r5.model.CodeableConcept)

Example 5 with CapabilityStatementRestSecurityComponent

use of org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent in project org.hl7.fhir.core by hapifhir.

the class CapabilityStatementComparer method addRestSecurityRow.

private Row addRestSecurityRow(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, "security", null, null));
    CapabilityStatementRestSecurityComponent left = t.hasLeft() ? (CapabilityStatementRestSecurityComponent) t.getLeft() : null;
    CapabilityStatementRestSecurityComponent right = t.hasRight() ? (CapabilityStatementRestSecurityComponent) t.getRight() : null;
    r.getCells().add(style(gen.new Cell(null, null, left != null ? left.getCorsElement().primitiveValue() : "", null, null), left != null ? left.getCorsElement().primitiveValue() : null, right != null ? right.getCorsElement().primitiveValue() : null, true));
    r.getCells().add(style(gen.new Cell(null, null, left != null ? left.getDescription() : "", null, null), left != null ? left.getDescription() : null, right != null ? right.getDescription() : null, true));
    r.getCells().add(style(gen.new Cell(null, null, right != null ? right.getCorsElement().primitiveValue() : "", null, null), left != null ? left.getCorsElement().primitiveValue() : null, right != null ? right.getCorsElement().primitiveValue() : null, false));
    r.getCells().add(style(gen.new Cell(null, null, right != null ? right.getDescription() : "", null, null), left != null ? left.getDescription() : null, right != null ? right.getDescription() : null, true));
    r.getCells().add(cellForMessages(gen, t.getMessages()));
    return r;
}
Also used : CapabilityStatementRestSecurityComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent) Row(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row) Cell(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell)

Aggregations

CapabilityStatementRestSecurityComponent (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent)3 CapabilityStatementRestSecurityComponent (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent)3 ArrayList (java.util.ArrayList)2 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)2 Coding (org.hl7.fhir.r4.model.Coding)2 Extension (org.hl7.fhir.r4.model.Extension)2 UriType (org.hl7.fhir.r4.model.UriType)2 BackboneElement (org.hl7.fhir.r4b.model.BackboneElement)2 CapabilityStatementRestSecurityComponent (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestSecurityComponent)2 Element (org.hl7.fhir.r4b.model.Element)2 BackboneElement (org.hl7.fhir.r5.model.BackboneElement)2 Element (org.hl7.fhir.r5.model.Element)2 Cell (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell)2 Row (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row)2 OidcConfiguration (au.csiro.pathling.security.OidcConfiguration)1 FileOutputStream (java.io.FileOutputStream)1 Calendar (java.util.Calendar)1 Nonnull (javax.annotation.Nonnull)1 ProfileGenerator (org.hl7.fhir.definitions.generators.specification.ProfileGenerator)1 Operation (org.hl7.fhir.definitions.model.Operation)1