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;
}
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));
}
}
}
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");
}
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));
}
}
}
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;
}
Aggregations