mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-09 06:14:45 +00:00
R5 FHIRPath engine fixes for polymorphism + update R4B FHIRPath engine to match R5
This commit is contained in:
parent
e73f79103c
commit
b9036524d5
File diff suppressed because it is too large
Load Diff
@ -1798,7 +1798,18 @@ public class FHIRPathEngine {
|
|||||||
} else if ((left.get(0) instanceof Element) && ((Element) left.get(0)).isDisallowExtensions()) {
|
} else if ((left.get(0) instanceof Element) && ((Element) left.get(0)).isDisallowExtensions()) {
|
||||||
result.add(new BooleanType(Utilities.capitalize(left.get(0).fhirType()).equals(tn) || ("System."+Utilities.capitalize(left.get(0).fhirType())).equals(tn)).noExtensions());
|
result.add(new BooleanType(Utilities.capitalize(left.get(0).fhirType()).equals(tn) || ("System."+Utilities.capitalize(left.get(0).fhirType())).equals(tn)).noExtensions());
|
||||||
} else {
|
} else {
|
||||||
result.add(new BooleanType(left.get(0).hasType(tn)).noExtensions());
|
if (left.get(0).fhirType().equals(tn)) {
|
||||||
|
result.add(new BooleanType(true).noExtensions());
|
||||||
|
} else {
|
||||||
|
StructureDefinition sd = worker.fetchTypeDefinition(left.get(0).fhirType());
|
||||||
|
while (sd != null) {
|
||||||
|
if (tn.equals(sd.getType())) {
|
||||||
|
return makeBoolean(true);
|
||||||
|
}
|
||||||
|
sd = worker.fetchResource(StructureDefinition.class, sd.getBaseDefinition());
|
||||||
|
}
|
||||||
|
return makeBoolean(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -4538,8 +4549,18 @@ public class FHIRPathEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (tn.startsWith("FHIR.")) {
|
} else if (tn.startsWith("FHIR.")) {
|
||||||
if (b.hasType(tn.substring(5))) {
|
String tnp = tn.substring(5);
|
||||||
result.add(b);
|
if (b.fhirType().equals(tnp)) {
|
||||||
|
result.add(b);
|
||||||
|
} else {
|
||||||
|
StructureDefinition sd = worker.fetchTypeDefinition(b.fhirType());
|
||||||
|
while (sd != null) {
|
||||||
|
if (tnp.equals(sd.getType())) {
|
||||||
|
result.add(b);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sd = worker.fetchResource(StructureDefinition.class, sd.getBaseDefinition());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user