Execute CQL outside an IG project fails with a `NoOpRepository.search` null error when the library uses a value set
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
The failure comes from the terminology repository built in CqlEvaluator.kt from libraryResolutionManager.getInputDirectories(), which becomes NoOpRepository when no IG project is present; NoOpRepository.kt's search method declares its map parameter non-null. Start by reading how CqlEvaluator uses the request's terminologyUri and check whether it can be passed into the repository construction. Done when the reproduction library evaluates the value set define without the non-null error, or the request fails with a clear message.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With cql-language-server 5.0.0, evaluating a library that retrieves by value set fails when the workspace holds no IG project, even when the request gives a terminologyUri.
To reproduce
A plain folder, with no ig.ini in it or above it, as the workspace:
Repro.cql
data/Patient/p1.json
data/Observation/o1.json (code a in http://example.org/fhir/CodeSystem/example)
valueset/ValueSet-example-codes.json
Repro.cql has
valueset "Example Codes": 'http://example.org/fhir/ValueSet/example-codes'
define "Has Coded Observation":
exists ([Observation: "Example Codes"])
The files of the reproduction
Repro.cql
library Repro
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
valueset "Example Codes": 'http://example.org/fhir/ValueSet/example-codes'
parameter Offset Integer default 1
context Patient
define "Has Coded Observation":
exists ([Observation: "Example Codes"])
define "Offset Plus One":
Offset + 1
data/Patient/p1.json
{ "resourceType": "Patient", "id": "p1", "birthDate": "2020-01-01" }
data/Observation/o1.json
{ "resourceType": "Observation", "id": "o1", "status": "final",
"code": { "coding": [{ "system": "http://example.org/fhir/CodeSystem/example", "code": "a" }] },
"subject": { "reference": "Patient/p1" } }
valueset/ValueSet-example-codes.json
{ "resourceType": "ValueSet", "id": "example-codes", "url": "http://example.org/fhir/ValueSet/example-codes", "status": "active",
"compose": { "include": [{ "system": "http://example.org/fhir/CodeSystem/example", "concept": [{ "code": "a" }] }] },
"expansion": { "timestamp": "2026-01-01T00:00:00Z", "contains": [{ "system": "http://example.org/fhir/CodeSystem/example", "code": "a" }] } }
I sent the request through cqframework/cql-mcp 0.1.0-rc.2 (cql_execute with cqlFile, contextValues: ["p1"], modelUri = the data folder, terminologyUri = the valueset folder).
What I see
Parameter specified as non-null is null: method org.opencds.cqf.cql.ls.server.command.NoOpRepository.search, parameter map
The same happens without terminologyUri. With the same files in an IG layout (ig.ini, input/cql, input/vocabulary/valueset) the define evaluates to true.
Likely cause (read, CqlEvaluator.kt and NoOpRepository.kt at v5.0.0; master at 1bed013 is the same)
The terminology repository is built from libraryResolutionManager.getInputDirectories(), and is a NoOpRepository when there are none. The request's terminologyUri is used in the grouping key but not to build that repository. NoOpRepository.search declares its map argument non-null and is called with null.
What would help
Either use terminologyUri when it is given, or return a message that says no terminology is available outside an IG project.
Two more runs, with an IG project in the workspace beside the plain folder:
- The IG has the value set and the request gives no
terminologyUri: the plain-folder library evaluates totrue, so it used the IG'sinput/vocabulary. That may be intended. - The IG has no value sets and the request gives
terminologyUri= the plain folder'svalueset:Unable to locate ValueSet http://example.org/fhir/ValueSet/example-codes. SoterminologyUriis not used there either, though the message is clear in that case.
Environment: language server jar from Maven Central, Temurin JDK 21, macOS arm64.
- Lingua principale
- Kotlin
- Stelle
- 2
- Fork
- 4
- Merge medio
- 1g 16h
- PR unite (30g)
- 3
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cqframework/cql-language-server
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
multiple IG project fhir/package cache stubsForse di nuovo libera @raleigh-g-thompson l’ha presa 145 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
cqframework/cql-language-server#155 · 1 assegnatario ·
-
debugger isn't working with muti-project setupsForse di nuovo libera @raleigh-g-thompson l’ha presa 146 giorni fa e non c’è nessuna pull request aperta. Apertabug
cqframework/cql-language-server#154 · 1 assegnatario ·
-
Need smaller jar buildForse di nuovo libera @raleigh-g-thompson l’ha presa 157 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
cqframework/cql-language-server#146 · 1 assegnatario ·
-
Update master branch protection required checks after CI workflow rewriteForse di nuovo libera @brynrhodes l’ha presa 170 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
cqframework/cql-language-server#142 · 1 assegnatario ·
Tutte le issue di cqframework/cql-language-server
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
commons-app/apps-android-commons#7486 ·
I maintainer di solito rispondono entro 1 giorno
-
area: ci area: local-media area: startup area: ui platform: bilibili platform: netease platform: youtube status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
cwuom/NeriPlayer#794 ·
I maintainer di solito rispondono entro 1 giorno
-
area:android area:ui bug priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
meraxes89/streamify-apk#449 ·
I maintainer di solito rispondono entro 1 giorno
-
easy first-contributor first-contributors good first issue help wanted kotlin up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
fork-commit-merge/fork-commit-merge#8752 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
MetrolistGroup/Metrolist#5559 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno