Repository navigation
Description
This issue proposes a limited implementation of the resolve() function that supports type checking without actually resolving references.
Background
The FHIR search parameter expressions frequently use resolve() in combination with the is type operator to filter references by their target type. For example:
Appointment.participant.actor.where(resolve() is Location)
Person.link.target.where(resolve() is Practitioner)
DeviceAssociation.subject.where(resolve() is Patient)
These expressions are used to identify references that point to specific resource types, without needing to traverse into the referenced resource.
Proposed implementation
Implement a limited resolve() function with the following characteristics:
-
Returns type information only - The function returns a collection that exposes the type of the referenced resource, derived from:
- The explicit
Reference.typeelement (if present) - The type from the logical reference string
- The explicit
-
Supports
isoperator for type checking - The result can be used with theisoperator to check if the reference targets a specific resource type. -
Does not support traversal - Attempting to traverse into child elements of the resolved reference throws an
UnsupportedFhirPathFeatureError. This avoids the complexity of joining across resources. -
Does not perform actual resolution - The function does not join to or load the referenced resource.
Example behaviour
// Supported - returns references that target Location resources
Appointment.participant.actor.where(resolve() is Location)
// Supported - type check returns boolean
Appointment.participant.actor.resolve() is Patient
// NOT supported - throws UnsupportedFhirPathFeatureError
Appointment.participant.actor.resolve().name
Scope
This implementation would enable 16 search parameter expressions that use the pattern reference.where(resolve() is TypeName). Note that these tests also require #2383 (type operators) and #2398 (union operator) to fully pass, as the search parameter expressions combine multiple features.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat: Implement limited resolve() function for FHIRPath references
feat: Implement limited resolve() function for FHIRPath references