fix FHIRPath .is(type) to handle abstract types

This commit is contained in:
Grahame Grieve 2022-10-05 21:17:40 +11:00
parent 21848fc9af
commit ae8bc3502f
1 changed files with 12 additions and 1 deletions

View File

@ -4503,7 +4503,18 @@ public class FHIRPathEngine {
return makeBoolean(false);
}
} else if (ns.equals("FHIR")) {
return makeBoolean(n.equals(focus.get(0).fhirType()));
if (n.equals(focus.get(0).fhirType())) {
return makeBoolean(true);
} else {
StructureDefinition sd = worker.fetchTypeDefinition(focus.get(0).fhirType());
while (sd != null) {
if (n.equals(sd.getType())) {
return makeBoolean(true);
}
sd = worker.fetchResource(StructureDefinition.class, sd.getBaseDefinition());
}
return makeBoolean(false);
}
} else {
return makeBoolean(false);
}