fix rendering of extensions in Profiles

This commit is contained in:
Grahame Grieve 2022-07-22 11:23:30 +10:00
parent be51677623
commit 4800d8a498
2 changed files with 10 additions and 11 deletions

View File

@ -4229,14 +4229,16 @@ public class ProfileUtilities extends TranslatingUtilities {
Row currRow = row;
List<ElementChoiceGroup> groups = readChoices(element, children);
boolean isExtension = Utilities.existsInList(tail(element.getPath()), "extension", "modifierExtension");
for (ElementDefinition child : children) {
if (!child.hasSliceName()) {
currRow = row;
}
Row childRow = chooseChildRowByGroup(gen, currRow, groups, child, element, isConstraintMode);
if (logicalModel || !child.getPath().endsWith(".id") || (child.getPath().endsWith(".id") && (profile != null) && (profile.getDerivation() == TypeDerivationRule.CONSTRAINT))) {
currRow = genElement(defPath, gen, childRow.getSubRows(), child, all, profiles, showMissing, profileBaseFileName, isExtension, snapshot, corePath, imagePath, false, logicalModel, isConstraintMode, allInvariants, currRow, mustSupport, rc);
if (!element.prohibited()) {
for (ElementDefinition child : children) {
if (!child.hasSliceName()) {
currRow = row;
}
Row childRow = chooseChildRowByGroup(gen, currRow, groups, child, element, isConstraintMode);
if (logicalModel || !child.getPath().endsWith(".id") || (child.getPath().endsWith(".id") && (profile != null) && (profile.getDerivation() == TypeDerivationRule.CONSTRAINT))) {
currRow = genElement(defPath, gen, childRow.getSubRows(), child, all, profiles, showMissing, profileBaseFileName, isExtension, snapshot, corePath, imagePath, false, logicalModel, isConstraintMode, allInvariants, currRow, mustSupport, rc);
}
}
}
// if (!snapshot && (extensions == null || !extensions))

View File

@ -5107,9 +5107,6 @@ public class FHIRPathEngine {
return new ArrayList<Base>();
}
if (exp.parameterCount() == 2) {
if (i1+i2 >= sw.length()) {
return new ArrayList<Base>();
}
s = sw.substring(i1, Math.min(sw.length(), i1+i2));
} else {
s = sw.substring(i1);