Skip to content
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

CQL Expand Valueset Issue #1407

Closed
SeenaFa opened this issue Aug 27, 2024 · 0 comments · Fixed by #1409
Closed

CQL Expand Valueset Issue #1407

SeenaFa opened this issue Aug 27, 2024 · 0 comments · Fixed by #1409
Assignees

Comments

@SeenaFa
Copy link

SeenaFa commented Aug 27, 2024

The issue/error that I'm getting is the following:
Expected ExpandValueSet(ValueSet), Found ExpandValueSet(java.util.ArrayList)

What I'm trying to do is check an Observation.code against the ValueSet via a function call. The function calls/uses fluent functions to do the check but the function arguments are taking a List<System.Code>

`library IssueExpandValueSet

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1' called FHIRHelpers
include IssueExpandValueSet_Concepts called Concepts

context Patient

define "Valueset": Concepts."Garb"

define "Garb Test Fails": "Has Garb Test Fails"([Observation])

define "Garb Test Works": "Has Garb Test Workaround"([Observation])

define function "Has Garb Test Fails" (obs List):
obs."With any code"(Concepts."Garb")

define function "Has Garb Test Workaround" (obs List):
obs."With any code"(Concepts."Garb" as System.ValueSet)

define fluent function "With any code"(observations List<FHIR.Observation>, codes List<System.Code>):
if observations is null or codes is null then null
else
(observations) observation
where observation.code."Has"(codes)

define fluent function "Has"(codeableConcept FHIR.CodeableConcept, codes List<System.Code>):
if codeableConcept is null or codes is null then null
else
exists(
(codeableConcept.coding) coding
where coding in codes
)`

I discovered a workaround, that isn't ideal, but is demonstrated in the define called "Has Garb Test Workaround"

I'm not sure what is happening and why the error is occurring.

I also attached a zip file containing the cql libraries, valueset, and test case to reproduce the error and also demonstrate the workaround.

IssueExpandValueSet.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants