Repository navigation
x12sdk 2.1.0
pip install x12sdk==2.1.0
Behaviour change
Every hierarchical transaction set now validates HL parent linkage. Each HL segment's parent id must name the HL it is nested under, and ids must be unique. Until now only the 270 and 271 checked this; every 837 implementation and the 276/277 pair accepted a dangling parent in silence, so a file whose hierarchy could not be walked parsed as if it were fine. All 68 HL-bearing corpus samples pass the rule. If you parse partner files with sloppy HL numbering, they will now be rejected, with a message naming the HL and the parent it claims.
All eight transaction sets now generate
generate_837i joins the set. It takes the same specification as generate_837p; what differs is the claim: SV2 revenue-code lines, a facility type, CL1 admission and status, a statement date. The 1.2.0 notes claimed "all eight" prematurely; it is true now.
An audit suite
src/tests/audit/ turns every bug class that has shipped here into a generic detector, run over every transaction set on every commit: structural checks of the models against the parser, construction of every loop and segment from required fields alone, repeat stress through the generators, and mutation of every corpus sample. Backtested against v1.0.0 it flags every defect found by hand this year, by name. On its way in it found six more, fixed in this release. repo-docs/AUDIT.md describes it, limits included.
Also fixed
Three more repeating loops that kept only their last occurrence; an unguarded 4010 handler that made a class of coordination-of-benefits claim unparseable; HiSegment validating nothing inside its composites; HSD rejecting a valid segment; a 4010 ISA that validated but could not be rendered.
2051 tests on Python 3.10 through 3.13. Corpus 95 files, every one round-tripped byte for byte.