Versions Compared

Key

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

...

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,

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

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

  • containing an archetype node id (known as atcode) only, e.g.
    No Format
    
    [at0002]
    
  • containing an archetype node id and a name value criteria, e.g.
    No Format
    
    [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.
    No Format
    
    [at0002, $nameValue

    ]
    [at0002, 'real name value']
    

...

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 AQL operators

...