Search in sources :

Example 71 with StructureDefinition

use of org.hl7.fhir.r4b.model.StructureDefinition in project kindling by HL7.

the class ResourceParser method parseBinding.

private BindingSpecification parseBinding(OperationDefinitionParameterBindingComponent binding) throws IOException {
    BindingSpecification bs = new BindingSpecification("core", binding.getExtensionString(BuildExtensions.EXT_BINDING_NAME), "true".equals(binding.getExtensionString("http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding")));
    bs.setStrength(binding.getStrength());
    bs.setBindingMethod(BindingMethod.ValueSet);
    bs.setReference(binding.getValueSet());
    if (bs.hasReference()) {
        bs.setValueSet(loadValueSet(bs.getReference(), false));
    }
    if (binding.hasExtension("http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet")) {
        bs.setMaxReference(binding.getExtensionString("http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet"));
        bs.setMaxValueSet(loadValueSet(bs.getMaxReference(), false));
    }
    if (binding.hasExtension(BuildExtensions.EXT_V2_MAP)) {
        bs.setV2Map(binding.getExtensionString(BuildExtensions.EXT_V2_MAP));
    }
    if (binding.hasExtension(BuildExtensions.EXT_V3_MAP)) {
        bs.setV3Map(binding.getExtensionString(BuildExtensions.EXT_V3_MAP));
    }
    if (binding.hasExtension(BuildExtensions.EXT_DEFINITION)) {
        bs.setDefinition(binding.getExtensionString(BuildExtensions.EXT_DEFINITION));
    }
    if (binding.hasExtension(BuildExtensions.EXT_URI)) {
        bs.setUri(binding.getExtensionString(BuildExtensions.EXT_URI));
    }
    if (binding.hasExtension(BuildExtensions.EXT_WEBSITE)) {
        bs.setWebSite(binding.getExtensionString(BuildExtensions.EXT_WEBSITE));
    }
    if (binding.hasExtension(BuildExtensions.EXT_EMAIL)) {
        bs.setEmail(binding.getExtensionString(BuildExtensions.EXT_EMAIL));
    }
    if (binding.hasExtension(BuildExtensions.EXT_COPYRIGHT)) {
        bs.setCopyright(binding.getExtensionString(BuildExtensions.EXT_COPYRIGHT));
    }
    if (binding.hasExtension(BuildExtensions.EXT_CS_OID)) {
        bs.setCsOid(binding.getExtensionString(BuildExtensions.EXT_CS_OID));
    }
    if (binding.hasExtension(BuildExtensions.EXT_VS_OID)) {
        bs.setVsOid(binding.getExtensionString(BuildExtensions.EXT_VS_OID));
    }
    if (binding.hasExtension(BuildExtensions.EXT_STATUS)) {
        bs.setStatus(PublicationStatus.fromCode(binding.getExtensionString(BuildExtensions.EXT_STATUS)));
    }
    return bs;
}
Also used : BindingSpecification(org.hl7.fhir.definitions.model.BindingSpecification)

Example 72 with StructureDefinition

use of org.hl7.fhir.r4b.model.StructureDefinition in project kindling by HL7.

the class ResourceParser method parseTypeDefinition.

private TypeDefn parseTypeDefinition(ProfileUtilities pu, ElementDefinition focus, StructureDefinition sd) throws IOException {
    TypeDefn ed = new TypeDefn();
    parseED(pu, ed, focus, sd, "");
    return ed;
}
Also used : TypeDefn(org.hl7.fhir.definitions.model.TypeDefn)

Example 73 with StructureDefinition

use of org.hl7.fhir.r4b.model.StructureDefinition in project kindling by HL7.

the class ResourceParser method parseSearchParameter.

private void parseSearchParameter(ResourceDefn r, SearchParameter src) {
    if (!src.hasName()) {
        src.setName(src.getCode());
    }
    src.setVersion(version);
    SearchParameterDefn sp = new SearchParameterDefn(src.getCode(), src.getDescription(), type(src.getType()), src.getXpathUsage(), StandardsStatus.fromCode(BuildExtensions.readStringExtension(src, "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status")));
    r.getSearchParams().put(sp.getCode(), sp);
    sp.setExpression(src.getExpression());
    sp.setXPath(src.getXpath());
    sp.setResource(src);
    String s = BuildExtensions.readStringExtension(src, BuildExtensions.EXT_PATH);
    if (!Utilities.noString(s)) {
        for (String p : s.split("\\,")) {
            String v = p.trim();
            if (!Utilities.noString(v)) {
                sp.getPaths().add(v);
            }
        }
    }
    for (SearchParameterComponentComponent comp : src.getComponent()) {
        sp.getComposites().add(new CompositeDefinition(comp.getDefinition(), comp.getExpression()));
    }
}
Also used : SearchParameterDefn(org.hl7.fhir.definitions.model.SearchParameterDefn) CompositeDefinition(org.hl7.fhir.definitions.model.SearchParameterDefn.CompositeDefinition) SearchParameterComponentComponent(org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent)

Example 74 with StructureDefinition

use of org.hl7.fhir.r4b.model.StructureDefinition in project kindling by HL7.

the class XmlSpecGenerator method generateExtensionInner.

private void generateExtensionInner(StructureDefinition ed) throws IOException, Exception {
    ElementDefinition root = ed.getSnapshot().getElement().get(0);
    write("<!-- " + Utilities.escapeXml(ed.getName()) + " -->");
    write("<span style=\"float: right\"><a title=\"Documentation for this format\" href=\"" + prefix + "xml.html\"><img src=\"" + prefix + "help.png\" alt=\"doco\"/></a></span>\r\n");
    String rn = ed.getSnapshot().getElement().get(0).getIsModifier() ? "modifierExtension" : "extension";
    write("\r\n&lt;");
    if (defPage == null)
        write("<span title=\"" + Utilities.escapeXml(root.getDefinition()) + "\"><b>");
    else
        write("<a href=\"" + (defPage + "#" + root.getSliceName()) + "\" title=\"" + Utilities.escapeXml(root.getDefinition()) + "\" class=\"dict\"><b>");
    write(rn);
    if ((defPage == null))
        write("</b></span>");
    else
        write("</b></a>");
    write(" xmlns=\"http://hl7.org/fhir\"\r\n    ");
    generateExtensionAttribute(ed);
    write(" &gt;\r\n");
    List<ElementDefinition> children = getChildren(ed.getSnapshot().getElement(), ed.getSnapshot().getElement().get(0));
    boolean complex = isComplex(children);
    if (!complex)
        write("  &lt;!-- from Element: <a href=\"" + prefix + "extensibility.html\">extension</a> -->\r\n");
    for (ElementDefinition child : children) generateCoreElem(ed.getSnapshot().getElement(), child, 1, rn, false, complex);
    write("&lt;/");
    write(rn);
    write("&gt;\r\n");
}
Also used : ElementDefinition(org.hl7.fhir.r5.model.ElementDefinition)

Example 75 with StructureDefinition

use of org.hl7.fhir.r4b.model.StructureDefinition in project kindling by HL7.

the class XmlSpecGenerator method generateInner.

private void generateInner(StructureDefinition sd) throws IOException, Exception {
    ElementDefinition root = sd.getSnapshot().getElement().get(0);
    write("&lt;!-- " + Utilities.escapeXml(sd.getName()) + " -->");
    write("<span style=\"float: right\"><a title=\"Documentation for this format\" href=\"" + prefix + "xml.html\"><img src=\"" + prefix + "help.png\" alt=\"doco\"/></a></span>\r\n");
    String rn = sd.getSnapshot().getElement().get(0).getPath();
    write("\r\n&lt;");
    if (defPage == null)
        write("<span title=\"" + Utilities.escapeXml(root.getDefinition()) + "\"><b>");
    else
        write("<a href=\"" + (defPage + "#" + root.getSliceName()) + "\" title=\"" + Utilities.escapeXml(root.getDefinition()) + "\" class=\"dict\"><b>");
    write(rn);
    if ((defPage == null))
        write("</b></span>");
    else
        write("</b></a>");
    write(" xmlns=\"http://hl7.org/fhir\"\r\n&gt;\r\n");
    List<ElementDefinition> children = getChildren(sd.getSnapshot().getElement(), sd.getSnapshot().getElement().get(0));
    boolean complex = isComplex(children);
    if (!complex)
        write("  &lt;!-- from Element: <a href=\"" + prefix + "extensibility.html\">extension</a> -->\r\n");
    for (ElementDefinition child : children) generateCoreElem(sd.getSnapshot().getElement(), child, 1, rn, false, complex);
    write("&lt;/");
    write(rn);
    write("&gt;\r\n");
}
Also used : ElementDefinition(org.hl7.fhir.r5.model.ElementDefinition)

Aggregations

ArrayList (java.util.ArrayList)307 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)241 FHIRException (org.hl7.fhir.exceptions.FHIRException)226 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)158 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)144 StructureDefinition (org.hl7.fhir.r4b.model.StructureDefinition)105 ValidationMessage (org.hl7.fhir.utilities.validation.ValidationMessage)98 IOException (java.io.IOException)91 StructureDefinition (org.hl7.fhir.dstu3.model.StructureDefinition)91 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)87 StructureDefinition (org.hl7.fhir.r4.model.StructureDefinition)83 ElementDefinition (org.hl7.fhir.dstu3.model.ElementDefinition)70 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)69 ElementDefinition (org.hl7.fhir.r4b.model.ElementDefinition)67 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)58 ElementDefinition (org.hl7.fhir.r4.model.ElementDefinition)56 TypeRefComponent (org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent)50 Piece (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece)49 ProfileUtilities (org.hl7.fhir.r5.conformance.ProfileUtilities)46 Cell (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell)46