fix(hts): bundle UCUM ucum-essence.xml instead of relying on THO#176
Merged
Conversation
The HL7 THO tarball ships only the UCUM ValueSets (ucum-units, ucum-common) and a NamingSystem — it does not define the UCUM CodeSystem. As a result http://unitsofmeasure.org had zero concepts loaded, so $lookup and $validate-code against UCUM units returned not-found. Replace the no-op 'bundled in THO' UCUM step in the download script with an actual fetch of the canonical ucum-essence.xml (pinned UCUM_VERSION=v2.2), and check in the resulting ucum-essence-v2.2.xml. The filename keeps 'ucum'/'essence' so HTS bootstrap auto-detects ImportFormat::Ucum. Verified via 'hts import --dry-run': 336 codes parsed (24 prefixes, 7 base-units, 305 units), 1 CodeSystem.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The deployed HTS (hts.heliossoftware.com) has no UCUM code system:
$lookup/$validate-codeagainsthttp://unitsofmeasure.orgreturnnot-found. The bundle download script claimed UCUM was "bundled in THO," but the HL7 THO tarball ships only the UCUM ValueSets (ucum-units,ucum-common) and aNamingSystem— it never defines the UCUM CodeSystem. So importing THO alone leaveshttp://unitsofmeasure.orgwith zero concepts.Fix
crates/hts/scripts/download-bundled-terminologies.sh: replace the no-op "bundled in THO" UCUM step with an actual fetch of the canonicalucum-essence.xml(pinnedUCUM_VERSION=v2.2), and correct the misleading comment.crates/hts/terminology-data/ucum-essence-v2.2.xml(82 KB, well under GitHub's 100 MB limit). The filename keepsucum/essenceso HTS bootstrap auto-detectsImportFormat::Ucum.Verification
http://unitsofmeasure.org/ucum-essence, 24 prefixes / 7 base-units / 305 units.bash -npasses on the script.htsbinary:Once this lands and HTS redeploys,
http://unitsofmeasure.orgwill resolve and UCUM unit$lookup/$validate-codewill work.Note
Unrelated to the NDC gap (also currently missing on the server) — that is already fixed by 0788575 and just needs the redeploy. UCUM was a separate gap in the bundle.