Skip to content

Implement support for include statements in CQL #459

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

Open
citizenrich opened this issue Aug 23, 2021 · 7 comments
Open

Implement support for include statements in CQL #459

citizenrich opened this issue Aug 23, 2021 · 7 comments
Labels
enhancement New feature or request module:cql

Comments

@citizenrich
Copy link

Support referencing libraries, ie. include FHIRCommon version '4.0.1' called FC in CQL.

See: https://cql.hl7.org/02-authorsguide.html#libraries

@alexanderkiel alexanderkiel added enhancement New feature or request module:cql labels Oct 6, 2021
@bkaney
Copy link

bkaney commented Oct 10, 2021

+1 : An FYI, see this information cqframework/cql-execution#251 as the IG Publisher tooling using cql2elm with options that uses the namespace of the IG being developed as a convention when building the includes. This is different outcome if using the converter outside of an IG.

Incidentally, the IG tooling can create a one-to-one FHIR Library for every CQL library. The FHIR Library resource includes not only the base64 CQL, but also elm+json and elm+xml content. Does/could blaze use this if it is present in the FHIR Library resource, or will it run the translator in all cases? This could have consequences as the namespace might be lost as it would be converted outside the context of an IG (with canonical base)...

@bkaney
Copy link

bkaney commented Oct 10, 2021

Here is an example bundle (Measure, Libraries, and ValueSets) created using the IG Publisher tooling: https://gist.github.com/bkaney/f369ec1df7238f62ff5d2e593ed82ce3

This works with the VS Code CQL evaluator (which uses CQF Tooling) https://marketplace.visualstudio.com/items?itemName=cqframework.cql

Running the measure (GET http://localhost:8080/fhir/Measure/CMS122v9/$evaluate-measure?periodStart=2000&periodEnd=2030) gives this currently (most recent docker image):
image

@alexanderkiel
Copy link
Member

+1 : An FYI, see this information cqframework/cql-execution#251 as the IG Publisher tooling using cql2elm with options that uses the namespace of the IG being developed as a convention when building the includes. This is different outcome if using the converter outside of an IG.

Incidentally, the IG tooling can create a one-to-one FHIR Library for every CQL library. The FHIR Library resource includes not only the base64 CQL, but also elm+json and elm+xml content. Does/could blaze use this if it is present in the FHIR Library resource, or will it run the translator in all cases? This could have consequences as the namespace might be lost as it would be converted outside the context of an IG (with canonical base)...

Blaze always does the CQL-to-ELM Conversion using the cqframework translator currently in version 1.5.4.

@bkaney
Copy link

bkaney commented Oct 11, 2021

I updated the CQL to try it as all-in-one (see: https://gist.github.com/bkaney/f369ec1df7238f62ff5d2e593ed82ce3#file-all-in-one-cql), and I see this error:

:cognitect.anomalies/message "Unsupported ELM expression type: OperandRef"

Is this already covered by #493 or is this a new issue?

@alexanderkiel
Copy link
Member

The error with the OperandRef occurs, because Blaze currently doesn't support functions #501. Also #110 and #493 has to be resolved before your query could be evaluated.

@bkaney
Copy link

bkaney commented Oct 12, 2021

Okay, and I see all of that might enable #452. FWIW I can remove the functions, but support for valueset references (#110) is something that would block.

@alexanderkiel
Copy link
Member

Functions in the same CQL library are implemented in #766.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module:cql
Projects
None yet
Development

No branches or pull requests

3 participants