use of org.hl7.fhir.r4b.renderers.utils.BaseWrappers.PropertyWrapper in project org.hl7.fhir.core by hapifhir.
the class LibraryRenderer method participantRow.
private void participantRow(XhtmlNode t, String label, BaseWrapper cd, boolean email, boolean phone, boolean url) throws UnsupportedEncodingException, FHIRException, IOException {
XhtmlNode tr = t.tr();
tr.td().tx(label);
tr.td().tx(cd.get("name") != null ? cd.get("name").primitiveValue() : null);
PropertyWrapper telecoms = cd.getChildByName("telecom");
if (email) {
renderContactPoint(tr.td(), getContactPoint(telecoms, "email"));
}
if (phone) {
renderContactPoint(tr.td(), getContactPoint(telecoms, "phone"));
}
if (url) {
renderContactPoint(tr.td(), getContactPoint(telecoms, "url"));
}
}
use of org.hl7.fhir.r4b.renderers.utils.BaseWrappers.PropertyWrapper in project org.hl7.fhir.core by hapifhir.
the class ResourceRenderer method renderResourceHeader.
protected void renderResourceHeader(ResourceWrapper r, XhtmlNode x) throws UnsupportedEncodingException, FHIRException, IOException {
XhtmlNode div = x.div().style("display: inline-block").style("background-color: #d9e0e7").style("padding: 6px").style("margin: 4px").style("border: 1px solid #8da1b4").style("border-radius: 5px").style("line-height: 60%");
String id = getPrimitiveValue(r, "id");
String lang = getPrimitiveValue(r, "language");
String ir = getPrimitiveValue(r, "implicitRules");
BaseWrapper meta = r.getChildByName("meta").hasValues() ? r.getChildByName("meta").getValues().get(0) : null;
String versionId = getPrimitiveValue(meta, "versionId");
String lastUpdated = getPrimitiveValue(meta, "lastUpdated");
String source = getPrimitiveValue(meta, "source");
if (id != null || lang != null || versionId != null || lastUpdated != null) {
XhtmlNode p = plateStyle(div.para());
p.tx("Resource ");
if (id != null) {
p.tx("\"" + id + "\" ");
}
if (versionId != null) {
p.tx("Version \"" + versionId + "\" ");
}
if (lastUpdated != null) {
p.tx("Updated \"");
renderDateTime(p, lastUpdated);
p.tx("\" ");
}
if (lang != null) {
p.tx(" (Language \"" + lang + "\") ");
}
}
if (ir != null) {
plateStyle(div.para()).b().tx("Special rules apply: " + ir + "!");
}
if (source != null) {
plateStyle(div.para()).tx("Information Source: " + source + "!");
}
if (meta != null) {
PropertyWrapper pl = meta.getChildByName("profile");
if (pl.hasValues()) {
XhtmlNode p = plateStyle(div.para());
p.tx(Utilities.pluralize("Profile", pl.getValues().size()) + ": ");
boolean first = true;
for (BaseWrapper bw : pl.getValues()) {
if (first)
first = false;
else
p.tx(", ");
renderCanonical(r, p, bw.getBase().primitiveValue());
}
}
PropertyWrapper tl = meta.getChildByName("tag");
if (tl.hasValues()) {
XhtmlNode p = plateStyle(div.para());
p.tx(Utilities.pluralize("Tag", tl.getValues().size()) + ": ");
boolean first = true;
for (BaseWrapper bw : tl.getValues()) {
if (first)
first = false;
else
p.tx(", ");
String system = getPrimitiveValue(bw, "system");
String version = getPrimitiveValue(bw, "version");
String code = getPrimitiveValue(bw, "system");
String display = getPrimitiveValue(bw, "system");
renderCoding(p, new Coding(system, version, code, display));
}
}
PropertyWrapper sl = meta.getChildByName("security");
if (sl.hasValues()) {
XhtmlNode p = plateStyle(div.para());
p.tx(Utilities.pluralize("Security Label", tl.getValues().size()) + ": ");
boolean first = true;
for (BaseWrapper bw : sl.getValues()) {
if (first)
first = false;
else
p.tx(", ");
String system = getPrimitiveValue(bw, "system");
String version = getPrimitiveValue(bw, "version");
String code = getPrimitiveValue(bw, "system");
String display = getPrimitiveValue(bw, "system");
renderCoding(p, new Coding(system, version, code, display));
}
}
}
}
Aggregations