Hi
We have created a GIT repo with some issues from our experiences with AQL.
The repo was created to expose one issue with repeating items. You will find it 
here - and some feedback is welcome:

Folder with all files: 
https://github.com/bjornna/openehr-conformance/tree/master/aql/case1-permutations

README with the problem: 
https://github.com/bjornna/openehr-conformance/blob/master/aql/case1-permutations/index.adoc

The initial problem was this:

One simple example may be openEHR-EHR-OBSERVATION.body_weight.v1 which have an 
optional and repeating 'any_event'. Below is a straigt forward AQL on this 
archetype. We are asking for the origin from the HISTORY attribute, and then 
for each repeating event we want the weight magnitude and unit.
As you see from the AQL there is an additional WHERE clausul telling that we 
only want weight with magnitude less than 45.
The question is: What do you expect as result from this query?
select
        o/data[at0002]/origin/value as time,
        
o/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value/magnitude as 
Weight,
        o/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value/units as 
Unit
    from
        composition c
    contains
        observation o[openEHR-EHR-OBSERVATION.body_weight.v1]
    where
        
o/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value/magnitude < 45
    order by
        o/data[at0002]/origin/value desc


Vennlig hilsen
Bjørn Næss
Produktansvarlig
DIPS ASA

Mobil +47 93 43 29 10<tel:+47%2093%2043%2029%2010>

_______________________________________________
openEHR-implementers mailing list
openEHR-implementers@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-implementers_lists.openehr.org

Reply via email to