Hello,
In order to better understand the semantics of AQL I try to rephrase the problem I have: Imagine an archetype "openEHR-EHR-CLUSTER.example.v1" that allows the multiple existence of a specific contained field:

definition
    CLUSTER[at0000] matches {
        items cardinality matches {0..*; unordered} matches {
            ELEMENT[at0001] occurrences matches {0..*} matches { value matches { DV_TEXT matches {*} } }
        }
    }

Is it allowed to constrain this archetype in the WHERE part by accessing the field within a path? :

SELECT e FROM EHR e CONSTAINS CLUSTER a[openEHR-EHR-CLUSTER.example.v1]
WHERE a/items[at0001]/value = 'test'

The problem I have with this query is that the path "a/items[at0001]" is a list, so it perhaps cannot be extended with "value", because a list does not have a field "value" but only the members of this list have this field. An alternative to the query above would be to resolve the list in the FROM part by writing something like this:

SELECT e FROM EHR e CONSTAINS CLUSTER a[openEHR-EHR-CLUSTER.example.v1]
CONTAINS DV_TEXT b
WHERE b/value = 'test'

This would work in the above example, but would create further problems if there are further elements in parallel to ELEMENT[at0001] that as well contain DV_TEXTs and which would be matched as well by the alternative query.
Greetings
Georg

--
---------------------------------------------------------------------
Dipl.-Inf. Georg Fette      Raum: B001
Universität Würzburg        Tel.: +49-(0)931-31-85516
Am Hubland                  Fax.: +49-(0)931-31-86732
97074 Würzburg              mail: georg.fe...@uni-wuerzburg.de
---------------------------------------------------------------------


_______________________________________________
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

Reply via email to