Stream: fhirpath
Topic: Navigation model questions
Paul Lynch (Jul 17 2018 at 16:58):
I have some questions about the tree in "2. Navigation model" on http://hl7.org/fhirpath/2018May/index.html,
1) Do I understand correctly that this tree represents the context (%context) against which the FHIRPath expression is evaluated?
2) When one has an expression like "Observation.code", will that pick up (at most) only one Observation's code (assuming the context is an Observation)?
3) Is it possible to have a situation in which the context might be both an Observation and a Patient, e.g., in part of a Questionnaire linked to an Observation for a particular patient?
4) (Which might answer 2 & 3): Since FHIRPath seems to operate on collections everywhere, is there really a single root in the navigation model, or might there be a collection of roots, i.e. a forest of trees?
Bryn Rhodes (Jul 17 2018 at 19:32):
1) Yes, FHIRPath expressions are evaluated against a context (the initial root node passed to the evaluation engine) and that node is always available via the %context
environment variable.
2) Yes, if the context is an Observation, a reference to the path code
will return codes for that Observation.
3) The context itself will always be a single root resource, but you can access other resources, either contained or through reference tracing using the .resolve()
function.
4) Yes, FHIRPath is collections everywhere, but there really is a single root node in which the path is evaluated. Passing a "list" of resources as the context root is not currently a supported use case.
Paul Lynch (Jul 17 2018 at 20:13):
Thanks, Bryn!
Last updated: Apr 12 2022 at 19:14 UTC