FQL

JSON structures

The FQL syntax allows you to put JSON blocks almost anywhere in your select statement. This allows grouping of fields, but also renaming of existing fields in the original data.

Renaming

This example shows you how you can rename the names of a patient:

from Patient
select
    firstname: name.given,
    lastname: name.family

firstnamelastname
Noamy; V.Shaw
Amy; K.Baba

Grouping

This example shows you how you can group fields:

from Patient
select
    metadata: {
        id,
        meta.profile
    }


when you define a named group, you can nest to any depth. Your 'position' in the resource you are getting data from, will not change . So with this example, you still access fields from the root of the resource. To descend into the resource, use a fhirpath expression, a for clause, or grouped unwrap.