Skip to content

Add required terminology bindings from full-data binding analysis#2

Open
fhnaumann wants to merge 7 commits into
aehrc:mainfrom
fhnaumann:terminology-bindings
Open

Add required terminology bindings from full-data binding analysis#2
fhnaumann wants to merge 7 commits into
aehrc:mainfrom
fhnaumann:terminology-bindings

Conversation

@fhnaumann

@fhnaumann fhnaumann commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Adds required terminology bindings derived from a full-data binding analysis of the MIMIC dataset, and migrates Condition.code from the custom MIMIC ICD CodeSystems to standard ICD-9-CM/ICD-10-CM.

Changes

Terminology bindings (commit 1)

  • Terminology bindings added across profiles (Encounter, Location, Medication*, Observation Micro/Vitals, Organization, MedicationStatementED).
  • New ValueSet-mimic-medication-with-unknown and supporting ValueSet/CodeSystem/alias updates.
  • Adds scripts/binding-analysis/ — the analysis pipeline and reports (distinct codes, cross-check, findings) used to derive the bindings.

Condition code migration (commit 2)

  • New ValueSet-mimic-diagnosis composed of standard http://hl7.org/fhir/sid/icd-9-cm (FY2012) and http://hl7.org/fhir/sid/icd-10-cm (FY2016–FY2019 + FY2024) content; MimicCondition.code now binds to it instead of the custom mimic-diagnosis-icd ValueSet.
  • The superseded mimic-diagnosis-icd ValueSet and mimic-diagnosis-icd9/icd10 CodeSystems are marked retired (kept for provenance).
  • Condition examples updated to standard dotted codes with pinned versions.
  • Matches the migrated MIMIC-on-FHIR data: all 5.66M Condition codings rewritten to the standard systems with pinned versions, zero residual custom-system codings.

Verification

  • sushi . compiles cleanly: 0 Errors, 0 Warnings (25 profiles, 2 extensions, 9 ValueSets, 29 instances).

Supersedes #1, which inadvertently also included unmerged commits from the _validation_fixes branch.

🤖 Generated with Claude Code

fhnaumann and others added 7 commits July 15, 2026 09:33
…ICD-9-CM/ICD-10-CM

Bind Condition.code to a new mimic-diagnosis ValueSet composed of standard
http://hl7.org/fhir/sid/icd-9-cm (FY2012) and icd-10-cm (FY2016-FY2019 +
FY2024) content, matching the migrated MIMIC-on-FHIR data where all 5.66M
Condition codings were rewritten to the standard systems with pinned
versions (zero residual custom-system codings).

- Add ValueSet mimic-diagnosis and switch SD_MimicCondition binding to it
- Retire the superseded mimic-diagnosis-icd ValueSet and the
  mimic-diagnosis-icd9/icd10 CodeSystems (kept for provenance)
- Update Condition examples to standard dotted codes with pinned versions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plain copy (no history) of the ICD CodeSystem/ValueSet build scripts into
scripts/terminology-build/. The macOS-only textutil RTF conversion is
replaced with pure-Python striprtf (pinned via uv), verified byte-identical
against the previously generated CodeSystem-icd-9-cm-2012.json. Large
generated CodeSystems (~36 MB each) are gitignored and will be published
as GitHub release assets; only the small ValueSet-mimic-diagnosis.json is
committed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nerated files

- scripts/icd-migration/: check/migrate scripts, display-map.json (the
  committed relabel/version-pin decision record), evidence artifacts
  (migration-report.json moved here from repo root, unmapped/validation
  CSVs), and verify_migration.py (renamed from tmp_verify_migration.py --
  it is the independent row-by-row verifier for the migration, kept as the
  stage's verification step).
- _genonce.sh: CSIRO Ontoserver as -tx terminology server with the velonto
  truststore; _build.sh + .python-version committed; Windows .bat scripts
  and generated .index.db / transformed_data/ gitignored.
- template-kindlab .index.json churn from the newer publisher committed so
  rebuilds leave a clean tree; main.py hello-world stub deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Scripts read ONTOSERVER_URL / ICD_SOURCE_DIR / MIMIC_WAREHOUSE as
  defaults (CLI flags still override); .env.example documents the set.
- Terminology builds no longer upload by default: upload only runs when a
  server is configured, and check_icd_codes.py errors out without one.
- input-manifest.json pins SHA-256 of the exact ICD source files the
  committed CodeSystems were generated from (only the files that influence
  output), plus the MIMIC data fingerprint; verify_inputs.py checks a
  local copy against it.
- Makefile: one target per stage (verify-inputs, terminology,
  deploy-terminology, ig, check-codes, migrate, verify-migration).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Consolidates NOTES.md and MODIFICATION_PLAN.md (deleted) into one
authoritative document: pipeline DAG with the laptop/HPC-node boundary,
env-var configuration, toolchain versions, per-stage commands and
verification, provenance narrative (binding analysis D1-D4, Condition.code
migration incl. false-flag relabels, version history to 1.4.0-csiro),
one-time analysis scripts with manual invocations, release/rebuild
procedure, and known caveats (velonto truststore recipe, unpinned
publisher, ICD-10-CM 2024 sourced outside this repo).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
johngrimes added a commit that referenced this pull request Jul 17, 2026
Merges #2 (fhnaumann:terminology-bindings) into velonto.

# Conflicts:
#	.gitignore
#	README.md
#	input/resources/CodeSystem-mimic-diagnosis-icd10.json
#	input/resources/CodeSystem-mimic-diagnosis-icd9.json
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