FHIR Chat · multiple sources in CQL statement · cql

Stream: cql

Topic: multiple sources in CQL statement


view this post on Zulip Georg Fette (Oct 18 2018 at 08:21):

Hello,
The cql-to-elm implementation returns for getSource() on Query-type-objects a list of AliasedQuerySources. Why is this a list and not a single source. What would be the semantics of multiple sources in a query ? From the CQL documentation is it not clear to me how the syntax would look like having multiple sources (e.g. "[Encounter, Condition]" ?) or how the returned results look like in this case.
Greetings
Georg

view this post on Zulip Bryn Rhodes (Oct 23 2018 at 00:10):

The Type Inference - Queries section of the developer's guide establishes type inference rules for queries.

view this post on Zulip Bryn Rhodes (Oct 23 2018 at 00:13):

To avoid the possibility of element name clashes, the default result of a multi-source query is a list of tuples with an element for each source named the alias and of the type of an element of the source. For example, from [Patient] P, [Encounter] E would by default yield a list of Tuple { P Patient, E Encounter }, and the result would contain a tuple for each possible combination of patients and encounters.


Last updated: Apr 12 2022 at 19:14 UTC