mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-10 14:54:46 +00:00
fix for renderer on ElementDefinition rendering - follow contentReference
This commit is contained in:
parent
d432cff826
commit
752918a80a
@ -6,8 +6,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||||
|
import org.hl7.fhir.exceptions.DefinitionException;
|
||||||
import org.hl7.fhir.exceptions.FHIRException;
|
import org.hl7.fhir.exceptions.FHIRException;
|
||||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||||
|
import org.hl7.fhir.r5.conformance.ProfileUtilities.ElementDefinitionResolution;
|
||||||
import org.hl7.fhir.r5.elementmodel.Element;
|
import org.hl7.fhir.r5.elementmodel.Element;
|
||||||
import org.hl7.fhir.r5.elementmodel.XmlParser;
|
import org.hl7.fhir.r5.elementmodel.XmlParser;
|
||||||
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
||||||
@ -83,9 +85,17 @@ public class ElementWrappers {
|
|||||||
element.getNamedChildrenWithWildcard(name, elements);
|
element.getNamedChildrenWithWildcard(name, elements);
|
||||||
else
|
else
|
||||||
element.getNamedChildren(name, elements);
|
element.getNamedChildren(name, elements);
|
||||||
|
if (child.hasContentReference()) {
|
||||||
|
ElementDefinitionResolution nchild = context.getProfileUtilities().resolveContentRef(structure, child);
|
||||||
|
if (nchild == null) {
|
||||||
|
throw new DefinitionException("Unable to resolve content reference "+child.getContentReference());
|
||||||
|
}
|
||||||
|
list.add(new PropertyWrapperMetaElement(context, nchild.getSource(), nchild.getElement(), elements));
|
||||||
|
} else {
|
||||||
list.add(new PropertyWrapperMetaElement(context, structure, child, elements));
|
list.add(new PropertyWrapperMetaElement(context, structure, child, elements));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,9 +295,10 @@ public class ElementWrappers {
|
|||||||
public List<BaseWrapper> getValues() {
|
public List<BaseWrapper> getValues() {
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList<BaseWrapper>();
|
list = new ArrayList<BaseWrapper>();
|
||||||
for (Element e : values)
|
for (Element e : values) {
|
||||||
list.add(new BaseWrapperMetaElement(context, e, e.fhirType(), structure, definition));
|
list.add(new BaseWrapperMetaElement(context, e, e.fhirType(), structure, definition));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user