Stream: cql
Topic: Define type information
Corey Sanders (Sep 16 2021 at 16:24):
My team has been poking around trying to figure out how to extract the return type information for a define from the CQL/ELM. At the point of translation, the type information is available in the ExpressionDef. This is how the Atom plugin/cql-language-server exposes this information. When we load that library up in the CQL Engine, however, the ExpressionDef no longer carries the type information. There is a getResultTypeName() property, but it always returns null. @Bryn Rhodes / @JP can you provide some context here? There are two different object hierarchies in play (org.hl7.elm.r1.ExpressionDef vs. org.cqframework.cql.elm.execution.ExpressionDef), so I get that there can be differences, but it would be useful to us to have the type information at the point of execution. Specifically, we want it to build the schema for a Spark dataset that we are outputting that contains the results of the CQL evaluation.
JP (Sep 16 2021 at 16:27):
including type information in the ELM is an option on the CQL translator when generating ELM. The Atom plugin essentially uses a set of options that includes a lot of information for editor support.
You're looking for the "result-types" option.
JP (Sep 16 2021 at 16:33):
And if it's helpful for your team, here's a PoC app running the CQL Engine on Spark:
https://github.com/DBCG/spark-cql-fhir
Corey Sanders (Sep 16 2021 at 17:04):
Thanks, @JP I looked at the translator options before asking, but I completely missed it. Appreciate the link to the spark POC. We'll have a look.
Last updated: Apr 12 2022 at 19:14 UTC