FQL

FQL

This Guide is the documentation for FQL, the Firely Query Language.

What is FQL

FQL is a query language that allows you to retrieve, filter and project data from any data source containing FHIR Resources. It brings the power of three existing languages: SQL, JSON and FhirPath.

Use case

The primary use case for FQL is to provide users who write Imlementation Guides in Simplifier with a tool to generate up-to-date tables of data that can only be found inside resources.

Implementation Guides

You can execute an FQL query in your documentation by writing a query, between a these delimiters: starting with an at sign followed by three back ticks. And ending it with three back ticks.

    @​```
    from Patient
    select name.given
    ```

(we use normal ticks here, to avoid triggering it being rendered in this page)

Because we are adding more special render types to Simplifier, we now have xml tags for these cases. For FQL you can use:

    <fql​>
        from Patient
        select name.given
    </fql​>

Firely Terminal

Although the primary goal is to make tables from FHIR data, FQL can be used in a much broader scope and can cast data into almost any form. FQL is also implemented in Firely Terminal - a command line tool that is your swiss army knife for operating with FHIR resources. You can execute FQL queries on your own projects, using a statement like this:

> fhir query "from Patient select name.given"

Status

The basics of FQL is now at version 3. We're still doing further exploration to achieve our primary goal: to give as much power to the user, without bringing complexity. The non technical user should be able to use it for simple use cases. While advanced user should not be limited.