azoner/pyx12

Cannot distinguish repeated SEGMENT outside LS loop

Opened this issue · 2 comments

We are not able to construct a map that pyX12 can recognize where there is a repeated segment inside an LS loop and the optional segment is absent.

For example, consider:

LoopID 300 -->
LX
MAN

LoopID 310 -->
W01
G69
LS
LoopID 330 -->
LX
etc.
LoopID 330 <--
LE
LoopID 310 <--
LoopID 300 <--

In our sample data, we have multiple LX's that are attached to the 300 loop and no LX's for the 330 loop. The parser thinks the second LX belongs to the 330 loop. We have not been able to construct a map that forces the parser to pop up the tree when it recognizes a missing LS. Trying to make it required fails.

The concrete example is the EDI 940 standard. I can share our map.

See Issue #42 -- this change to the map for 834 5010 A1 should address this...