-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attributes on union output not accessible, not yielding expected calculation results #191
Comments
For whoever looks at this, just to clarify, I think the issue occurs whenever the union results in a choice type. Note: a similar issue occurred with cql-engine. Refer to CQLIT-329. |
Thanks! I was able to replicate the issue in fqm-execution. We will try working with a simpler test case I created that also demonstrates this issue: library UnionTest version '1.0.000'
using QICore version '4.1.1'
include FHIRHelpers version '4.1.000' called FHIRHelpers
include QICoreCommon version '1.2.000' called QICoreCommon
parameter "Measurement Period" Interval<DateTime>
context Patient
define "Union Issue":
([Procedure] union [ServiceRequest]) ComfortMeasure
return {
cmPerformed: ComfortMeasure.performed,
cmAuthoredOn: ComfortMeasure.authoredOn,
coalesced: Coalesce(start of QICoreCommon."ToInterval"(ComfortMeasure.performed), ComfortMeasure.authoredOn)
} Currently, all of the values in this returned object are null, which shouldn't be the case given the patient bundle that you've provided. I logged a ticket in our backlog. Will let you know what the path forward is (be it here, cql-execution, or translator). |
Interesting! We're on cqframework version 2.4.0. |
@srankins @nmorasb We investigated this a bit. Before proceeding, I think we need more clarification from @brynrhodes on how the translator is expected to handle accessing properties on a choice type when in the context of a union like this. Take the following CQL: define "Single":
[Procedure] P
return {
perf: P.performed
}
define "Union of Same Type":
([Procedure] union [Procedure]) P
return {
perf: P.performed
}
define "Union of Different Types":
([Procedure] union [ServiceRequest]) ComfortMeasure
return {
cmPerformed: ComfortMeasure.performed,
cmAuthoredOn: ComfortMeasure.authoredOn,
} The "Union of Different Types" expression is the only one whose ELM raises concerns (which aligns with what Stan said in his comment above). Here are the corresponding ELM snippets of the elements in the above Tuples:
Note the appearances of My suspicion is that the translator needs to be unwrapping these strings with |
Yes, that is definitely a bug, the translator is not expanding the mappings in this case. Can you submit this as an issue to the translator? |
Closing in favor of cqframework/clinical_quality_language#1126 |
It seems that the output of a union inside a library is not allowing access to properties of the union types.
We have a define in a library performing a union:
Usage showing attributes are not hit:
Usage in the denominator exclusion:
It seems like the attributes
performed
andauthoredOn
ofComfortMeasure
may not be accessible and are both returning null.The measure bundle and patient bundle are attached for reference.
union-output-issue.zip
@JSRankins
The text was updated successfully, but these errors were encountered: