cqf-ruler icon indicating copy to clipboard operation
cqf-ruler copied to clipboard

ValueSets not expanded in queries to EHR

Open aeyates opened this issue 2 years ago • 1 comments

I'm attempting to upgrade from 0.5.0 and am finding that queries to the EHR no longer expand the valueset. Is there some change in configuration I am missing? I've attached a test case to highlight the issue. When I execute the plan definition in 0.5.0, I see in the logs the request being made to the EHR FHIR server:

coach-cqfruler-1 | 2022-11-30 18:41:26.448 [http-nio-8080-exec-5] INFO c.u.f.r.c.i.LoggingInterceptor [LoggingInterceptor.java:82] Client request: GET https://api.logicahealth.org/htnu18r42/open/Observation?code=http%3A%2F%2Floinc.org%7C8480-6%2Chttp%3A%2F%2Fsnomed.info%2Fsct%7C271649006%2Chttp%3A%2F%2Fsnomed.info%2Fsct%7C399304008&subject=Patient%2FP-AdvancingTreatment HTTP/1.1

Here, it has expanded the valueset 2.16.840.1.113762.1.4.1104.2 into the codes that comprise it.

If I execute the same plan definition in 0.5.1, I get the following error:

coach-cqfruler-1 | 2022-11-29 22:00:43.448 [http-nio-8080-exec-6] ERROR o.o.c.r.cdshooks.r4.CdsHooksServlet [CdsHooksServlet.java:193] org.opencds.cqf.cql.engine.exception.CqlException: ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException: HTTP 404 Not Found: Unknown ValueSet: http%3A%2F%2Fcts.nlm.nih.gov%2Ffhir%2FValueSet%2F2.16.840.1.113762.1.4.1104.2

The log does not indicate what query is being made to the EHR, but if I disconnect from the internet so that the EHR can't be reached, it becomes clear that the query is not expanding the valueset:

ERROR: Exception in CQL Execution. ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to parse response from server when performing GET to URL https://api.logicahealth.org/htnu18r42/open/Observation?code%3Ain=http%3A%2F%2Fcts.nlm.nih.gov%2Ffhir%2FValueSet%2F2.16.840.1.113762.1.4.1104.2&subject=Patient%2FP-AdvancingTreatment - java.net.UnknownHostException: api.logicahealth.org: Name or service not known

Since the EHR FHIR server doesn't contain this value set, the execution of the plan definition fails.

The attached zip file contains the cql, plan definition, valueset, and a json file containing the POST body used in execution of the plan definition.

aeyates avatar Nov 30 '22 19:11 aeyates

test-case.zip

aeyates avatar Nov 30 '22 19:11 aeyates