Support descendents analysing fhirpath types
This commit is contained in:
parent
fe2b06031a
commit
b37c40419e
|
@ -5503,10 +5503,11 @@ public class FHIRPathEngine {
|
||||||
if (dt == null) {
|
if (dt == null) {
|
||||||
throw makeException(expr, I18nConstants.FHIRPATH_NO_TYPE, ProfileUtilities.sdNs(t.getCode(), worker.getOverrideVersionNs()), "getChildTypesByName");
|
throw makeException(expr, I18nConstants.FHIRPATH_NO_TYPE, ProfileUtilities.sdNs(t.getCode(), worker.getOverrideVersionNs()), "getChildTypesByName");
|
||||||
}
|
}
|
||||||
sdl.add(dt);
|
addTypeAndDescendents(sdl, dt, worker.allStructures());
|
||||||
|
// also add any descendant types
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sdl.add(sd);
|
addTypeAndDescendents(sdl, sd, worker.allStructures());
|
||||||
if (type.contains("#")) {
|
if (type.contains("#")) {
|
||||||
tail = type.substring(type.indexOf("#")+1);
|
tail = type.substring(type.indexOf("#")+1);
|
||||||
tail = tail.substring(tail.indexOf("."));
|
tail = tail.substring(tail.indexOf("."));
|
||||||
|
@ -5596,6 +5597,15 @@ public class FHIRPathEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addTypeAndDescendents(List<StructureDefinition> sdl, StructureDefinition dt, List<StructureDefinition> types) {
|
||||||
|
sdl.add(dt);
|
||||||
|
for (StructureDefinition sd : types) {
|
||||||
|
if (sd.hasBaseDefinition() && sd.getBaseDefinition().equals(dt.getUrl()) && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) {
|
||||||
|
addTypeAndDescendents(sdl, sd, types);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void getClassInfoChildTypesByName(String name, TypeDetails result) {
|
private void getClassInfoChildTypesByName(String name, TypeDetails result) {
|
||||||
if (name.equals("namespace")) {
|
if (name.equals("namespace")) {
|
||||||
result.addType(TypeDetails.FP_String);
|
result.addType(TypeDetails.FP_String);
|
||||||
|
|
Loading…
Reference in New Issue