Follow content reference when rendering XML resources

This commit is contained in:
Grahame Grieve 2022-02-19 21:46:05 +11:00
parent 4923382138
commit 98ba40748e
1 changed files with 13 additions and 3 deletions

View File

@ -553,7 +553,17 @@ public class ProfileUtilities extends TranslatingUtilities {
} }
public List<ElementDefinition> getChildList(StructureDefinition structure, ElementDefinition element) { public List<ElementDefinition> getChildList(StructureDefinition structure, ElementDefinition element) {
return getChildList(structure, element.getPath(), element.getId(), false); if (element.hasContentReference()) {
ElementDefinition target = element;
for (ElementDefinition t : structure.getSnapshot().getElement()) {
if (t.getId().equals(element.getContentReference().substring(1))) {
target = t;
}
}
return getChildList(structure, target.getPath(), target.getId(), false);
} else {
return getChildList(structure, element.getPath(), element.getId(), false);
}
} }
public void updateMaps(StructureDefinition base, StructureDefinition derived) throws DefinitionException { public void updateMaps(StructureDefinition base, StructureDefinition derived) throws DefinitionException {
@ -3680,7 +3690,7 @@ public class ProfileUtilities extends TranslatingUtilities {
} }
private String codeForAggregation(AggregationMode a) { public static String codeForAggregation(AggregationMode a) {
switch (a) { switch (a) {
case BUNDLED : return "b"; case BUNDLED : return "b";
case CONTAINED : return "c"; case CONTAINED : return "c";
@ -3689,7 +3699,7 @@ public class ProfileUtilities extends TranslatingUtilities {
} }
} }
private String hintForAggregation(AggregationMode a) { public static String hintForAggregation(AggregationMode a) {
if (a != null) if (a != null)
return a.getDefinition(); return a.getDefinition();
else else