`-BundleToResources` silently loses resources (duplicate ids, id-less entries, unparseable bundles), then `-db=true` deletes the source
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start with tooling/src/main/java/org/opencds/cqf/tooling/operation/BundleToResources.java and trace bundle discovery, resource naming and writing, extraction counts, and the -db=true deletion path. Reproduce the reported cases with the sample command and inspect the output and exit status. Done means duplicate and id-less entries cannot be silently overwritten, parse failures are reported, counts reflect written and skipped resources, and source bundles are deleted only after successful extraction.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
-BundleToResources (tooling/src/main/java/org/opencds/cqf/tooling/operation/BundleToResources.java, unchanged
on master e50dc913) can lose resources without any error, report a count that includes them, and then, with
-db=true, delete the only copy. The IG template's _extractBundleResources.sh runs it with -db=true, so this
affects the standard test-case workflow in content IGs.
Reproduced with tooling-cli-3.9.1.jar, the version the template scripts pin.
- Resources with the same
resourceType/idoverwrite each other. The output file name is
<resourceType>-<idPart>.json, written with a plainFileOutputStream, so the last entry wins. The extraction
count still counts every entry. A bundle with twoEncounter/e1entries reports "4 resources extracted" and
writes 3 files; only the second Encounter survives. Output tasks run in parallel, so collisions across bundles
in the same output folder are also last-writer-wins, in no defined order. - Entries without an
idare named from the entry and overwrite each other. An entry with aurn:uuid
fullUrland noidis written asnull-urn:uuid:<uuid>.json. That's not a valid file name on Windows. With no
fullUrl, every id-less entry is written tonull-null.json. In a bundle with an id-less Observation and an
id-less Condition, only the Condition survives. - Files that fail to parse are skipped silently.
discoverBundlesRecursivelycatches every exception and
returnsnull. A bundle with an invalid value (for example"birthDate": "not-a-date") is never counted or
reported. The run ends "Process complete." with no mention of it. -db=truedeletes the source bundle regardless of 1–3. After a lossy extraction, the bundle, which is the
only copy of the lost resources, is deleted.
Steps to reproduce:
mkdir -p t/c
echo '{"resourceType":"Bundle","type":"collection","entry":[
{"fullUrl":"urn:uuid:a","resource":{"resourceType":"Patient","id":"p1"}},
{"fullUrl":"urn:uuid:b","resource":{"resourceType":"Encounter","id":"e1","status":"finished","class":{"code":"AMB"}}},
{"fullUrl":"urn:uuid:c","resource":{"resourceType":"Encounter","id":"e1","status":"finished","class":{"code":"IMP"}}},
{"fullUrl":"urn:uuid:d","resource":{"resourceType":"Observation","status":"final","code":{"text":"x"}}}]}' > t/c/bundle.json
java -jar tooling-cli-3.9.1.jar -BundleToResources -p=t -v=r4 -op=t -db=true
# "4 resources extracted"; files: Encounter-e1.json (IMP only), Patient-p1.json, null-urn:uuid:d.json; bundle.json deleted
Expected behaviour:
- Fail the bundle, with a clear message, when two entries share a
resourceType/id. Name the bundle and the id.
Never overwrite silently. - Fail an entry with no
id, or offer an explicit option to assign one. Never writenull-*files. - Report every file that couldn't be parsed, with the parser's message, and end with a non-zero exit code.
- Make the count report what was written and what was skipped.
- With
-db=true, delete a bundle only when all of its entries were written.
🤖 Generated with Claude Code
- Lingua principale
- Java
- Stelle
- 22
- Fork
- 26
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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/cqf-tooling
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
cqframework/cqf-tooling#575 · 1 commento ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
cqframework/cqf-tooling#567 ·
-
Updated RefreshIG to utilize HttpClientUtils, and restore multithreading and verbose console loggingAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
cqframework/cqf-tooling#564 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
cqframework/cqf-tooling#540 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
cqframework/cqf-tooling#532 ·
Tutte le issue di cqframework/cqf-tooling
Issue simili
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
eclipse-edc/IdentityHub#1296 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
cloudfoundry/uaa#4194 ·
I maintainer di solito rispondono entro 1 giorno
-
ui: 進捗状況線ダイアログが日本語表示で英語のままApertaarea: ui priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
tetsuji16/microProject#1721 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
The engine's "loaded, but had errors" message leaves out which library and line each error is inAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cqframework/clinical_quality_language#1980 ·
I maintainer di solito rispondono entro 3 giorni