...
A parameter can be used for all criteria values within an AQL statement, e.g.
- within a predicate
Archetype Query Language (AQL), at0003, $nameValue, ehr_id/value=$ehrId
- outside a predicate
No Format o/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/value>$systolicCriteria
Predicate
AQL has three types of predicates: standard predicate, archetype predicate, and node predicate.
...
- left operand is normally an openEHR path, such as ehr_id/value, name/value
- right operand is normally a criteria value or a parameter, such as '123456', $ehrUid. It can also be an openEHR path (based on the BNF), but we do not have an example of this situation yet.
- operators include:
No Format >, >=, =, <, <=, !=
Archetype predicate
Archetype predicate is a shortcut of standard predicate, i.e. the predicate does not have left operand and operator. It only has an archetype id, e.g. [openEHR-EHR-COMPOSITION.encounter.v1]. Archetype predicate is a specific type of query criteria 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,
...
- containing an archetype node id (known as atcode) only, e.g.
at0002 - containing an archetype node id and a name value criteria, e.g.
at0002 and name/value=$nameValue
at0002 and name/value='real name value' - containing an archetype node id and a shortcut of name value criteria, e.g.
at0002, $nameValue
at0002, 'real name value'
...