Skip to content

refactor(snomed): adapt shim — biodb retired the bulk downloader - #7

Merged
bschilder merged 1 commit into
mainfrom
refactor/snomed-retire-bulk
May 18, 2026
Merged

refactor(snomed): adapt shim — biodb retired the bulk downloader#7
bschilder merged 1 commit into
mainfrom
refactor/snomed-retire-bulk

Conversation

@bschilder

Copy link
Copy Markdown
Owner

Summary

Follow-up to bioDB#18. The SNOMED bulk downloader (and the GitHub Release asset it pulled) was retired in bioDB for SNOMED CT licensing reasons — onward redistribution from a public mirror isn't permitted under the IHTSDO / UMLS license.

synthlab/download_snomed.py was a shim that re-exported the bioDB names. With those names removed upstream, the shim needs an update.

Changes

  • Drops stale imports of GITHUB_*, SNOMED_RELEASE_URL, download_concept_csv — those names no longer exist in biodb.snomed.
  • Re-exports the OLS-backed query helpers (query_concept, search_concepts, get_descendants, get_ancestors, get_children, get_parents) and the parsers (load_concept_csv, load_concept_csv_from_zip) from biodb.snomed. The OLS path is unaffected by the licensing change — EBI handles SNOMED CT licensing server-side.
  • Keeps download_snomed_vocabulary / is_snomed_available / get_concept_csv_path as deprecated stubs that raise RuntimeError with migration guidance pointing at https://athena.ohdsi.org. They can't be transparently emulated since the GitHub asset is gone.

The four names imported by synthlab/__init__.py (download_snomed_vocabulary, get_concept_csv_path, is_snomed_available, get_snomed_data_dir) all remain importable — the first three raise on call, the last is the live biodb function.

Migration for downstream callers

# Was:
from synthlab.download_snomed import download_snomed_vocabulary
path = download_snomed_vocabulary()                            # → RuntimeError now

# Is:
from biodb.snomed import load_concept_csv
# 1. Get a bundle from https://athena.ohdsi.org (accept the SNOMED CT license)
df = load_concept_csv("~/Downloads/CONCEPT.csv")
# or
from biodb.snomed import load_concept_csv_from_zip
df = load_concept_csv_from_zip("~/Downloads/vocabulary_download_v5_xxx.zip")

Test plan

  • Local import of from synthlab.download_snomed import ... resolves cleanly with biodb installed
  • Calling any of the three deprecated stubs raises RuntimeError with the Athena migration note
  • CI green (synthlab's pytest suite — exercises real install of biodb from git)

🤖 Generated with Claude Code

bioDB merged refactor/snomed-bulk-parser-only on 2026-05-18. The
GitHub-release-backed SNOMED downloader (synthlab's original
implementation, relocated to biodb earlier today) was removed for
SNOMED CT licensing reasons. CONCEPT.csv is now obtained by the user
from https://athena.ohdsi.org after accepting the SNOMED CT license.

synthlab/download_snomed.py:
  * Drops imports of GITHUB_*, SNOMED_RELEASE_URL, download_concept_csv
    — those names no longer exist in biodb.snomed.
  * Re-exports the OLS-backed query helpers (query_concept,
    search_concepts, get_descendants, ...) and the parsers
    (load_concept_csv, load_concept_csv_from_zip) from biodb.snomed.
  * Keeps download_snomed_vocabulary / is_snomed_available /
    get_concept_csv_path as deprecated stubs that raise RuntimeError
    with migration guidance — they can't be transparently emulated
    since the asset is gone.
  * Module docstring rewritten to explain the licensing posture and
    point at the Athena flow.

The four names imported by synthlab/__init__.py
(download_snomed_vocabulary, get_concept_csv_path, is_snomed_available,
get_snomed_data_dir) all remain importable; the first three raise on
call, the last is the live biodb.snomed function.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bschilder
bschilder merged commit 9fdd630 into main May 18, 2026
1 check passed
@bschilder
bschilder deleted the refactor/snomed-retire-bulk branch May 18, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant