Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

STATUS: this page is historical; its contents are now maintained as the official AQL specification.


Table of Contents
maxLevel3
indent20px
styledisc

...

Archetype path is the path referring to any nodes within an archetype. The picture below is an ADL workbench screen shot of apgar observation node map. The table below shows some examples.

Archetype RM type

Archetype node name

Path syntax

OBSERVATION

Apgar score

/

OBSERVATION

1 minute

/data[at0002]/events[at0003]

OBSERVATION

Heart rate

/data[at0002]/events[at0003]/data[at0001]/items[at0005]

openEHR path examples - path to RM class attributes

Another type of openEHR path is the path pointing to an attribute of openEHR Reference Model classes. The examples shown below uses the attributes from COMPOSITION class.

OpenEHR RM attribute name

Path syntax

COMPOSITION.category

/category

COMPOSITION.context.start_time

/context/start_time

COMPOSITION.uid.value

/uid/value

AQL variables

AQL variables are used to refer a specific archetype or openEHR class defined within an AQL statement. It has following featueres:

...

An archetype predicate is a shortcut of a standard predicate, i.e. the predicate does not have the left operand and operator. It only has an archetype id, e.g. [openEHR-EHR-COMPOSITION.encounter.v1]. The archetype predicate is a specific type of query criterion indicating what archetype instances are relevant to this query. It is used to scope the the data source from which the query expected data is to be retrieved. Therefore, an archetype predicate is only used within an AQL FROM clause, for example,

FROM EHR [ehr_id/value='1234'] CONTAINS COMPOSITION c [openEHR-EHR-COMPOSITION.encounter.v1] CONTAINS
OBSERVATION o [openEHR-EHR-OBSERVATION.blood_pressure.v1]

Node predicate

A node predicate is also a shortcut of a standard predicate. It has the following forms:

...

The table below shows the basic AQL operators, meaning and example.

Operator

Meaning

Example

=

Equal

No Format
name/value = $nameValue

>

Greater than

No Format
o/data[at0001]/.../data[at0003]/items[at0004]/value/value >140

>=

Greater than or equal to

No Format
o/data[at0001]/..../data[at0003]/items[at0004]/value/value >=140

<

Smaller than

No Format
o/data[at0001]/.../data[at0003]/items[at0004]/value/value <160

<=

Smaller than or equal to

No Format
o/data[at0001]/.../data[at0003]/items[at0004]/value/value <=160

!=

not equals to

No Format
c/archetype_details/template_id/value != ''

Advanced operators

matches

...

These advanced operators are not yet supported by the grammar. The operator syntax is borrowed from ADL specifications. These are proposed to improve the richness and flexibility of AQL so that AQL syntax supports more complicated query scenarios.

...