Skip to content

Add 5010 Dental (837D / X224A2) map - #1

Open
xuzahn wants to merge 1 commit into
masterfrom
feat/5010-dental-map-x224a2
Open

Add 5010 Dental (837D / X224A2) map#1
xuzahn wants to merge 1 commit into
masterfrom
feat/5010-dental-map-x224a2

Conversation

@xuzahn

@xuzahn xuzahn commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Add 5010 Dental (837D / X224A2) map

What

pyx12 ships 5010 maps for Professional (X222A1) and Institutional (X223A2) claims, but not Dental. This PR adds the 837D X224A2 implementation-guide map (built from the X224A2 TR3) and registers it in maps.xml, so interchanges with GS01=HC / GS08=005010X224A2 resolve and validate (and generate 999 acknowledgements) like the other 837 variants.

Changes

  • pyx12/map/837.5010.X224.A2.xml — the new dental map (standard pyx12 map XML; reuses the existing codes.xml / dataele.xml, so no new code or data-element definitions are required).
  • pyx12/map/maps.xml — one new entry under icvn="00501":
    <map vriic="005010X224A2" fic="HC" abbr="837D">837.5010.X224.A2.xml</map>
  • Tests (both layers, per project convention):
    • test_map_index.pymap_index resolves 005010X224A2 / HC837.5010.X224.A2.xml / abbr 837D (default map dir + explicit map path).
    • test_x12n_document.py + x12testdata.py — new simple_837d fixture drives a clean dental claim end-to-end through x12n_document; the 999 acks accepted (IK5*A / AK9*A*1*1*1) and the JSON output is asserted exact. (Sample claim is fully synthetic.)

Validation

Full suite green: 604 passed. ruff format + ruff check --select I clean on the changed Python files.

One thing worth a maintainer's eye

The map is TR3-derived. The Loop 2300 diagnosis segment HI[ABK] is currently marked Required; the X224A2 IG treats the diagnosis HI as Situational (dental claims often carry no diagnosis). Flagging it in case you'd prefer it relaxed to S to track the IG exactly — happy to adjust.

🤖 Generated with Claude Code

pyx12 ships maps for 5010 Professional (X222A1) and Institutional
(X223A2) but not Dental. Add the 837D X224A2 implementation-guide map
and register it in maps.xml so files with GS08=005010X224A2 / GS01=HC
resolve and validate.

The map reuses the existing codes.xml / dataele.xml — no new code or
data-element definitions are required.

Coverage (both layers per project convention):
- unit: map_index resolves 005010X224A2/HC -> 837.5010.X224.A2.xml / 837D
- regression: simple_837d drives a clean dental claim through
  x12n_document; the 999 acks A (IK5*A / AK9*A*1*1*1) and the JSON
  output is asserted exact.

Note: this map carries a few deliberate deviations from the strict
X224A2 IG (SV311 loosened R->S; 2000C/2010CA patient loops, HCP, CN1
and 2010BB REF kept Situational; DN1/DN2 added to 2300) so it parses
both CMS Medicare and commercial dental traffic. Documented in the map
header.

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

2 participants