Stream: cql
Topic: Issue with Flatten
Christa Wan (Apr 08 2021 at 19:45):
When I try to flatten the list { { 1, 2, 3 }, 2, 3, 4 }, I should get {1, 2, 3, 2, 3, 4}, but instead, when I run the following code:
define "Flatten Lists and Elements":
flatten { { 1, 2, 3 }, 2, 3, 4 }
I get a null value as a result. Does anyone know why?
Chris Moesel (Apr 08 2021 at 20:16):
Hi @Christa Wan -- flatten
is supposed to take a list of lists as its argument, but some of your list items are not lists. That said, it seems that the CQL-to-ELM translator fixes this during translation by applying ToList
to the single elements, so it should work anyway. Which CQL engine are you using?
Christa Wan (Apr 09 2021 at 13:05):
Hi @Chris Moesel ! Thank you for your answer - I am using the Atom CQL plug in.
Chris Moesel (Apr 09 2021 at 13:09):
@Bryn Rhodes @JP -- I think this one is for you...
Bryn Rhodes (Apr 09 2021 at 15:49):
Hi @Christa Wan , we are looking at this, and it should be working, the problem appears to be in the translator options. We'll update as soon as we have a solution here.
Bryn Rhodes (Apr 09 2021 at 16:07):
We think it's related to this issue for the Atom plugin: https://github.com/cqframework/atom_cql_support/issues/19
Last updated: Apr 12 2022 at 19:14 UTC