Functions
FQL ships with a few FHIRPath functions that are specifically created and tailored to FQL. They are part of the FQL core infrastructure, so you can use them wherever you use FQL. This page describes two of them: the link function and the fields function.
Link function
The link() function makes a link from any kind of (understood) reference. It optionally takes a title as a second parameter for the generated link. It works with three kinds of input:
A resource: link to the resource itself (or another resource) by providing it as the first parameter. The %context variable refers to the current resource.
link(%context)
link(%context, 'title')
A canonical: link to a resource by its canonical. The current scope is used to provide the full context.
link(meta.profile)
link(meta.profile, 'title')
A reference: link from a reference by passing the reference (a complex value) as the first parameter.
from Observation select link(performer)
from Observation select link(performer, 'title')
Note
FQL currently only has a link provider for Simplifier itself, so links cannot yet point to your guide pages. For downloaded guides, all links will still point to Simplifier. We are working on a feature called DocBridges that will let you create links to other targets, such as the pages within your own guide.
Fields
The fields() function helps you discover the structure of a resource, or of a field within a resource.
The following example shows, for each patient, a list of the fields in that resource:
from Patient select fields()
To list only the fields within a specific structure, apply it to that field:
from Patient select name.fields()
