use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.
the class PageProcessor method expandVS.
public String expandVS(ValueSet vs, String prefix, String base) {
try {
ValueSetExpansionOutcome result = workerContext.expandVS(vs, true, true);
if (result.getError() != null)
return "<hr/>\r\n" + VS_INC_START + "<!--3-->" + processExpansionError(result.getError()) + VS_INC_END;
if (result.getValueset() == null)
return "<hr/>\r\n" + VS_INC_START + "<!--4-->" + processExpansionError("(no error returned)") + VS_INC_END;
ValueSet exp = result.getValueset();
if (exp == vs)
throw new Exception("Expansion cannot be the same instance");
exp.setCompose(null);
exp.setText(null);
exp.setDescription("Value Set Contents (Expansion) for " + vs.present() + " at " + Config.DATE_FORMAT().format(new Date()));
int i = countContains(exp.getExpansion().getContains());
IniFile sini = new IniFile(Utilities.path(folders.rootDir, "temp", "stats.ini"));
sini.setIntegerProperty("valuesets", vs.getId(), i, null);
sini.save();
RenderingContext lrc = rc.copy().setLocalPrefix(prefix).setTooCostlyNoteEmpty(TOO_MANY_CODES_TEXT_EMPTY).setTooCostlyNoteNotEmpty(TOO_MANY_CODES_TEXT_NOT_EMPTY);
RendererFactory.factory(exp, lrc).render(exp);
return "<hr/>\r\n" + VS_INC_START + "" + new XhtmlComposer(XhtmlComposer.HTML).compose(exp.getText().getDiv()) + VS_INC_END;
} catch (Exception e) {
e.printStackTrace();
return "<hr/>\r\n" + VS_INC_START + "<!--5-->" + processExpansionError(e instanceof NullPointerException ? "NullPointerException" : e.getMessage()) + " " + Utilities.escapeXml(stack(e)) + VS_INC_END;
}
}
use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.
the class PageProcessor method pdHeader.
private String pdHeader(String mode) {
StringBuilder b = new StringBuilder();
b.append("<ul class=\"nav nav-tabs\">");
b.append(makeHeaderTab("Parameter Definition", "parameterdefinition.html", mode == null || "base".equals(mode)));
b.append(makeHeaderTab("Examples", "parameterdefinition-examples.html", mode == null || "examples".equals(mode)));
b.append(makeHeaderTab("Detailed Descriptions", "parameterdefinition-definitions.html", mode == null || "definitions".equals(mode)));
b.append(makeHeaderTab("Mappings", "parameterdefinition-mappings.html", mode == null || "mappings".equals(mode)));
b.append("</ul>\r\n");
return b.toString();
}
use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.
the class PageProcessor method dtHeader.
private String dtHeader(String mode) {
StringBuilder b = new StringBuilder();
b.append("<ul class=\"nav nav-tabs\">");
b.append(makeHeaderTab("Data Types", "datatypes.html", mode == null || "base".equals(mode)));
b.append(makeHeaderTab("Examples", "datatypes-examples.html", mode == null || "examples".equals(mode)));
b.append(makeHeaderTab("Detailed Descriptions", "datatypes-definitions.html", mode == null || "definitions".equals(mode)));
b.append(makeHeaderTab("Mappings", "datatypes-mappings.html", mode == null || "mappings".equals(mode)));
b.append(makeHeaderTab("Profiles and Extensions", "datatypes-extras.html", mode == null || "extras".equals(mode)));
b.append(makeHeaderTab("R3 Conversions", "datatypes-version-maps.html", mode == null || "conversions".equals(mode)));
b.append("</ul>\r\n");
return b.toString();
}
use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.
the class PageProcessor method genOperationInner.
public void genOperationInner(String n, String id, boolean mixed, StandardsStatus resStatus, String prefix, String np, StringBuilder b, Operation op, boolean header) throws Exception {
if (header)
b.append("<h3>").append(Utilities.escapeXml(op.getTitle())).append("<a name=\"").append(op.getName()).append("\"> </a></h3>\r\n");
if (mixed)
b.append(opStandardsStatusNotice(n, op.getStandardsStatus(), resStatus, np, prefix) + "\r\n");
b.append(processMarkdown(n, op.getDoco(), prefix, true) + "\r\n");
b.append("<p>The official URL for this operation definition is</p>\r\n<pre> http://hl7.org/fhir/OperationDefinition/" + n + "-" + op.getName() + "</pre>\r\n");
b.append("<p><a href=\"operation-" + id + "-" + op.getName().toLowerCase() + ".html\">Formal Definition</a> (as a <a href=\"" + prefix + "operationdefinition.html\">OperationDefinition</a>).</p>\r\n");
if (op.isSystem())
b.append("<p>URL: [base]/$").append(op.getName()).append("</p>\r\n");
if (op.isType())
b.append("<p>URL: [base]/").append(checkWrap(n)).append("/$").append(op.getName()).append("</p>\r\n");
if (op.isInstance())
b.append("<p>URL: [base]/").append(checkWrap(n)).append("/[id]/$").append(op.getName()).append("</p>\r\n");
if (op.getIdempotent())
b.append("<p>This is an idempotent operation</p>\r\n");
else
b.append("<p>This is <b>not</b> an idempotent operation</p>\r\n");
if (!op.getParameters().isEmpty()) {
b.append("<table class=\"grid\">\r\n");
if (hasParameters(op.getParameters(), "In")) {
genParameterHeader(b, "In");
for (OperationParameter p : op.getParameters()) genOperationParameter(n, "In", "", b, op, p, prefix);
}
if (hasParameters(op.getParameters(), "Out")) {
genParameterHeader(b, "Out");
for (OperationParameter p : op.getParameters()) genOperationParameter(n, "Out", "", b, op, p, prefix);
}
b.append("</table>\r\n");
}
b.append(processMarkdown(n, op.getFooter(), prefix)).append("\r\n");
if (op.getExamples().size() > 0) {
b.append("<a name=\"examples\"> </a>\r\n<h4>Examples</h4>\r\n");
boolean needsHr = false;
boolean hasHr = false;
for (OperationExample ex : op.getExamples()) if (!ex.isResponse()) {
needsHr = true;
renderExample(b, ex, "Request");
}
for (OperationExample ex : op.getExamples()) if (ex.isResponse()) {
if (needsHr && !hasHr) {
hasHr = true;
b.append("<hr/>\r\n");
}
renderExample(b, ex, "Response");
}
}
if (!Utilities.noString(op.getFooter2())) {
b.append(processMarkdown(n, op.getFooter2(), prefix)).append("\r\n");
boolean needsHr = false;
boolean hasHr = false;
if (op.getExamples2().size() > 0) {
for (OperationExample ex : op.getExamples2()) if (!ex.isResponse()) {
needsHr = true;
renderExample(b, ex, "Request");
}
for (OperationExample ex : op.getExamples2()) if (ex.isResponse()) {
if (needsHr && !hasHr) {
hasHr = true;
b.append("<hr/>\r\n");
}
renderExample(b, ex, "Response");
}
}
}
b.append("<p> </p>");
}
use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.
the class PageProcessor method adHeader.
private String adHeader(String mode) {
StringBuilder b = new StringBuilder();
b.append("<ul class=\"nav nav-tabs\">");
b.append(makeHeaderTab("Action Definition", "actiondefinition.html", mode == null || "base".equals(mode)));
b.append(makeHeaderTab("Examples", "actiondefinition-examples.html", mode == null || "examples".equals(mode)));
b.append(makeHeaderTab("Detailed Descriptions", "actiondefinition-definitions.html", mode == null || "definitions".equals(mode)));
b.append(makeHeaderTab("Mappings", "actiondefinition-mappings.html", mode == null || "mappings".equals(mode)));
b.append("</ul>\r\n");
return b.toString();
}
Aggregations