Skip to content

Pad ARI ids in the equivalencies export to match the ontology - #62

Merged
KrishnaTO merged 2 commits into
claude/remove-icd9-codes-from-datafrom
claude/fix-ari-id-padding
Aug 16, 2026
Merged

Pad ARI ids in the equivalencies export to match the ontology#62
KrishnaTO merged 2 commits into
claude/remove-icd9-codes-from-datafrom
claude/fix-ari-id-padding

Conversation

@KrishnaTO

Copy link
Copy Markdown
Owner

Stacked on #61 — its base is claude/remove-icd9-codes-from-data, so review that one first. GitHub will retarget this to main automatically once #61 merges. Stacking avoids a delete-versus-modify conflict on the four rows both changes touch.

What and why

69 rows in mappings/ari.equivalencies.tsv spelled their disease as ARI 1001 where the ontology and mappings/ari.sssom.tsv both spell it ARI 0001001. The three files therefore did not join on disease id without normalising first — which is exactly what kept the drift between the two exports invisible for so long.

12 distinct diseases, 69 rows, one column.

The correct spelling is read, not assumed

The fix takes each id from ARI_ID in ontologies/ari_t1d.owl rather than zero-padding to a fixed width. That matters: ARI:0002 and ARI:0003 are genuinely four digits in the ontology, and padding them to seven would have introduced the same class of bug in the other direction.

Verification

  • 69 insertions, 69 deletions. On every rewritten row, column 2 is the only column that differs — checked mechanically, not by eye.
  • No row added or removed.
  • Whole-repository errors 94 → 25 on top of Remove 89 ICD-9 codes filed under ICD-10 fields #61; every subject-padding finding cleared.

Advances #23 ("Validate all diseases with database xrefs"); referenced rather than closed.

🤖 Generated with Claude Code

69 rows spelled their disease as ARI 1001 where the ontology and
ari.sssom.tsv both spell it ARI 0001001, so the three files did not join
on disease id without normalising first. That is what kept the drift
between the two exports hard to see.

The correct spelling is read from ARI_ID in the ontology rather than
assumed to be seven digits, because ARI:0002 and ARI:0003 are genuinely
four digits there and must not be re-padded.

Only column 2 differs on every rewritten row; no row added or removed.

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