Search in sources :

Example 6 with AdditionalBindingDetail

use of org.hl7.fhir.r5.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);
    }
}
Also used : Extension(org.hl7.fhir.r5.model.Extension) AdditionalBindingDetail(org.hl7.fhir.r5.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail)

Example 7 with AdditionalBindingDetail

use of org.hl7.fhir.r5.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);
}
Also used : AdditionalBindingDetail(org.hl7.fhir.r5.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail)

Example 8 with AdditionalBindingDetail

use of org.hl7.fhir.r5.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);
    }
}
Also used : Extension(org.hl7.fhir.r4b.model.Extension) AdditionalBindingDetail(org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail)

Example 9 with AdditionalBindingDetail

use of org.hl7.fhir.r5.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);
}
Also used : AdditionalBindingDetail(org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail)

Example 10 with AdditionalBindingDetail

use of org.hl7.fhir.r5.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");
            }
        }
    }
}
Also used : BindingResolution(org.hl7.fhir.r4b.conformance.ProfileUtilities.ProfileKnowledgeProvider.BindingResolution) DataRenderer(org.hl7.fhir.r4b.renderers.DataRenderer) AdditionalBindingDetail(org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Aggregations

AdditionalBindingDetail (org.hl7.fhir.r4b.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail)4 AdditionalBindingDetail (org.hl7.fhir.r5.conformance.AdditionalBindingsRenderer.AdditionalBindingDetail)4 BindingResolution (org.hl7.fhir.r4b.conformance.ProfileUtilities.ProfileKnowledgeProvider.BindingResolution)2 BindingResolution (org.hl7.fhir.r5.conformance.ProfileUtilities.ProfileKnowledgeProvider.BindingResolution)2 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)2 Extension (org.hl7.fhir.r4b.model.Extension)1 DataRenderer (org.hl7.fhir.r4b.renderers.DataRenderer)1 Extension (org.hl7.fhir.r5.model.Extension)1 DataRenderer (org.hl7.fhir.r5.renderers.DataRenderer)1