\n", name, name, name
);
html.append(header);
return this;
}
public HtmlBuilder buildOverviewHeader(String name) {
String header = String.format(
"
\n
%s
\n", name
);
html.append(header);
return this;
}
public HtmlBuilder buildParagraph(String content) {
html.append("
").append(content).append("
\n");
return this;
}
public HtmlBuilder buildTableStart() {
html.append("
\n").append("Field | Card. | Type | Description |
\n");
return this;
}
public HtmlBuilder buildTableEnd() {
html.append("
\n");
return this;
}
public HtmlBuilder buildOverviewTableStart() {
html.append("
\n").append("FHIR Type | CQL Type |
\n");
return this;
}
public HtmlBuilder buildOverviewTableEnd() {
html.append("
\n");
return this;
}
public HtmlBuilder buildRow(boolean mustSupport, boolean isModifier, boolean qicoreExt,
String field, String card, String type,
String description)
{
String row = String.format(
"
%s%s%s%s | %s | %s | %s |
---|
\n", mustSupport ? mustSupportIcon : "",
isModifier ? modifierIcon : "", qicoreExt ? extensionIcon : "", field, card, type, description
);
html.append(row);
return this;
}
public HtmlBuilder buildOverviewRow(String fhirType, String cqlType, String href) {
String row = String.format(
"
%s | %s |
---|
\n", fhirType, href, cqlType
);
html.append(row);
return this;
}
public HtmlBuilder buildOverviewRowWithInterval(String fhirType, String cqlType, String href) {
String intervalUrl = atlas.getCqlIntervalUrl();
String row = String.format(
"
%s | Interval<%s> |
---|
\n", intervalUrl, fhirType, href, cqlType
);
html.append(row);
return this;
}
public HtmlBuilder appendHtml(String content) {
html.append(content);
return this;
}
public static String buildLink(String href, String label) {
if (href == null) {
return String.format("
%s", "", label);
}
try {
URI uri = new URI(href);
if (uri.isAbsolute()) {
return String.format("
%s", href, label);
}
} catch (URISyntaxException use) {
// ignore
}
return String.format("
%s", href, label);
}
public static String buildNewTabLink(String href, String label) {
return String.format("
%s", href, label);
}
public static String buildBinding(String href, String label, String strength) {
if (href.contains("us/core/ValueSet/")) {
href = href.replace("ValueSet/", "ValueSet-") + ".html";
}
else if (href.contains("http://hl7.org/fhir/us/qicore/ValueSet/")) {
href = href.replace("http://hl7.org/fhir/us/qicore/ValueSet/", "../ValueSet-") + ".html";
}
String binding = "
Binding: ";
binding += String.format("
%s ", href, label);
switch (strength) {
case "required":
binding += "(
required)";
break;
case "extensible":
binding += "(
extensible)";
break;
case "preferred":
binding += "(
preferred)";
break;
case "example":
binding += "(
example)";
break;
}
return binding;
}
// public HtmlBuilder buildRowWithBinding(boolean mustSupport, boolean isModifier, boolean qicoreExt,
// String field, String title, String card, String type,
// String description, String binding)
// {
// String row = String.format(
// "
%s | %s | %s | %s\nBinding: %s |
\n", title, field, card, type, description, binding
// );
// html.append(row);
// return this;
// }
}