I don’t think the expression is correctly defined in various reference search parameters when the search parameters are restricted to only certain types.
Take appointment as an example:
Appointment.location is a reference search parameter pointing to Appointment.participant.actor when actor is a Location resource (if I understood the spec correctly).
However, if you look at the expression of the search parameter (https://simplifier.net/CoreSearchParameters/Appointment-location/~json), the expression is defined as:
which will return all actors regardless of the element type. Should the expression be defined as:
instead as specified by FHIR Path (http://hl7.org/fhirpath/) section 3.2 Paths and polymorphic items?
When I tried that expression with the .NET FHIR SDK, I got error Unknown symbol ‘ofType’. Looks like it hasn’t been implemented yet.
The definition file does contain “Target” resource type, so the workaround could be done by the caller by filtering out the elements returned by FHIR path by examining the reference but that’s cumbersome too since it needs to analyze and the reference string and supports both internal and external references.
Is this a spec issue or am I misunderstanding the spec?