FQL 4

This features and syntax changes have been added in FQL in version 4.

4.0

Select only

Make it possible to write a query that only has a select-clause, allowing a much more simple query in some cases. It would look like this:

    select <field>, <field>

Which would be a semantic equivalent of

    from Resource 
    select <field>, <field>

TypeName Function

Add typename() as a default function to determine the type of a resource.

Fetch queries

This feature is in preview and syntax might change in the future. The Fetch syntax allows following a reference to another resource. Not all implementations of FQL allow this, since it requires a lot of infrastructure to make this work (fast enough).

from
    Patient
select
    practitioner fetch name

4.1

Allow users to create a link with a title, using a subnode 'href' + 'text'. This is not a syntax feature, but a feature of the table renderer.

4.2

External variables

Allow variables from the outside to be injected in Query Executor, making those variables available to every FhirPath statement in FQL.

4.3

String keys

Allows the key (name) of a field be expressed as a string, to allow spaces in titles.

    'title of field' : value

4.4

Brackets in FhirPath expressions

the expression (typename() in ('StructureDefinition' | 'ValueSet')).not() was not allowed. Brackets can now be part of a path-segment.

Fields function

The fields() function lists all available fields for the current node.

Added a link(<element>) and link(<element>, <title>) function, which will make documentation link for the element. Mostly used for references.

4.5

Top level For-clause

Replace the top-level for-query with a for-clause, and let the top level select take over the role of select in the for-query. This allows the use of for-queries followed by other filter-queries. As a result, this also allowes repeated for-queries:

    for rest.resource where type = 'DocumentReference'
    for searchParam select name