cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
253 stars 121 forks source link

Add a "valueset-expansion" capability #602

Open brynrhodes opened 3 years ago

brynrhodes commented 3 years ago

Explicitly describe the capability to support valueset-expansion (effectively, the ability to evaluate a ValueSetRef ELM operation). There is no explicit CQL operation for this, it occurs when a value set reference is used in a context that does not explicitly understand value set references (InValueSet explicitly understand ValueSetRef for example). Exposing this as a capability would allow 1) engines to advertise whether or not they support this, and 2) CQL content to advertise whether they make use of it.

brynrhodes commented 3 years ago

This task starts with adding the capability here: https://github.com/cqframework/clinical_quality_language/blob/master/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/CqlCapability.java#L94

cmoesel commented 3 years ago

It's a bit tricky though, right? I mean, the truth might be "I can expand these kinds of value sets, but not these other kinds of value sets" -- or "value sets from this source, but not that source." Or in the case of an engine that takes a terminology resolver as a plugin, the answer may be "it depends on the plugin you use". Any, we'll probably want to be careful how we define what "yes" means.

brynrhodes commented 3 years ago

That's true, there's a significant amount of complexity behind saying "I can expand a value set". And describing that complexity isn't even necessarily settled in FHIR yet:

It's definitely a much bigger discussion than just the ability to expand.

Having said that, I think from the perspective of CQL, we are just interested in supporting whether a given artifact makes use of valueset-expansion (i.e. does it contain any evaluations of ValueSetRef), and the ability of an engine to say whether it supports that at all. It's still the case that the engine may return a run-time error if the actual expansion requested cannot be performed, but at least exposing the capability allows the first level of negotiation to take place at compile-time.

In other words, I think we include these caveats in the definition and explicitly define this capability as just "whether or not the CQL contains direct evaluation of value set references."