This project has moved and is read-only. For the latest updates, please go here.

Acknowledgement Service Unexpected IK5 for 834

Jan 22, 2015 at 10:17 PM
I'm experimenting with the Acknowledgement Service to create the 999 functional acknowledgements.

The file I'm trying to process is an 834 file whose contents are as follows... just one subscriber (INS) with one plan (HD):
ISA*00*          *00*          *ZZ*100697         *ZZ*XYZCO          *150114*1728*^*00501*000012345*1*P*:~
GS*BE*100697*XYZCO*20150114*1728*1*X*005010X220A1~
ST*834*0001*005010X220A1~
BGN*00*1*20150114*1728*PT***2~
N1*P5*ABC Company*ZZ*100523~
N1*IN*XYZ Company*ZZ*XYZCO~
INS*Y*18*021**A~
REF*0F*666224444~
DTP*336*D8*20141001~
NM1*IL*1*Smith*John*A***34*666224444~
PER*IP**HP*6503426882*CP*4158231776*EM*jsmith@gmail.com~
N3*100 Main Street #3~
N4*San Francisco*CA*941071023~
DMG*D8*19590916*M*M~
HD*021****EMP~
DTP*348*D8*20150201~
REF*1L*000121~
LX*1~
NM1*SV*1******SV*12345~
SE*18*0001~
GE*1*1~
IEA*1*000012345~
The 999 that gets generated is this:
ISA*00*          *00*          *ZZ*COPOWER        *ZZ*100697         *150122*1400*U*00501*000000999*1*P*:~
  GS*FA*COPOWER**20150122*1400*99*X*005010X231A1~
    ST*999*0001*005010X231A1~
      AK1*BE*1*005010X220A1~
      AK2*834*0001*005010X220A1~
        IK3*REF*1**3~
        IK3*DTP*1**3~
        IK3*QTY*1**3~
        IK3*N1*2**I7~
        IK3*NM1*7*2000*I7~
        IK3*NM1*7*2000*I7~
        IK3*NM1*7*2000*I7~
        IK3*NM1*7*2000*I7~
        IK3*NM1*7*2000*I7~
        IK3*NM1*7*2000*I7~
        IK3*NM1*7*2000*I7~
        IK3*DSB*7*2000*I7~
        IK3*LC*7*2000*I7~
        IK3*FSA*7*2000*I7~
        IK3*RP*7*2000*I7~
        IK3*LS*7*2000*I7~
        IK3*EC*8*2100A*3~
        IK3*ICM*8*2100A*3~
        IK3*AMT*8*2100A*3~
        IK3*HLH*8*2100A*3~
        IK3*LUI*8*2100A*3~
        IK3*AMT*13*2300*3~
        IK3*IDC*13*2300*3~
        IK3*COB*15*2300*I7~
        IK3*N3*16*2310*3~
        IK3*N4*16*2310*3~
        IK3*PER*16*2310*3~
        IK3*PLA*16*2310*3~
        IK5*E*2*5~
      AK9*A*1*1*1~
    SE*34*0001~
  GE*1*99~
IEA*1*000000999~
Two questions...

I'm getting an IK5*E*2*5, which indicates that I'm missing a Transaction Set Trailer. But the SE is right there in my original file. I'm wondering if it's getting confused by the Loops within Loops (Loop 2300 (HD) contains Loop 2310 (LX and NM1) and Loop 2320 (COB), which contains Loop 2330 (NM1)).

Also, I'm surprised at all the IK3 error segments. The first IK3's are saying that the REF and DTP and QTY segments are required segments, but in reality, they are not.... they are optional segments according to the 005010 specs for the 834. Same with the I7 errors about the loops saying they occur under the minimum times... these are optional loops, not mandatory loops.

Has anyone else successfully created 999's for an 834?

Thanks...

--Brad
Jan 22, 2015 at 10:51 PM
I managed to get rid of all the IK3 error segments by changing the Ansi-834-5010Specifications.xml so that the various optional loops and segments were marked as Usage="Situational".

But I still can't get rid of the IK5*E*2 ... It's not "seeing" the SE Transaction Set Trailer in my file. I'll try stepping through the code and see why.
Jan 22, 2015 at 11:13 PM
Well, that was easy.

Apparently there's a bug in X12StreamReader.ReadNextTransaction().

In its loop, it's gathering all the segments of the transaction. But it neglects to include the SE Trailer in the transaction string.

I amended the code like so:
            do
            {
                switch (segmentId)
                {
                    case "ISA":
                        _isaSegment = segmentString + _delimiters.SegmentTerminator;
                        break;
                    case "GS":
                        _gsSegment = segmentString + _delimiters.SegmentTerminator;
                        break;
                    case "IEA":
                    case "GE":
                        break;
                    default:
                        if (segmentId == "ST")
                            _transactionCode = SplitSegment(segmentString)[1];
                        segments.Append(segmentString);
                        segments.Append(_delimiters.SegmentTerminator);
                        break;
                }
                segmentString = ReadNextSegment();
                segmentId = ReadSegmentId(segmentString);
                //Brad-Jan22,2015: Make sure the SE is appended to the list of segments
                if (!string.IsNullOrEmpty(segmentString) && segmentId == "SE")
                {
                    segments.Append(segmentString);
                    segments.Append(_delimiters.SegmentTerminator);
                }
            } while (!string.IsNullOrEmpty(segmentString) && segmentId != "SE"); // transaction trailer segment
Problem solved.