AQL for multi-occurrence nodes

Hi,

What is the expected response to AQL on a node with multiple occurrences? Does it return all the occurrences or only the first one?

If it is expected to return all occurrences, what is the structure of the response? will the occurrences be returned as an array?

If only the first one is returned, how do we get all the occurrences? Adding multiple select lines in aql may not be practical as the number of occurrences can vary.

Can nay body give a select statement syntax for this?

regards

This is a very interesting topic. I have written out some of the problems in this repo: https://github.com/DIPSASA/openehr-conformance/tree/master/aql

The general answer is that you need to write you AQL as detailed as possible. Meaning you need to know which level you expect the multiple occurences to appear. Take a look at the examples given above. I would be happy to answer follow ups on this.

Vennlig hilsen
Bjørn Næss
Produktansvarlig
DIPS ASA

Mobil +47 93 43 29 10

Hi Dileep

querying is always about returning everything that matches - it’s a declarative concept, not a procedural one. In REST terms, . If you want other structures, e.g. C# / Java / other language etc, please respond here, there are answers for that as well. - thomas

Hi - agree with Thomas and more here

https://github.com/ethercis/ethercis/issues/69

Ian

Hi,

What is the expected response to AQL on a node with multiple occurrences?
Does it return all the occurrences or only the first one?

If the query matches multiple occurrences of data defined by the same
archetype node, then all the matched occurrences should be returned. It
doesn't make sense to return the first occurrence since each occurrence
contains different clinical data.

If it is expected to return all occurrences, what is the structure of the
response? will the occurrences be returned as an array?

IMO the result will have the structure of the items in the SELECT, if the
query projection is a COMPOSITION, then the result will be a list of
compositions, and those might contain multiple occurrences of a node. On
this context, the match in the WHERE might be that exists a node at certain
path that contains certain value, that path might have multiple occurrences
of a node, and the resulting compositions will be returned if any of those
occurrences have that value.

If the SELECT has a projection for the matched nodes that might have
multiple occurrences, a list of those nodes will be returned, and those
might be from many COMPOSITIONs. If the results are just a plain list, it
will be difficult to know which occurrences have the same context
(contained on the same composition), I prefer to return the composition uid
alongside with the data and a timestamp.

If only the first one is returned, how do we get all the occurrences?
Adding multiple select lines in aql may not be practical as the number of
occurrences can vary.

I don't think this is an issue of AQL, but an implementations issue on not
supporting multiple occurrences of nodes on query results. Multiple
occurrences is a basic part of the openEHR spec IMO and very common in
clinical records, like having more than one diagnosis on the same document.

As Thomas said, the query should return anything that matches, multiple
occurrences included.

Thanks everybody for the clarification.

regards

Dear Thomas,

Can you point me to details of Java structures

regards

Dileep,

see here. But I suggest you post this question on the implementers list to see if someone can point you to classes already available.

  • thomas

I would also look at the ITS specification. https://github.com/openEHR/specifications-ITS/tree/master/REST_API

There is a XSD there which defines some structures.

Vennlig hilsen

Bjørn Næss

Produktansvarlig

DIPS ASA

-------- Opprinnelig melding --------