fix bug rendering by profile

This commit is contained in:
Grahame Grieve 2020-05-29 17:44:36 +10:00
parent c4185492a5
commit 112b09d00d
1 changed files with 19 additions and 13 deletions

View File

@ -213,20 +213,22 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
boolean firstElement = true;
boolean last = false;
for (PropertyWrapper p : res.children()) {
ElementDefinition child = getElementDefinition(profile.getSnapshot().getElement(), path+"."+p.getName(), p);
if (p.getValues().size() > 0 && p.getValues().get(0) != null && child != null && isPrimitive(child) && includeInSummary(child)) {
if (firstElement)
firstElement = false;
else if (last)
x.tx("; ");
boolean first = true;
last = false;
for (BaseWrapper v : p.getValues()) {
if (first)
first = false;
if (!ignoreProperty(p)) {
ElementDefinition child = getElementDefinition(profile.getSnapshot().getElement(), path+"."+p.getName(), p);
if (p.getValues().size() > 0 && p.getValues().get(0) != null && child != null && isPrimitive(child) && includeInSummary(child)) {
if (firstElement)
firstElement = false;
else if (last)
x.tx(", ");
last = displayLeaf(res, v, child, x, p.getName(), showCodeDetails) || last;
x.tx("; ");
boolean first = true;
last = false;
for (BaseWrapper v : p.getValues()) {
if (first)
first = false;
else if (last)
x.tx(", ");
last = displayLeaf(res, v, child, x, p.getName(), showCodeDetails) || last;
}
}
}
}
@ -234,6 +236,10 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
}
private boolean ignoreProperty(PropertyWrapper p) {
return Utilities.existsInList(p.getName(), "contained");
}
private boolean includeInSummary(ElementDefinition child) {
if (child.getIsModifier())
return true;