clinical_quality_language
clinical_quality_language copied to clipboard
Add a "valueset-expansion" capability
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.
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
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.
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:
- http://build.fhir.org/terminologycapabilities.html
- http://build.fhir.org/terminology-service.html
- http://build.fhir.org/capabilitystatement2.html
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."