use of org.hl7.fhir.dstu2016may.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;
}
use of org.hl7.fhir.dstu2016may.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;
}
use of org.hl7.fhir.dstu2016may.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()));
}
}
use of org.hl7.fhir.dstu2016may.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<");
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(" >\r\n");
List<ElementDefinition> children = getChildren(ed.getSnapshot().getElement(), ed.getSnapshot().getElement().get(0));
boolean complex = isComplex(children);
if (!complex)
write(" <!-- 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("</");
write(rn);
write(">\r\n");
}
use of org.hl7.fhir.dstu2016may.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("<!-- " + 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<");
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>\r\n");
List<ElementDefinition> children = getChildren(sd.getSnapshot().getElement(), sd.getSnapshot().getElement().get(0));
boolean complex = isComplex(children);
if (!complex)
write(" <!-- 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("</");
write(rn);
write(">\r\n");
}
Aggregations