You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be an issue with how Union works...
The scenario below was created in VSCode using the CQL Extension v0.6.0 (The latest version of the extension doesn't work on my environment, so someone needs to try to reproduce in v0.7.3, and/or also outside of VSCode to determine if this behavior is because of the CQL extension or is in the language itself. )
The measure and test case used are arbitrary, but should have a single Procedure resource that can be referenced by the selector as such:
["Procedure"]
Below are two defines, one that selects Procedures and one that selects Observations. In this scenario, there
is a single Procedure resource and no Observation resources. Also note the define that is a simple a Union of those two define results:
The result of the union returns null, even though it should be a list of the single procedure.
Now here is a "fixed" version of those same defines. The ONLY difference is that the procedure and observation selects bind
their results to a local variable (notp and nota, respectively).
define "FIXED-Proc1":
["Procedure"] notp
define "FIXED-Assess1":
["Observation"] nota
define "FIXED-UnionOfProc1AndAssess1":
"FIXED-Proc1"
union "FIXED-Assess1"
Now consider the following, similar, define that instead of accessing the "Procedure" from the Union result, accesses the Procedure resource directly from the ["Procedure"] selector:
The Procedure resources selected from both of the defines above are the same (note the internal "resource" identifier), but the first version is malformed, the latter is correct.
Note: it doesn't matter what resource type(s) we are selecting. In the above scenario we are selecting "Procedure" resources. But you could use "Patient", or "Encounter" or whatever.
The text was updated successfully, but these errors were encountered:
There appears to be an issue with how Union works...
The scenario below was created in VSCode using the CQL Extension v0.6.0 (The latest version of the extension doesn't work on my environment, so someone needs to try to reproduce in v0.7.3, and/or also outside of VSCode to determine if this behavior is because of the CQL extension or is in the language itself. )
The measure and test case used are arbitrary, but should have a single Procedure resource that can be referenced by the selector as such:
["Procedure"]
Below are two defines, one that selects Procedures and one that selects Observations. In this scenario, there
is a single Procedure resource and no Observation resources. Also note the define that is a simple a Union of those two define results:
and here is the output when doing 'Execute CQL' on the measure cql file:
The result of the union returns null, even though it should be a list of the single procedure.
Now here is a "fixed" version of those same defines. The ONLY difference is that the procedure and observation selects bind
their results to a local variable (notp and nota, respectively).
Here is the output:
Here, the above Union operation returns a list with the procedure, as expected.
But things are not as fixed, as they seem. The Procedure returned in the union operation is malformed.
Consider the following define that uses the above "fixed" union result to get the Procedure and returns a tuple of that procedure's elements:
Here is the output:
Now consider the following, similar, define that instead of accessing the "Procedure" from the Union result, accesses the Procedure resource directly from the ["Procedure"] selector:
and note the output:
The Procedure resources selected from both of the defines above are the same (note the internal "resource" identifier), but the first version is malformed, the latter is correct.
Note: it doesn't matter what resource type(s) we are selecting. In the above scenario we are selecting "Procedure" resources. But you could use "Patient", or "Encounter" or whatever.
The text was updated successfully, but these errors were encountered: