Skip to main content

Query parameters

Queries often require dynamic inputs (such as date, EHR ID, or template name) to serve as a generic query for different patients or scenarios. To achieve this, you can parameterize your queries by introducing AQL parameters to your query. Parameters serve as placeholders and are replaced in-place with the provided value when the query is executed. To introduce a parameter, simply use a colon followed by a parameter name. For example, :ehrId could be employed to parameterize an EHR ID used to retrieve data for a particular patient. The AQL builder is designed to automatically detect any parameters within the query and shows you a section on the right side of the interface where you can input a test values for each parameter.

warning
The parameter name is case-sensitive and must be unique within the query.
info
The openEHR specification dictates the use of $ to denote a parameter. However, an improved implementation of AQL was introduced prior to the finalization of the specification, where : is assumed as the default notation for parameters. If you prefer to use the $ notation, you can enable it on the Better Platform. Once enabled, the AQL builder will seamlessly recognize both $ and : as parameter markers.