Skip to content

x12sdk 2.0.0

Choose a tag to compare

@owgreen-dev owgreen-dev released this 24 Oct 10:56
· 59 commits to main since this release
b0b419a

pip install x12sdk==2.0.0

Fixes silent data loss on two repeating loops. A 270 was keeping only the last eligibility question asked.

What was wrong

Loop 2110 on a 270 repeats up to 99 times, so one inquiry may ask about several service types. The parser assigned a fresh loop on every EQ instead of appending, and the model held a single loop where the 271 correctly holds a list:

EQ*30~   medical
EQ*35~   dental
EQ*88~   vision     <- only this one survived

No error was raised. The other two were simply gone. A provider asking one payer about several coverages in a single transaction is ordinary use.

A sweep of every parser afterwards found a second instance: an 834 kept only the last disability period. That field was already declared a list, so a single period looked correct because a lone record gets wrapped, which hid the defect entirely. No sample in the inherited corpus carries a disability segment at all.

Breaking change

Two fields on the 270 became lists. Reading code that walked them directly must index or iterate now. Nothing else in the public interface changed.

field before after
Loop2100C.loop_2110c Optional[Loop2110C] Optional[List[Loop2110C]]
Loop2100D.loop_2110d Loop2110D (required) List[Loop2110D] (required)
# before
...loop_2100c.loop_2110c.eq_segment

# after
...loop_2100c.loop_2110c[0].eq_segment

The 271 already held lists here, so the two halves of the eligibility pair now agree.

If you use members() you need no change. The accessor already normalised a single loop and a list to the same tuple. Writers are unaffected: constructing a loop with one benefit still works either way.

Also in this release

generate_270 now renders every benefit in a specification. It previously refused more than one, because the defect above made a second inquiry unrepresentable.

Two samples join the corpus for the repaired loops, both in the byte-for-byte round-trip sweep permanently: a 270 asking about several service types across both the subscriber and dependent branches, and an 834 with two disability periods. 87 files to 89.

757 tests on Python 3.10 through 3.13.

Note on 1.2.0

The 1.2.0 notes claimed every supported transaction set could be generated. That was wrong: seven of the eight generate, and the institutional claim 837I has none yet. A PyPI description cannot be edited after upload, so the 1.2.0 page still carries the original wording. This release replaces it on the project page.