Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

834 5010 LS/LE (Loop 2700/2750) Additional Reporting Categories not correct #42

Closed
ddw360 opened this issue Oct 22, 2015 · 17 comments
Closed

Comments

@ddw360
Copy link

ddw360 commented Oct 22, 2015

The 005010X220A1-834 Benefit Enrollment and Maintenance TR3 Errata report published June 2010, specifies corrections to handling of LS/LE Loop envelope for Additional Reporting Categories.

See for reference sample data structure to use to test:
Click Link Here

Changes that needed to be addressed:

  1. LS (Pos 6880) and LE (Pos 6885) are both segments within Loop 2000, not Loop 2700. Only one LS/LE pair allowed for each Loop 2000.
  2. LX (Pos 6881) segment within LS/LE is Loop 2700, not Loop 2710 (which has been eliminated).
  3. Loop 2750 is a child sub-loop of Loop 2700 containing the following segments:
  • N1 (Pos 6882)
  • REF (Pos 6883)
  • DTP (Pos 6884)

Recommended change to V2 map (not tested, still trying to figure out how to have library force use of correct map!!): 834.5010.X220.A1.v2.xml

...
        <!--End of 2300 loop-->
        <!-- Loop 2000, LS/LE Loop Envelope: Additional Reporting Categories-->
        <segment xid="LS" usage="R" pos="6880" max_use="1" name="Additional Reporting Categories">
          <element xid="LS01" data_ele="447" usage="R" seq="01" name="Loop Identifier Code" />
        </segment>
        <!--End of segment LS-->
        <loop xid="2700" pos="6801" usage="R" repeat="&gt;1" name="Member Reporting Categories">
          <segment xid="LX" usage="R" pos="6881" max_use="1" name="Member Reporting Categories">
            <element xid="LX01" data_ele="554" usage="R" seq="01" name="Assigned Number" />
          </segment>
          <!--End of segment LX-->
          <loop xid="2750" pos="6802" usage="R" repeat="1" name="Reporting Category">
            <segment xid="N1" usage="R" pos="6882" max_use="1" name="Reporting Category">
              <syntax>R0203</syntax>
              <syntax>P0304</syntax>
              <element xid="N101" data_ele="98" usage="R" seq="01" name="Entity Identifier Code">
                <valid_codes>
                  <code>75</code>
                </valid_codes>
              </element>
              <element xid="N102" data_ele="93" usage="R" seq="02" name="Member Reporting Category Name" />
              <element xid="N103" data_ele="66" usage="N" seq="03" name="Identification Code Qualifier" />
              <element xid="N104" data_ele="67" usage="N" seq="04" name="Identification Code" />
              <element xid="N105" data_ele="706" usage="N" seq="05" name="Entity Relationship Code" />
              <element xid="N106" data_ele="98" usage="N" seq="06" name="Entity Identifier Code" />
            </segment>
            <!--End of segment N1-->
            <segment xid="REF" usage="S" pos="6883" max_use="1" name="Reporting Category Reference">
              <syntax>R0203</syntax>
              <element xid="REF01" data_ele="128" usage="R" seq="01" name="Reference Identification Qualifier">
                <valid_codes>
                  <code>00</code>
                  <code>17</code>
                  <code>18</code>
                  <code>19</code>
                  <code>26</code>
                  <code>3L</code>
                  <code>6M</code>
                  <code>9V</code>
                  <code>9X</code>
                  <code>GE</code>
                  <code>LU</code>
                  <code>PID</code>
                  <code>XX1</code>
                  <code>XX2</code>
                  <code>YY</code>
                  <code>ZZ</code>
                </valid_codes>
              </element>
              <element xid="REF02" data_ele="127" usage="R" seq="02" name="Member Reporting Category Reference ID" />
              <element xid="REF03" data_ele="352" usage="N" seq="03" name="Description" />
              <composite xid="REF04" data_ele="C040" usage="N" seq="04" name="Reference Identifier" />
            </segment>
            <!--End of segment REF-->
            <segment xid="DTP" usage="S" pos="6884" max_use="1" name="Reporting Category Date">
              <element xid="DTP01" data_ele="374" usage="R" seq="01" name="Date Time Qualifier">
                <valid_codes>
                  <code>007</code>
                </valid_codes>
              </element>
              <element xid="DTP02" data_ele="1250" usage="R" seq="02" name="Date Time Period Format Qualifier">
                <valid_codes>
                  <code>D8</code>
                  <code>RD8</code>
                </valid_codes>
              </element>
              <element xid="DTP03" data_ele="1251" usage="R" seq="03" name="Member Reporting Category Effective Date(s)" />
            </segment>
            <!--End of segment DTP-->
          </loop>
          <!--End of 2750 loop-->
        </loop>
        <!--End of 2700 loop-->
        <segment xid="LE" usage="S" pos="6885" max_use="1" name="Additional Reporting Categories Loop Termination">
          <element xid="LE01" data_ele="447" usage="R" seq="01" name="Loop Identifier Code" />
        </segment>
        <!--End of segment LE-->
      </loop>
      <!--End of 2000 loop-->
...
@azoner
Copy link
Owner

azoner commented Oct 22, 2015

Thanks for the detail. I will update the 834 5010 E1 map to reflect the changes.

The LS and LE segments are situational, unless there are 2700 loops, in which case they are required. I have code to handle these odd X12 structures - just have to test.

Do you have any test 834 files? If not, I can create some simple examples. Will need to do regression tests against some currently valid 834 files.

The validation script (x12valid.py) can be passed an alternate path to a set of X12 map files. The script looks in that path for the 'maps.xml' file - which is a lookup from the Interchange Control Version Number (ISA12), Functional Identifier Code (GS01), and Version / Release / Industry Identifier Code (GS08) fields to a xml map filename for that transaction. You can copy the map folder to another location and test your v2 maps from there.

@ddw360
Copy link
Author

ddw360 commented Oct 23, 2015

Here is a sample 834 (de-identified of course) - that should serve as a good test dataset for handling LS/LE.

ISA*00* *00* *ZZ*ORDHS *ZZ*MB888880 *130312*0206*!*00501*000000238*0*P*:~
GS*BE*ORDHS*MB888880*20130312*020630*146*X*005010X220A1~
ST*834*146001*005010X220A1~ 
BGN*00*0158420020130310001*20130312*0206*PT***2~
REF*38*500647166 ~
N1*P5*OR-MMIS*FI*930592162~
N1*IN**FI*455492679~
INS*Y*18*001*AI*A*C**AC**N~
REF*0F*REF OF~
REF*23*REF 23~
REF*3H*REF 3H~
REF*F6*REF F6~
DTP*356*D8*20120901~
DTP*357*D8*20130331~
NM1*74*1*SUBSCRIBER LAST 1*SUBSCRIBER FIRST 1*M***34*544001234~
PER*IP**TE*5554718931~
N3*SUBSCRIBER1 ADDRESS 1~
N4*GRANTS PASS*OR*975260000**CY*033~
DMG*D8*19830719*F**C:RET:2186-5~
AMT*P3*82.25~
LUI*LE*ENG**7~
LUI*LE*ENG**5~
NM1*70*1*INCORRECT*FIRST*A***34*001223344~
DMG*D8*19930620*F~
NM1*31*1~
N3*RECIPIENT MAIL ADDRESS LINE 1*RECIPIENT MAIL ADDRESS LINE 2~
N4*SALEM*OR*97301~
NM1*QD**1*RESPONSIBLE PARTY*SMITH*JOHN~
NM1*GD*1*COMPANY NAME 40 CHARACTER OF DATA~
HD*001**HMO*12345678902012062020130415N*IND~
DTP*348*D8*20120901~
REF*17*D4~
COB*U*D183*5~
COB*U*J375*5~
LS*2700~
LX*1~
N1*75*NEWBORN INDICATOR~
REF*ZZ*Y~
LX*2~
N1*75*PREVIOUS PMP END DATE~
DTP*007*D8*20130615~
LX*3~
N1*75*ALTERNATE FORMAT~
REF*ZZ*10~
LX*4~
N1*75*DUE DATE~
DTP*007*D8*20130620~
LX*5~
N1*75*BRANCH - WORKER~
REF*3L*1234567~
LX*6~
N1*75*FIPS CODE ~
REF*3L*88~
LX*7~
N1*75*NATIVE AMERICAN HERITAGE CODE~
REF*XX1*Y~
LX*8~
N1*75*GROUP CODE~
REF*XX1*A~
LX*9~
N1*75*BENEFIT PLAN~
REF*PID*BEN~
LX*10~
N1*75*PROGRAM ELIGIBILITY CODE~
REF*17*11~
LX*11~
N1*75*SNRG~
REF*XX1*7~
LX*12~
N1*75*TPL CODE~
REF*9X*99~
LX*13~
N1*75*END REASON~
REF*17*11~
LE*2700~
SE*73*146001~
GE*1*146~
IEA*1*000000238~

Thanks for the tip on the x12valid.py. Does that mean the modules: x12xml.py and xmlx12.py currently do not implement using specific map versions or modified maps? Or am I to interpret that the procedure is as follows:

  1. x12xml.py and xmlx12.py support passing a "mappath (-m)" parameter to point to a map directory. If "-m " reference is passed, both modules will look for maps.xml in that path.
  2. If the map folder containing maps.xml has v1 map files - then it will default to v1 map files. If the map folder containing maps.xml only has v2 map files - then is will access maps.v2.xml to reference v2 map files?!? Need some clarification - I am still a python beginner so trying to debug and understand took some major time.

Much appreciated, great library - if I can understand it better, I might be able to contribute more...

@michaelachrisco
Copy link

Is this still an issue? I was thinking of using this library for an 834 file. Appreciate the work so far!

@azoner
Copy link
Owner

azoner commented Jul 25, 2016

I don't think I completed this. I started work on a branch nine months ago. I'll take a look at where it is now.

https://github.com/azoner/pyx12/tree/fix-834-LS-2700-loop

@michaelachrisco
Copy link

Appreciate it! At the moment, the 834 file/generation service I am testing passes...so I am not sure if the spec is wrong or what. Ill have to double check.

The package is working on all the other validation scenarios which is great (thanks!).

@johncade
Copy link

johncade commented Jun 13, 2018

I am persistently running into errors with the LS segment. Here is a snippet from my output when calling x12html:

2018-06-13 14:28:56,450 DEBUG X12 control file: x12.control.00501.xml
2018-06-13 14:28:56,450 DEBUG Looking for map file 'x12.control.00501.xml' in pkg_resources
2018-06-13 14:28:56,451 DEBUG Create map from x12.control.00501.xml
2018-06-13 14:28:56,451 DEBUG Looking for codes file 'codes.xml' in pkg_resources
2018-06-13 14:28:56,457 DEBUG Looking for data element definition file 'dataele.xml' in pkg_resources
2018-06-13 14:28:56,460 DEBUG Looking for map index file 'maps.xml' in pkg_resources
2018-06-13 14:28:56,462 DEBUG Looking for map file '834.5010.X220.A1.xml' in pkg_resources
2018-06-13 14:28:56,462 DEBUG Create map from 834.5010.X220.A1.xml
2018-06-13 14:28:56,467 DEBUG Looking for codes file 'codes.xml' in pkg_resources
2018-06-13 14:28:56,473 DEBUG Looking for data element definition file 'dataele.xml' in pkg_resources
2018-06-13 14:28:56,484 DEBUG Map file: 834.5010.X220.A1.xml
2018-06-13 14:28:56,499 ERROR Line:34 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,500 ERROR Line:36 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,501 ERROR Line:40 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,502 ERROR Line:43 SEG:5 - Segment LX exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,503 ERROR Line:44 SEG:4 - Loop 2750 exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,504 ERROR Line:47 SEG:5 - Segment LX exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,504 ERROR Line:48 SEG:4 - Loop 2750 exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,505 ERROR Line:51 SEG:5 - Segment LX exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,506 ERROR Line:52 SEG:4 - Loop 2750 exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,506 ERROR Line:54 SEG:5 - Segment LX exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,507 ERROR Line:55 SEG:4 - Loop 2750 exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,508 ERROR Line:58 SEG:5 - Segment LX exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,508 ERROR Line:59 SEG:4 - Loop 2750 exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,509 ERROR Line:61 SEG:5 - Segment LX exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,509 ERROR Line:62 SEG:4 - Loop 2750 exceeded max count.  Found 8, should have 1
2018-06-13 14:28:56,510 ERROR Line:65 SEG:5 - Segment LX exceeded max count.  Found 8, should have 1
2018-06-13 14:28:56,511 ERROR Line:66 SEG:4 - Loop 2750 exceeded max count.  Found 9, should have 1
2018-06-13 14:28:56,512 ERROR Line:69 SEG:5 - Segment LX exceeded max count.  Found 9, should have 1
2018-06-13 14:28:56,513 ERROR Line:70 SEG:4 - Loop 2750 exceeded max count.  Found 10, should have 1
2018-06-13 14:28:56,514 ERROR Line:74 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,521 ERROR Line:93 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,522 ERROR Line:95 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,523 ERROR Line:99 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,524 ERROR Line:102 SEG:5 - Segment LX exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,524 ERROR Line:103 SEG:4 - Loop 2750 exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,525 ERROR Line:106 SEG:5 - Segment LX exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,526 ERROR Line:107 SEG:4 - Loop 2750 exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,527 ERROR Line:110 SEG:5 - Segment LX exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,527 ERROR Line:111 SEG:4 - Loop 2750 exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,528 ERROR Line:115 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,546 ERROR Line:152 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/2310/PER
2018-06-13 14:28:56,547 ERROR Line:154 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,548 ERROR Line:158 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,549 ERROR Line:161 SEG:5 - Segment LX exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,550 ERROR Line:162 SEG:4 - Loop 2750 exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,551 ERROR Line:165 SEG:5 - Segment LX exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,551 ERROR Line:166 SEG:4 - Loop 2750 exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,552 ERROR Line:169 SEG:5 - Segment LX exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,553 ERROR Line:170 SEG:4 - Loop 2750 exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,553 ERROR Line:173 SEG:5 - Segment LX exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,554 ERROR Line:174 SEG:4 - Loop 2750 exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,555 ERROR Line:177 SEG:5 - Segment LX exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,555 ERROR Line:178 SEG:4 - Loop 2750 exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,556 ERROR Line:181 SEG:5 - Segment LX exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,557 ERROR Line:182 SEG:4 - Loop 2750 exceeded max count.  Found 8, should have 1
2018-06-13 14:28:56,558 ERROR Line:186 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,569 ERROR Line:217 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,570 ERROR Line:219 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,571 ERROR Line:223 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,572 ERROR Line:226 SEG:5 - Segment LX exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,573 ERROR Line:227 SEG:4 - Loop 2750 exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,574 ERROR Line:230 SEG:5 - Segment LX exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,574 ERROR Line:231 SEG:4 - Loop 2750 exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,575 ERROR Line:234 SEG:5 - Segment LX exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,576 ERROR Line:235 SEG:4 - Loop 2750 exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,577 ERROR Line:238 SEG:5 - Segment LX exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,577 ERROR Line:239 SEG:4 - Loop 2750 exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,578 ERROR Line:242 SEG:5 - Segment LX exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,579 ERROR Line:243 SEG:4 - Loop 2750 exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,580 ERROR Line:246 SEG:5 - Segment LX exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,580 ERROR Line:247 SEG:4 - Loop 2750 exceeded max count.  Found 8, should have 1
2018-06-13 14:28:56,581 ERROR Line:250 SEG:5 - Segment LX exceeded max count.  Found 8, should have 1
2018-06-13 14:28:56,581 ERROR Line:251 SEG:4 - Loop 2750 exceeded max count.  Found 9, should have 1
2018-06-13 14:28:56,583 ERROR Line:255 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,596 ERROR Line:288 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,597 ERROR Line:290 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,598 ERROR Line:294 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,599 ERROR Line:297 SEG:5 - Segment LX exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,600 ERROR Line:298 SEG:4 - Loop 2750 exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,601 ERROR Line:301 SEG:5 - Segment LX exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,601 ERROR Line:302 SEG:4 - Loop 2750 exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,602 ERROR Line:305 SEG:5 - Segment LX exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,603 ERROR Line:306 SEG:4 - Loop 2750 exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,604 ERROR Line:309 SEG:5 - Segment LX exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,604 ERROR Line:310 SEG:4 - Loop 2750 exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,605 ERROR Line:313 SEG:5 - Segment LX exceeded max count.  Found 6, should have 1
2018-06-13 14:28:56,605 ERROR Line:314 SEG:4 - Loop 2750 exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,606 ERROR Line:317 SEG:5 - Segment LX exceeded max count.  Found 7, should have 1
2018-06-13 14:28:56,607 ERROR Line:318 SEG:4 - Loop 2750 exceeded max count.  Found 8, should have 1
2018-06-13 14:28:56,608 ERROR Line:321 SEG:5 - Segment LX exceeded max count.  Found 8, should have 1
2018-06-13 14:28:56,608 ERROR Line:322 SEG:4 - Loop 2750 exceeded max count.  Found 9, should have 1
2018-06-13 14:28:56,610 ERROR Line:326 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,617 ERROR Line:346 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,618 ERROR Line:348 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,619 ERROR Line:352 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,620 ERROR Line:355 SEG:5 - Segment LX exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,621 ERROR Line:356 SEG:4 - Loop 2750 exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,622 ERROR Line:359 SEG:5 - Segment LX exceeded max count.  Found 3, should have 1
2018-06-13 14:28:56,622 ERROR Line:360 SEG:4 - Loop 2750 exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,623 ERROR Line:363 SEG:5 - Segment LX exceeded max count.  Found 4, should have 1
2018-06-13 14:28:56,624 ERROR Line:364 SEG:4 - Loop 2750 exceeded max count.  Found 5, should have 1
2018-06-13 14:28:56,625 ERROR Line:368 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,635 ERROR Line:395 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,636 ERROR Line:397 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,637 ERROR Line:401 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,639 ERROR Line:405 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,645 ERROR Line:423 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,645 ERROR Line:425 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,647 ERROR Line:429 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,648 ERROR Line:433 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,654 ERROR Line:451 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,655 ERROR Line:453 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,656 ERROR Line:457 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,658 ERROR Line:461 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
2018-06-13 14:28:56,664 ERROR Line:479 SEG:1 - Segment LS*2700 not found.  Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL/2000/2300/REF[17]
2018-06-13 14:28:56,665 ERROR Line:481 SEG:3 - Mandatory segment "Provider Name" (NM1) missing
2018-06-13 14:28:56,666 ERROR Line:485 SEG:4 - Loop 2750 exceeded max count.  Found 2, should have 1
2018-06-13 14:28:56,667 ERROR Line:489 SEG:3 - Mandatory segment "Additional Reporting Categories" (LS) missing
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/x12html", line 11, in <module>
    load_entry_point('pyx12==2.3.3', 'console_scripts', 'x12html')()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyx12-2.3.3-py2.7.egg/pyx12/scripts/x12html.py", line 121, in main
    fd_997=None, fd_html=fd_html, fd_xmldoc=None, map_path=args.map_path)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyx12-2.3.3-py2.7.egg/pyx12/x12n_document.py", line 194, in x12n_document
    valid &= node.is_valid(seg, errh)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyx12-2.3.3-py2.7.egg/pyx12/map_if.py", line 992, in is_valid
    (subele_node.name, subele_node.refdes)
AttributeError: 'NoneType' object has no attribute 'name'

It looks like it is looking for the LS*2700 segment to be in the 2300 loop and since its not there, throws an error, but I am not entirely sure. Been trying to debug this for some time now, any help would be greatly appreciated.

@azoner
Copy link
Owner

azoner commented Jun 13, 2018

The test file provided by ddw360 recreates this error. I will work on a solution.

@johncade
Copy link

@azoner thank you for the heads up, happy to help if needed.

@johncade
Copy link

@azoner does this have anything to do with #44? What do you think needs addressing? Im going to start working on a fix.

@azoner
Copy link
Owner

azoner commented Jun 17, 2018 via email

@johncade
Copy link

@azoner ahh so you just believe its an issue with the grammar. Ill take a look, to see if I can find any inconsistencies. I tried with the suggested change by @ddw360 to no avail.

@johncade
Copy link

@azoner appears that composite segments fail as well.

@ddw360
Copy link
Author

ddw360 commented Jun 28, 2018

@azoner @johncade
Sorry for weighing in on this much later but was busy with other tasks at hand!
Don't know if this helps -- but the changes are specific to version 005010X220A1 of the 834 5010 standard implementation in regards to LX/LE envelope segments.

Summation of Errata (version 5, revision 1 aka 005010X220A1)

  • Loop 2100A, 2100D-2100H, Segment N4 is now situational vs required
  • Loop 2710 is deprecated and replaced with Loop 2700 (LX/LE) is within Loop 2000 and can repeat (i.e. >1)
  • Loop 2750 can only have one dataset within LX/LE (Loop 2700) and REF segment can only exist once (in prior spec version it was repeatable up to 16)

Hope that helps.

@ddw360
Copy link
Author

ddw360 commented Jun 28, 2018

@azoner @johncade

https://screenpresso.com/=YcPDg
So basically this should be valid and parsable:

assume inside of loop 2000, typically after Loop 2300

LS*2700~
LX*1~
N1*75*CLIENT CATEGORY A~
REF*17*CATVALUE01~
DTP*007*D8*20081010~
LX*2~
N1*75*CLIENT CATEGORY A~
REF*17*CATVALUE02~
DTP*007*D8*20101112~
LX*3~
N1*75*DOGSORCATS~
REF*ZZ*ABYSINNIAN~
LX*4~
N1*75*DOGSORCATS~
REF*ZZ*YORKIE~
LX*5~
N1*75*DOGSORCATS~
REF*ZZ*DOBERMAN~
LE*2700~
SE*<numofsegs>*<tsctrl#>~

@johncade
Copy link

@ddw360 awesome, thanks, makes sense. There also appears to be an issue with repeated data elements. #44 looks to fix a lot of it, @azoner what do you need to be done on that PR in order for it to be merged?

@azoner azoner closed this as completed in 4dca35b Jul 5, 2018
@azoner
Copy link
Owner

azoner commented Jul 11, 2018

The update fixes the issue with 2700. The test file posted by @ddw360 now passes.

@ddw360
Copy link
Author

ddw360 commented Jan 10, 2019

@azoner Hi John - it has been a while - but I am encountering an issue with a new submitter that technically falls into "standards" (834 005010X220A1). I wonder if this Issue should be re-opened or we need to file a new issue. It is definitely related however to Loop 2700 logic.

It seems there is an issue where if LX01 values outside of a LS2700/LE2700 (Loop 2700 wrapper) are the same as LX01 values inside the LS2700/LE2700 (Loop 2700 wrapper) - that we get an issue:
"Segment LS*2700 not found. Started at /ISA_LOOP/GS_LOOP/ST_LOOP/DETAIL///<Loop != 2700>"

See pastebin link for an example file that should be considered valid for 834 005010X220A1 processing.

What should happen is the LX segments where the LX01 value matches an LX01 value in the LS/LE Loop 2700 envelope - should not be colliding. It looks like they are in somehow.

Another possibility - if collision of LX01 values is not the issue - is that the LX01 values are being expected to be 100% sequential and contiguous within the LS/LE Loop 2700, but all that is required is that they be unique and sequential - but not necessarily contiguous.

So basically:

  1. Allow collisions of LX01 values between a unique LX segment outside of Loop 2700 and a unique LX segment inside Loop 2700.
  2. Within Loop 2700 - enforce unique and in sequence but can skip (i.e. 1,2,26,30) - but do not enforce a need for contiguous (i.e. 1,2,3,4.. etc).

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

No branches or pull requests

4 participants