cqframework / clinical-reasoning

CQF Clinical Reasoning on FHIR for Java
https://www.cqframework.org/clinical-reasoning/
Apache License 2.0
34 stars 24 forks source link

isVersionCompatible should use version compability, not equality #307

Open brynrhodes opened 1 year ago

brynrhodes commented 1 year ago

In the following test for version compatibility:

https://github.com/cqframework/clinical-reasoning/blob/938ed778c19ccf34c5a7726d9949c2798f46521e/evaluator/src/main/java/org/opencds/cqf/cql/evaluator/engine/execution/TranslatingLibraryLoader.java#L266

This will in general always fail because the compability level is expressed as major.minor, where the implementation version will be specified to the patch level, and potentially include a snapshot label.

JPercival commented 1 year ago

That's intentional. We don't currently consider how ELM generation is impacted in the major.minor.bugfix versions in the cql compiler so have to assume that a mismatched version is not compatible. For example, this change here:

https://github.com/cqframework/clinical_quality_language/pull/1163

required runtime changes to support correctly and (intentionally, due to performance considerations) pushed overload resolution from runtime to compile time.

JPercival commented 1 year ago

Ah. Actually, I interpreted your comment backwards. The code looks at the compatibility level and not the implementation version. You are right. That's incorrect.