use of org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel in project org.hl7.fhir.core by hapifhir.
the class ValueSetComparer method renderCompose.
public XhtmlNode renderCompose(ValueSetComparison csc, String id, String prefix) throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Item", "The type of item being compared", null, 100));
model.getTitles().add(gen.new Title(null, null, "Property", "The system for the concept", null, 100, 2));
model.getTitles().add(gen.new Title(null, null, "Value", "The display for the concept", null, 200, 2));
model.getTitles().add(gen.new Title(null, null, "Comments", "Additional information about the comparison", null, 200));
for (StructuralMatch<Element> t : csc.getIncludes().getChildren()) {
addComposeRow(gen, model.getRows(), t, "include");
}
for (StructuralMatch<Element> t : csc.getExcludes().getChildren()) {
addComposeRow(gen, model.getRows(), t, "exclude");
}
return gen.generate(model, prefix, 0, null);
}
use of org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel in project org.hl7.fhir.core by hapifhir.
the class ValueSetComparer method renderExpansion.
public XhtmlNode renderExpansion(ValueSetComparison csc, String id, String prefix) throws IOException {
if (csc.getExpansion() == null) {
XhtmlNode p = new XhtmlNode(NodeType.Element, "p");
p.tx("Unable to generate expansion - see errors");
return p;
}
if (csc.getExpansion().getChildren().isEmpty()) {
XhtmlNode p = new XhtmlNode(NodeType.Element, "p");
p.tx("Expansion is empty");
return p;
}
// columns: code(+system), version, display , abstract, inactive,
boolean hasSystem = csc.getExpansion().getChildren().isEmpty() ? false : getSystemVaries(csc.getExpansion(), csc.getExpansion().getChildren().get(0).either().getSystem());
boolean hasVersion = findVersion(csc.getExpansion());
boolean hasAbstract = findAbstract(csc.getExpansion());
boolean hasInactive = findInactive(csc.getExpansion());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
if (hasSystem) {
model.getTitles().add(gen.new Title(null, null, "System", "The code for the concept", null, 100));
}
model.getTitles().add(gen.new Title(null, null, "Code", "The system for the concept", null, 100));
model.getTitles().add(gen.new Title(null, null, "Display", "The display for the concept", null, 200, 2));
// if (hasVersion) {
// model.getTitles().add(gen.new Title(null, null, "Version", "The version for the concept", null, 200, 2));
// }
// if (hasAbstract) {
// model.getTitles().add(gen.new Title(null, null, "Abstract", "The abstract flag for the concept", null, 200, 2));
// }
// if (hasInactive) {
// model.getTitles().add(gen.new Title(null, null, "Inactive", "The inactive flag for the concept", null, 200, 2));
// }
model.getTitles().add(gen.new Title(null, null, "Comments", "Additional information about the comparison", null, 200));
for (StructuralMatch<ValueSetExpansionContainsComponent> t : csc.getExpansion().getChildren()) {
addExpansionRow(gen, model.getRows(), t, hasSystem, hasVersion, hasAbstract, hasInactive);
}
return gen.generate(model, prefix, 0, null);
}
use of org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel in project org.hl7.fhir.core by hapifhir.
the class ProfileUtilities method generateGrid.
public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
TableModel model = gen.initGridTable(corePath, profile.getId());
List<ElementDefinition> list = profile.getSnapshot().getElement();
List<StructureDefinition> profiles = new ArrayList<StructureDefinition>();
profiles.add(profile);
genGridElement(defFile == null ? null : defFile + "#", gen, model.getRows(), list.get(0), list, profiles, true, profileBaseFileName, null, corePath, imagePath, true, profile.getDerivation() == TypeDerivationRule.CONSTRAINT && usesMustSupport(list));
try {
return gen.generate(model, imagePath, 1, outputTracker);
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e.getMessage(), e);
}
}
use of org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel in project org.hl7.fhir.core by hapifhir.
the class ProfileUtilities method generateGrid.
public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
TableModel model = gen.initGridTable(corePath, profile.getId());
List<ElementDefinition> list = profile.getSnapshot().getElement();
List<StructureDefinition> profiles = new ArrayList<StructureDefinition>();
profiles.add(profile);
genGridElement(defFile == null ? null : defFile + "#", gen, model.getRows(), list.get(0), list, profiles, true, profileBaseFileName, null, corePath, imagePath, true, profile.getDerivation() == TypeDerivationRule.CONSTRAINT && usesMustSupport(list));
try {
return gen.generate(model, imagePath, 1, outputTracker);
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e.getMessage(), e);
}
}
use of org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel in project org.hl7.fhir.core by hapifhir.
the class ProfileUtilities method generateSpanningTable.
public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints, String constraintPrefix, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false, true);
gen.setTranslator(getTranslator());
TableModel model = initSpanningTable(gen, "", false, profile.getId());
Set<String> processed = new HashSet<String>();
SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix);
genSpanEntry(gen, model.getRows(), span);
return gen.generate(model, "", 0, outputTracker);
}
Aggregations