Skip to content

Match ICD-10 codes regardless of which side has the dot - #21

Open
anapaulagomes wants to merge 1 commit into
mainfrom
fix-dotted-code-matching
Open

anapaulagomes wants to merge 1 commit into
mainfrom
fix-dotted-code-matching

Conversation

@anapaulagomes

@anapaulagomes anapaulagomes commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • _code_to_regex only tolerated a missing dot on the value side (definition code A90 matched value A90.1), never the reverse — a definition code written without the dot (A692, as some community definitions and NSSP/CCDD-style catalogs do) never matched a dotted value (A69.2), and vice versa.
  • Both sides are now compared with the dot stripped, so A692, A69.2 and A69 all match A69.2 and A692 alike, regardless of which one carries the dot.

Test plan

  • Added/updated tests/test_filter.py::TestCodeToRegex for both-direction dot matching, plus a case guarding against unrelated categories still being rejected.
  • Updated the previous "exact code does not match extension" test, since a value with more digits is genuinely a real sub-code of the category (A90 matching A900 is correct once dot placement is no longer load-bearing).
  • pytest — 240 passed, 15 skipped (pre-existing network-dependent skips).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AsB13LEzvKquKxVGwghnoY

This branch has not been deployed

No deployments
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