FHIR Chat · Exception in CQL Execution over CQFRuler · cql

Stream: cql

Topic: Exception in CQL Execution over CQFRuler


view this post on Zulip Abdelali Boussadi (Feb 18 2022 at 15:39):

Hi all,

I followed this walkthrough: https://github.com/cqframework/content-ig-walkthrough for my own CQL Library.

On Atom, the CQL code is running correctly, I also tested it on this sandbox: https://cql-runner.dataphoria.org/ and everything want good.
However, when I try to test my CDS Service using the CDS Hooks sandbox I don’t have any result displayed.

So I tried to display the response from the CQFRuler for this http request using Postman and i got this message (see below), it seems that the CQFRuler is trying to transalte the CQL code even if the FHIR Library already contains the code translated to ELM, I'm a little bit lost ! many thanks for your help.

**ERROR: Exception in CQL Execution.
Unable translate library epidyolex02pharmacist
org.opencds.cqf.cql.engine.exception.CqlException: Unable translate library epidyolex02pharmacist
at org.opencds.cqf.cql.evaluator.engine.execution.TranslatingLibraryLoader.translate(TranslatingLibraryLoader.java:147)
at org.opencds.cqf.cql.evaluator.engine.execution.TranslatingLibraryLoader.load(TranslatingLibraryLoader.java:88)
at org.opencds.cqf.cql.evaluator.engine.execution.CacheAwareLibraryLoaderDecorator.load(CacheAwareLibraryLoaderDecorator.java:49)
at ca.uhn.fhir.cql.r4.helper.LibraryHelper.resolveLibraryById(LibraryHelper.java:203)
at ca.uhn.fhir.cql.r4.helper.LibraryHelper.resolvePrimaryLibrary(LibraryHelper.java:227)
at org.opencds.cqf.r4.servlet.CdsHooksServlet.doPost(CdsHooksServlet.java:184)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:228)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:319)
at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:273)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.base/java.lang.Thread.run(Unknown Source)**

view this post on Zulip Bryn Rhodes (Feb 23 2022 at 15:16):

Is there somewhere that you have the IG content posted so I can try to reproduce this?

view this post on Zulip Abdelali Boussadi (Feb 23 2022 at 15:47):

Unfortunately not yet, however, I moved to an other issue since this post. I used the function called

"Is Opioid Analgesic with Ambulatory Misuse Potential" from this library

https://build.fhir.org/ig/cqframework/opioid-cds-r4/Library-library-OpioidCDSCommon.html in my CQL code.

On Atom the code is showing no error but the Publisher displays this error and refuse to translate the CQL code

ERROR: epidiolexCommon: Could not resolve call to operator AnyInValueSet with signature (list<FHIR.code>,System.ValueSet).

below my CQL library

library epidiolexCommon version '1.0.0'
using FHIR version '4.0.1'
include "FHIRHelpers" version '4.0.1' called FHIRHelpers
codesystem RXNORM: '2.16.840.1.113883.6.88'
valueset "SAM medication codes": 'https://smt.esante.gouv.fr/fhir/ValueSet/epidyolex01pharmacist-sam-ig'
//code "Epidiolex code": '197685' from RXNORM display 'etodolac 300 MG'

define function "Is Epidiolex ?"(value List<MedicationRequest>):
value Rx
let MedRef: if (Rx.medication is FHIR.Reference) then (Rx.medication as FHIR.Reference).reference else null,
Med: if MedRef is null then (Rx.medication as FHIR.CodeableConcept).coding else SingletonFrom([Medication: id in (Last(Split(MedRef, '/')))] Med return Med.code.coding)
where Med.code in "SAM medication codes"

return
      MedicationRequest {
        id: Rx.id,
        status: Rx.status,
        intent: Rx.intent,
        category: Rx.category,
        medication: FHIR.CodeableConcept{ coding: Med },
        subject: Rx.subject,
        authoredOn: Rx.authoredOn,
        recorder: Rx.recorder,
        dosageInstruction: Rx.dosageInstruction,
        dispenseRequest: Rx.dispenseRequest
      }

view this post on Zulip Bryn Rhodes (Feb 23 2022 at 16:16):

The publisher includes CQL translation, but uses an older version of the translator. If you use the _refresh script (in the Sample Content IG, it will use the latest translator. It adds a step to the build in that whenever you change the CQL, you need to run _refresh and then run _genonce to build the IG. You also have to turn off the binary adjunct file loading in the publisher (remove the path-binary parameter from the IG).

view this post on Zulip Bryn Rhodes (Feb 23 2022 at 16:16):

We're working on an update to the publisher so that it will use the latest, but haven't gotten that submitted to the publisher yet.

view this post on Zulip Bryn Rhodes (Feb 23 2022 at 16:16):

All that is to say that the error you're getting above is a known issue with the translator that has since been addressed.

view this post on Zulip Abdelali Boussadi (Feb 24 2022 at 08:43):

Sorry Bryn, I didn't get your last point: "You also have to turn off the binary adjunct file loading in the publisher (remove the path-binary parameter from the IG)." ?

view this post on Zulip Bryn Rhodes (Feb 24 2022 at 13:59):

The publisher uses the 'path-binary' parameter to find CQL files to translate, so you have to turn that off:
https://github.com/cqframework/sample-content-ig/blob/master/input/mycontentig.xml#L119

view this post on Zulip Sukanta Barai (Mar 04 2022 at 07:51):

Hi Team,
Could you please let me know ,
how can we create data model or customize schema like FHIR or QDM.
So we can using customize schema instead of FHIR or QDM for CQL.
Please provide me any example which will help me to create customise schema. Need your help. I am new in CQL.
Also let me know the data format of FHIR and QDM.
How does any customize data model like PHIR can read from CQL-ENGINE or CQL-Language-Server?


Last updated: Apr 12 2022 at 19:14 UTC