Stream: cql
Topic: Opioid Prescribing Support IG
Jorge de la Garza (Sep 09 2021 at 21:17):
Hi, I'm trying to translate to ELM the CQL for recommendation 5 from the Opioid Prescribing Support IG: http://build.fhir.org/ig/cqframework/opioid-cds/recommendation-05.html
I'm using the cql-to-elm utility that is part of the cql-execution repository on GitHub: https://github.com/cqframework/cql-execution/blob/master/README.md#to-execute-your-cql
I'm able to translate OMTKData2019, OpioidCDSCommon, and OMTKLogicCQL without issue. However I'm getting errors for OpioidCDSREC05:
================================================================================
TRANSLATE C:\Users\garza\Desktop\opioid-prescribing-support-ig\cql\OpioidCDSREC05.cql
Translation failed due to errors:
Error:[7:1, 7:57] Could not load source for library OpioidCDSRoutines, version 1.2.2.
Error:[46:11, 46:18] Could not resolve identifier Routines in the current library.
Error:[57:9, 57:16] Could not resolve identifier Routines in the current library.
Error:[69:13, 69:20] Could not resolve identifier Routines in the current library.
Error:[52:3, 52:22] Could not validate reference to expression Inclusion Criteria because its definition contains errors.
Error:[77:6, 77:36] Could not validate reference to expression Is Recommendation Applicable? because its definition contains errors.
Error:[82:6, 82:36] Could not validate reference to expression Is Recommendation Applicable? because its definition contains errors.
Error:[92:6, 92:36] Could not validate reference to expression Is Recommendation Applicable? because its definition contains errors.
So it seems there is a missing library, and I can't find it anywhere on the Opioid Prescribing Support IG site. Anyone know where I can get that library?
In trying to find it, I noticed that there is an "R4" version of the IG, that is based on FHIR R4: http://build.fhir.org/ig/cqframework/opioid-cds-r4/index.html
The first IG is based on STU3. I had originally been looking at the STU3 version because that's what was linked to on the Confluence page for the Clinical Reasoning track: https://confluence.hl7.org/display/FHIR/2021-09+Clinical+Reasoning
Should the Confluence page be linking to the R4 version of the IG?
Bryn Rhodes (Sep 09 2021 at 21:26):
Hi @Jorge de la Garza , I notice in the path on the translate call that it's opioid-prescribing-support-ig\cql\OpioidCDSRec05.cql
, but assuming opioid-prescribing-support-ig
is the root of your clone, the path should be opioid-prescribing-support-ig\input\pagecontent\cql\OpioidCDSRec05.cql
. Did you make a complete clone of the repository?
Bryn Rhodes (Sep 09 2021 at 21:27):
The library it's referencing is called OpioidCDSRoutines
, the Routines
identifier is a local alias for that library within the OpioidCDSRec05
library.
Bryn Rhodes (Sep 09 2021 at 21:27):
I just got latest on master and verified that I can translate OpioidCDSRec05, so I'm wondering if maybe you have an incomplete local copy?
Bryn Rhodes (Sep 09 2021 at 21:28):
And yes, we should probably point to both the opioid-cds (STU3) and opioid-cds-r4 (R4) versions of the repository, we support both versions since we are working with both STU3 and R4 FHIR servers.
Bryn Rhodes (Sep 09 2021 at 21:31):
Updated the confluence page.
Jorge de la Garza (Sep 10 2021 at 02:36):
Ah. I didn't realize there was a repository. I was just trying to transform the CQLs on the recommendation 5 page. So when I try to transform the whole cql folder from the repository, then everything transforms without issue. Thanks @Bryn Rhodes
Jorge de la Garza (Sep 14 2021 at 14:30):
Hi, I'm still working on supporting this IG. To evaluate the CQL, I'm using the cql-execution
, cql-exec-fhir
, and cql-exec-vsac
repos from GitHub. One thing that I'm finding is that the valuesets defined in OpioidCDSCommon.cql do not seem to exist in VSAC. It seems like they only exist as ValueSet resources in the IG. I suppose I could write something that takes a ValueSet resource and adds the codes to the cql-execution
CodeService
. Does that sound right, or is there some other way I should be making these valuesets available to the evaluation?
Chris Moesel (Sep 14 2021 at 14:58):
Hi @Jorge de la Garza -- as you noted, cql-exec-vsac
only supports value sets in VSAC. We don't currently have an implementation that supports arbitrary FHIR-defined value sets -- although it's possible that @Bryn Rhodes has implemented something like this to support some other projects he's worked on. Bryn?
Assuming there is nothing out there yet, then yes, I think the way forward would be to implement something that can push the FHIR value sets into the CodeService
. Or a script that just adds your value sets to the VS cache file that the service loads on startup. If you don't use any value sets from VSAC, then you could also just write your own CodeService
implementation.
Bryn Rhodes (Sep 14 2021 at 21:40):
So, we did write something that will take FHIR ValueSet resources (fully expanded) and output them as a valueset_db.json file suitable for use in the JavaScript engine:
Bryn Rhodes (Sep 14 2021 at 21:42):
Bryn Rhodes (Sep 14 2021 at 21:42):
The docs are pretty horrid, I thought I had doc'ed it when I built it, but... apparently not. It's pretty simple, just in and out directories.
Bryn Rhodes (Sep 14 2021 at 21:43):
There's also an EnsureExecutableValueSet that will expand FHIR ValueSets (so long as the definition is trivial)
Bryn Rhodes (Sep 14 2021 at 21:43):
Longer term, one of the things we're working on this connectathon is a FederatingTerminologyClient:
Bryn Rhodes (Sep 14 2021 at 21:44):
https://github.com/cqframework/cqf-tooling/pull/298
Last updated: Apr 12 2022 at 19:14 UTC