Stream: cds hooks
Topic: CQL support
Ahmed Mohamed (Sep 11 2019 at 05:29):
Hi,
I am working now on building a cds service, the service will have one hook only (order-select) with some custom logic for the CDS, yet I want it to be able to handle CQL in the future.
I am choosing between Javascript and Golang. but I couldn't find libraries that parse CQL for both, any idea if there are already existing ones?
Lloyd McKenzie (Sep 11 2019 at 12:35):
I know there's FHIRPath for JavaScript (which is a large chunk of CQL).
Chris Moesel (Sep 11 2019 at 13:48):
Hi @Ahmed Mohamed -- we built a CQL execution framework using coffeescript, which compiles to JavaScript. It's available on NPM and the GitHub repo is here: https://github.com/cqframework/cql-execution
That repo is just the logic portion of CQL, so you'd also want our cql-exec-fhir patient source implementation (here) to work with a FHIR data model. Last you need a way to resolve value sets -- there's a basic in-memory code service example in the main repo, but there is one that works with VSAC here.
Probably the easiest way to see how they all work together is by looking at our cql-exec-examples project.
Chris Moesel (Sep 11 2019 at 13:52):
There are some limitations. For example, it requires you to pass in all the FHIR data for the patient as a bundle. It does not make dynamic queries to FHIR itself.
Chris Moesel (Sep 11 2019 at 14:01):
Last, I'd point you to the CQL Services project that was developed as part of AHRQ's CDS Connect project. It provides a mechanism for exposing CQL logic through a CDS Hooks interface (and leverages the cql-execution framework above). It has a similar limitation, however, in that it only supports data passed in through prefetch
; it does not support dynamic query of the FHIR server.
Bryn Rhodes (Sep 11 2019 at 17:11):
Hi @Ahmed Mohamed , there's also a Java-based implementation, containing many of the same components that Chris identified above, but Java versions. There's a community projects page that lists known open source projects.
Last updated: Apr 12 2022 at 19:14 UTC