-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should FHIRPath support non-standard properties #4177
Milestone
Comments
Actually, this could be done at runtime in the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A long time ago, we explicitly enabled reading non-standard properties via FHIRPath. IIRC, the motivating use case was using FHIRPath to read GraphQL properties.
Original PR: #708
Example:
That works today.
The reason I ask this question is that I recently ran a server profiling exercise, and noticed one of the highest CPU uses is
getTypedPropertyValueWithoutSchema
. The thing is,getTypedPropertyValueWithoutSchema
isn't supposed to be called from the server at all, because the server will always have the schema loaded.getTypedPropertyValueWithoutSchema
is an escape hatch for client-side code which may not have allStructureDefinition
resources loaded.It turns out that we're hitting the
getTypedPropertyValueWithoutSchema
due to theindividual-birthdate
SearchParameter
.Consider the input:
{ "resourceType": "Patient", "birthDate": "1990-01-01" }
Consider the FHIRPath expression:
Patient.birthDate | Person.birthDate | RelatedPerson.birthDate
Our FHIRPath engine evaluates each branch of the union:
Patient.birthDate
Patient
- matches the currentresourceType
, and carries onbirthDate
- reads the valuePerson.birthDate
Person
- does not matchresourceType
, so tries to readPerson
as a property (this could be skipped)RelatedPerson.birthDate
RelatedPerson
- does not matchresourceType
, so tries to readRelatedPerson
as a property (this could be skipped)Reading unrecognized properties is particularly expensive in
getTypedPropertyValueWithoutSchema
because it needs to try a bunch of choice-of-type[x]
permutations. Ultimately, this ends up being a bunch of wasted effort.So... We are ultimately burning a lot of CPU to support non-standard FHIRPath properties.
If we need to preserve this behavior, there are probably some other potential solutions:
[x]
code path when the token is lower case (which does have semantic meaning in FHIR)SearchParameter
expressions - the FHIR spec likes to use the|
union operator, but that's suboptimal for runtime performance. We could flatten those out.The text was updated successfully, but these errors were encountered: