Don't check FHIRPaths on differentials - not enough type info to test reliably

This commit is contained in:
Grahame Grieve 2023-07-21 21:18:38 +10:00
parent ce44ab27fe
commit 6350d9743e
1 changed files with 9 additions and 7 deletions

View File

@ -471,11 +471,13 @@ public class StructureDefinitionValidator extends BaseValidator {
}
// if we see fixed[x] or pattern[x] applied to a repeating element, we'll give the user a hint
}
List<Element> constraints = element.getChildrenByName("constraint");
int cc = 0;
for (Element invariant : constraints) {
ok = validateElementDefinitionInvariant(errors, invariant, stack.push(invariant, cc, null, null), invariantMap, elements, element, element.getNamedChildValue("path"), rootPath, profileUrl) && ok;
cc++;
if (snapshot) { // we just don't have enough information to figure out the context in a differential
List<Element> constraints = element.getChildrenByName("constraint");
int cc = 0;
for (Element invariant : constraints) {
ok = validateElementDefinitionInvariant(errors, invariant, stack.push(invariant, cc, null, null), invariantMap, elements, element, element.getNamedChildValue("path"), rootPath, profileUrl) && ok;
cc++;
}
}
return ok;
}
@ -504,7 +506,7 @@ public class StructureDefinitionValidator extends BaseValidator {
Element oldte = te;
te = getParent(elements, te);
if (te != null) {
exp = tail(oldte, te)+"."+exp;
exp = tail(oldte, te)+".all("+exp+")";
types = getTypesForElement(elements, te);
}
}