FHIR Chat · Should single-source queries default to distinct returns? · cql

Stream: cql

Topic: Should single-source queries default to distinct returns?


view this post on Zulip Zach Smith (Jul 17 2020 at 20:52):

I noticed in the documentation for queries:

the default for return clauses is distinct, as opposed to all, so if no return clause is specified, duplicates will be eliminated from the result.

However, this is in the "Multi-Source Queries" section of the docs. Does that mean that single-source queries should default to query all?

view this post on Zulip Frank Adrian (Jul 21 2020 at 21:31):

That would not be my interpretation. Nor does it seem to be the interpretation of any implementation I've seen. Making the default for single-source vs. multi-source queries different would also lead to a very confusing mental model, while making the default return clause the same for all queries would not. Why do you think that having differing defaults would be a good thing?

view this post on Zulip Zach Smith (Jul 21 2020 at 21:35):

I don't necessarily think it would be a good thing. The reason I brought this up is because it appears to be the semantics outlined in one of the test cases, specifically the Sort.simpleSortAsc test in CqlListOperatorsTest.xml:

It expects the expression:

({4, 5, 1, 6, 2, 1}) sL sort asc

to result in:

{1, 1, 2, 4, 5, 6}

view this post on Zulip Bryn Rhodes (Jul 22 2020 at 20:14):

I'd call that a bug in the test case, distinct behavior is the default for both single-source and multi-source queries.

view this post on Zulip Bryn Rhodes (Jul 22 2020 at 20:16):

https://jira.hl7.org/browse/FHIR-28127

view this post on Zulip Zach Smith (Jul 22 2020 at 20:18):

Ok thanks @Bryn Rhodes ! I'm actually noticing a few discrepancies in the test cases as I go through them. Should I file tickets for each one?

view this post on Zulip Bryn Rhodes (Jul 22 2020 at 20:35):

Feel free to add them to that ticket

view this post on Zulip Bryn Rhodes (Jul 22 2020 at 20:35):

And thank you!


Last updated: Apr 12 2022 at 19:14 UTC