I stumbled upon the following expression:
select a_a/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value/magnitude as Temperature_magnitude, e/ehr_id/value, a_a/data[at0002]/events[at0003]/time/value as Time from EHR e contains COMPOSITION a contains OBSERVATION a_a[openEHR-EHR-OBSERVATION.body_temperature.v1] where Temperature_magnitude > 37 and Time>='2017-10-14T09:35:30+00:00'
In SQL, it is not possible to have Aliases inside WHERE clauses. I the spec, we don’t say much about aliases at the moment: " As in SQL,
AQL supports the use of a name alias for the retrieved data. This is done with the keyword
AS , followed by the name which conforms to the syntax rule of AQL variable."
Any strong opinions on this? In EHRbase such a query would fail at the moment