Skip to content

Remove 89 ICD-9 codes filed under ICD-10 fields - #61

Merged
KrishnaTO merged 2 commits into
mainfrom
claude/remove-icd9-codes-from-data
Aug 16, 2026
Merged

Remove 89 ICD-9 codes filed under ICD-10 fields#61
KrishnaTO merged 2 commits into
mainfrom
claude/remove-icd9-codes-from-data

Conversation

@KrishnaTO

@KrishnaTO KrishnaTO commented Aug 16, 2026

Copy link
Copy Markdown
Owner

⚠️ Data change to ontologies/ari_t1d.owl and both mapping exports. 89 deletions, no additions.

The rule

Every ICD-10-CM code begins with a letter. A digit-led value in an ICD-10 field is therefore an ICD-9-CM code stored under the wrong vocabulary — 446.1, 720.0 and 390-392.99 are ICD-9; M30.3, M45 and E10 are not.

Where Removed
ontologies/ari_t1d.owlARI_ICD10 values across 53 diseases 61
mappings/ari.sssom.tsv rows 14
mappings/ari.equivalencies.tsv rows 14

Letter-led values were left alone, including the range I00-I02 on Rheumatic fever — that is a separate defect (a range where a single code belongs) and is still reported by the validator.

Judgement calls worth a look

Four diseases now have no ICD-10 code at all, because everything they held was ICD-9: ARI:0001032, ARI:0001033, ARI:0001119, ARI:0001201. Those cells now read as no term recorded, which is the honest state, but it is a visible drop in apparent coverage.

Ten of the fourteen mapping rows were negative judgments, not confirmations — a curator had already reviewed the code and rejected it. Dropping them removes a record. The reasoning for doing so anyway: a rejection of a code that cannot be represented in the target vocabulary carries nothing forward, and nine of the ten already had no stored id to guard. Affected: ARI:0001012, 0001014, 0001061, 0001062, 0001063, 0001065, 0001068, 0001073, 0001074, 0001107.

Three unrelated errors fall out of this

ARI:0001012 -> icd10cm:720.0 was recorded as both confirmed and flagged wrong, and was the one id still stored on its disease after #60 despite being flagged. Both rows and the stored value are ICD-9, so all three go together. Two of the six drifts between the two exports (362.50/362.5 and 720.0/720) go with them.

Note on #57

#57 retired ICD-9 from data/3-meta-database-sources/meta-databases.csv, notebook/ari-grounding/make_match_reports.py and connecting_ontologies.drawio — but it merged into feature/metadata-manager_v2/ARI, not main. None of it is on this branch, so main still advertises ICD9/ICD9CM as sources and still groups ICD-9 into the report's ICD column. This PR covers the data only; porting #57 to main is still outstanding.

Verification

Validated with the checker from #63. Whole-repository errors 193 → 94; every icd9-under-icd10 finding cleared, along with contradiction and flagged-still-stored. The ontology diff is 61 pure deletions, all ARI_ICD10 annotation lines, zero additions, and the file still parses as XML.

Advances #23 ("Validate all diseases with database xrefs"); the other subtasks are untouched, so it is referenced rather than closed.

🤖 Generated with Claude Code

Every ICD-10-CM code begins with a letter, so a digit-led value in an
ICD-10 field is an ICD-9 code stored under the wrong vocabulary. 61 such
values were in ARI_ICD10 across 53 diseases, with 14 matching rows in
each mapping export.

Letter-led values were left alone, including the range I00-I02 on
Rheumatic fever, which is a different defect.

Four diseases are left with no ICD-10 code at all because everything
they held was ICD-9: ARI:0001032, ARI:0001033, ARI:0001119, ARI:0001201.
Those cells now read as no term recorded, which is the honest state.

Ten of the fourteen mapping rows were negative judgments rather than
confirmations. Dropping them removes a record, but a rejection of a code
that cannot be represented in the target vocabulary carries nothing
forward, and nine of the ten already had no stored id to guard.

This also clears three unrelated errors that happened to be ICD-9 all
the way down: ARI:0001012 -> icd10cm:720.0 was recorded as both
confirmed and flagged wrong, and was the one id still stored after #60
despite being flagged.

#57 retired ICD-9 from the source list, the report script and the
diagram, but it merged into feature/metadata-manager_v2/ARI rather than
main, so none of that is on this branch. Porting it is still open.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
#52 landed 11 new mapping rows in each export while this branch was
open, conflicting with the rows it deletes. Rather than hand-resolve the
hunks, both mapping files were taken wholesale from main and the ICD-9
filter re-run over them, so the result is derived from current data
rather than patched around it.

#52 introduced no new ICD-9 codes: the ontology merged cleanly and a
re-run removed nothing further from it. The diff against main is still
exactly 89 deletions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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