STATUS: this page is historical; its contents are now maintained as the official AQL specification.
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
...
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 |
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 |
| ||
> | Greater than |
| ||
>= | Greater than or equal to |
| ||
< | Smaller than |
| ||
<= | Smaller than or equal to |
| ||
!= | not equals to |
|
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.
...