use of org.hl7.fhir.definitions.model.ResourceDefn in project kindling by HL7.
the class SchematronGenerator method generate.
public void generate(OutputStream out, ResourceDefn root, Definitions definitions) throws Exception {
SchematronWriter sch = new SchematronWriter(out, SchematronType.RESOURCE, root.getName());
insertGlobalRules(sch);
Section s = sch.section(root.getName());
ArrayList<String> parents = new ArrayList<String>();
generateInvariants(s, null, root.getRoot(), definitions, parents, root.getName());
sch.dump();
sch.close();
}
use of org.hl7.fhir.definitions.model.ResourceDefn in project kindling by HL7.
the class SchematronGenerator method generate.
public void generate(OutputStream out, Definitions definitions) throws Exception {
SchematronWriter sch = new SchematronWriter(out, SchematronType.ALL_RESOURCES, "All Resources");
insertGlobalRules(sch);
for (String rn : definitions.sortedResourceNames()) {
ResourceDefn root = definitions.getResources().get(rn);
Section s = sch.section(root.getName());
ArrayList<String> parents = new ArrayList<String>();
generateInvariants(s, null, root.getRoot(), definitions, parents, root.getName());
}
Set<StructureDefinition> processed = new HashSet<StructureDefinition>();
for (StructureDefinition exd : page.getWorkerContext().getExtensionDefinitions()) {
if (exd.getSnapshot().getElement().get(0).hasConstraint() && !processed.contains(exd)) {
processed.add(exd);
Section s = sch.section("Extension: " + exd.getName());
Rule r = s.rule("f:" + (exd.getSnapshot().getElementFirstRep().getIsModifier() ? "modifierExtension" : "extension") + "[@url='" + exd.getUrl() + "']");
for (ElementDefinitionConstraintComponent inv : exd.getSnapshot().getElement().get(0).getConstraint()) {
if (!isGlobal(inv.getKey()))
r.assrt(inv.getXpath().replace("\"", "'"), inv.getKey() + ": " + inv.getHuman());
}
}
}
sch.dump();
sch.close();
}
use of org.hl7.fhir.definitions.model.ResourceDefn in project kindling by HL7.
the class SvgGenerator method generate.
public void generate(ResourceDefn resource, String filename, String id) throws Exception {
this.id = id;
classes.clear();
links.clear();
XMLWriter xml = new XMLWriter(new FileOutputStream(filename), "UTF-8");
generate(resource, xml);
}
use of org.hl7.fhir.definitions.model.ResourceDefn in project kindling by HL7.
the class MappingsGenerator method genInherited.
private void genInherited(StringBuilder s, ResourceDefn resource, String m) {
for (StringPair t : resource.getMappings(m)) {
s.append(" <tr><td><i>");
s.append(" ");
s.append(" (");
s.append(t.name.contains(".") ? t.name.substring(t.name.indexOf(".") + 1) : t.name);
s.append(")</i></td><td>" + Utilities.escapeXml(t.value).replace("\n", "<br/>\n") + "</td></tr>\r\n");
}
}
use of org.hl7.fhir.definitions.model.ResourceDefn in project kindling by HL7.
the class PageProcessor method genAllSearchParams.
private String genAllSearchParams() throws Exception {
List<SearchParameter> splist = new ArrayList<SearchParameter>();
for (ResourceDefn rd : getDefinitions().getBaseResources().values()) addSearchParams(splist, rd);
for (ResourceDefn rd : getDefinitions().getResources().values()) addSearchParams(splist, rd);
for (Profile cp : getDefinitions().getPackList()) {
addSearchParams(splist, cp);
}
StringBuilder b = new StringBuilder();
genSearchParams(b, splist, "Resource");
genSearchParams(b, splist, "DomainResource");
genCommonSearchParams(b, splist);
for (String n : definitions.sortedResourceNames()) genSearchParams(b, splist, n);
return b.toString();
}
Aggregations