use of org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail in project org.hl7.fhir.core by hapifhir.
the class AdditionalBindingsRenderer method seeAdditionalBindings.
public void seeAdditionalBindings(List<Extension> list) {
for (Extension ext : list) {
AdditionalBindingDetail abr = new AdditionalBindingDetail();
abr.purpose = ext.getExtensionString("purpose");
abr.valueSet = ext.getExtensionString("valueSet");
abr.doco = ext.getExtensionString("documentation");
abr.usage = (ext.hasExtension("usage")) && ext.getExtensionByUrl("usage").hasValueUsageContext() ? ext.getExtensionByUrl("usage").getValueUsageContext() : null;
abr.any = "any".equals(ext.getExtensionString("scope"));
abr.unchanged = ext.hasUserData(ProfileUtilities.DERIVATION_EQUALS);
bindings.add(abr);
}
}
use of org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail in project org.hl7.fhir.core by hapifhir.
the class AdditionalBindingsRenderer method seeMinBinding.
public void seeMinBinding(Extension ext) {
AdditionalBindingDetail abr = new AdditionalBindingDetail();
abr.purpose = "minimum";
abr.valueSet = ext.getValue().primitiveValue();
abr.unchanged = ext.hasUserData(ProfileUtilities.DERIVATION_EQUALS);
bindings.add(abr);
}
use of org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail in project org.hl7.fhir.core by hapifhir.
the class AdditionalBindingsRenderer method seeAdditionalBindings.
public void seeAdditionalBindings(List<Extension> list) {
for (Extension ext : list) {
AdditionalBindingDetail abr = new AdditionalBindingDetail();
abr.purpose = ext.getExtensionString("purpose");
abr.valueSet = ext.getExtensionString("valueSet");
abr.doco = ext.getExtensionString("documentation");
abr.usage = (ext.hasExtension("usage")) && ext.getExtensionByUrl("usage").hasValueUsageContext() ? ext.getExtensionByUrl("usage").getValueUsageContext() : null;
abr.any = "any".equals(ext.getExtensionString("scope"));
abr.unchanged = ext.hasUserData(ProfileUtilities.DERIVATION_EQUALS);
bindings.add(abr);
}
}
use of org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail in project org.hl7.fhir.core by hapifhir.
the class AdditionalBindingsRenderer method seeMinBinding.
public void seeMinBinding(Extension ext) {
AdditionalBindingDetail abr = new AdditionalBindingDetail();
abr.purpose = "minimum";
abr.valueSet = ext.getValue().primitiveValue();
abr.unchanged = ext.hasUserData(ProfileUtilities.DERIVATION_EQUALS);
bindings.add(abr);
}
use of org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail in project org.hl7.fhir.core by hapifhir.
the class AdditionalBindingsRenderer method render.
private void render(List<XhtmlNode> children, boolean doDoco) throws FHIRFormatError, DefinitionException, IOException {
boolean doco = false;
boolean usage = false;
boolean any = false;
for (AdditionalBindingDetail binding : bindings) {
doco = doco || (doDoco && binding.doco != null);
usage = usage || binding.usage != null;
any = any || binding.any;
}
XhtmlNode tr = new XhtmlNode(NodeType.Element, "tr");
children.add(tr);
tr.td().style("font-size: 11px").b().tx("Additional Bindings");
tr.td().style("font-size: 11px").tx("Purpose");
if (usage) {
tr.td().style("font-size: 11px").tx("Usage");
}
if (any) {
tr.td().style("font-size: 11px").tx("Any");
}
if (doco) {
tr.td().style("font-size: 11px").tx("Documentation");
}
for (AdditionalBindingDetail binding : bindings) {
tr = new XhtmlNode(NodeType.Element, "tr");
if (binding.unchanged) {
tr.style("opacity: 0.5");
}
children.add(tr);
BindingResolution br = pkp == null ? makeNullBr(binding) : pkp.resolveBinding(profile, binding.valueSet, path);
if (br.url != null) {
tr.td().style("font-size: 11px").ah(Utilities.isAbsoluteUrl(br.url) || !pkp.prependLinks() ? br.url : corePath + br.url, binding.valueSet).tx(br.display);
} else {
tr.td().style("font-size: 11px").span(null, binding.valueSet).tx(br.display);
}
renderPurpose(tr.td().style("font-size: 11px"), binding.purpose);
if (usage) {
if (binding.usage != null) {
new DataRenderer(context).render(tr.td(), binding.usage);
} else {
tr.td();
}
}
if (any) {
if (binding.any) {
tr.td().style("font-size: 11px").tx("Any repeat");
} else {
tr.td().style("font-size: 11px").tx("All repeats");
}
}
if (doco) {
if (binding.doco != null) {
String d = md.processMarkdown("Binding.description", binding.doco);
tr.td().style("font-size: 11px").innerHTML(d);
} else {
tr.td().style("font-size: 11px");
}
}
}
}
Aggregations