use of org.hl7.fhir.r4b.model.CapabilityStatement 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.r4b.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.
the class ComparisonRenderer method render.
public File render(String leftName, String rightName) throws IOException {
dumpBinaries();
StringBuilder b = new StringBuilder();
b.append("<table class=\"grid\">\r\n");
b.append(" <tr>\r\n");
b.append(" <td width=\"260\"><b>" + Utilities.escapeXml(leftName) + "</b></td>\r\n");
b.append(" <td width=\"260\"><b>" + Utilities.escapeXml(rightName) + "</b></td>\r\n");
b.append(" <td width=\"100\"><b>Difference</b></td>\r\n");
b.append(" <td width=\"260\"><b>Notes</b></td>\r\n");
b.append(" </tr>\r\n");
List<String> list = sorted(session.getCompares().keySet());
processList(list, b, "CodeSystem");
processList(list, b, "ValueSet");
processList(list, b, "StructureDefinition");
processList(list, b, "CapabilityStatement");
b.append("</table>\r\n");
Map<String, Base> vars = new HashMap<>();
vars.put("title", new StringType(session.getTitle()));
vars.put("list", new StringType(b.toString()));
String template = templates.get("Index");
String cnt = processTemplate(template, "CodeSystem", vars);
TextFile.stringToFile(cnt, file("index.html"));
return new File(file("index.html"));
}
use of org.hl7.fhir.r4b.model.CapabilityStatement 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.r4b.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.
the class OpenApiGenerator method generate.
public void generate(String license, String url) {
dest.info().title(source.present()).description(source.getDescription()).license(license, url).version(source.getVersion());
for (ContactDetail cd : source.getContact()) {
dest.info().contact(cd.getName(), email(cd.getTelecom()), url(cd.getTelecom()));
}
if (source.hasPublisher())
dest.info().contact(source.getPublisher(), null, null);
if (source.hasImplementation()) {
dest.server(source.getImplementation().getUrl()).description(source.getImplementation().getDescription());
}
dest.externalDocs().url(source.getUrl()).description("FHIR CapabilityStatement");
for (CapabilityStatementRestComponent csr : source.getRest()) {
if (csr.getMode() == RestfulCapabilityMode.SERVER) {
generatePaths(csr);
}
}
writeBaseParameters(dest.components());
}
use of org.hl7.fhir.r4b.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.
the class DataRenderer method isCanonical.
private boolean isCanonical(String path) {
if (!path.endsWith(".url"))
return false;
String t = path.substring(0, path.length() - 4);
StructureDefinition sd = getContext().getWorker().fetchTypeDefinition(t);
if (sd == null)
return false;
if (Utilities.existsInList(t, VersionUtilities.getCanonicalResourceNames(getContext().getWorker().getVersion()))) {
return true;
}
if (Utilities.existsInList(t, "ActivityDefinition", "CapabilityStatement", "CapabilityStatement2", "ChargeItemDefinition", "Citation", "CodeSystem", "CompartmentDefinition", "ConceptMap", "ConditionDefinition", "EventDefinition", "Evidence", "EvidenceReport", "EvidenceVariable", "ExampleScenario", "GraphDefinition", "ImplementationGuide", "Library", "Measure", "MessageDefinition", "NamingSystem", "PlanDefinition"))
return true;
return sd.getBaseDefinitionElement().hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-codegen-super");
}
Aggregations