Data Transformation - Outbound X12 EDI file - SE segment count

Hello,

When creating an outbound X12 file (834, 835, 837, etc), what's the easiest way to keep a segment count to use in the SE01 element?  Other mapping tools I've used either detect it's an X12 file and do this automatically, or there's an option to keep a count after each outputted segment.  The Data Transformation tool within Health Connect doesn't seem to have similar functionality, but I could just be missing something.  Any help would be greatly appreciated!

Thanks,

Jason

  • 0
  • 0
  • 151
  • 2
  • 1

Respuestas

Hi Jason,

You can make use of the EnsLib.EDI.X12.Document property SegCount, which keeps count of the number of segments in the document.  In the Data Transformation, you can add an assign action after all of the segments have been added in order to set the value of the SE01 element.  To do this, you should set the 'Property' of the assign action to target.{SE:NumberofIncludedSegments} and set the 'Value' of the assign action to target.SegCount.

Hope to help!

-Kimberly 

Thank so much, Kimberly!  Looks like that is one (very important) piece of the puzzle.  I have the ST/SE's outputting every 10 records but it looks like the SegCount only counts one record at a time.  For instance, there are  156 segments, including the ST & SE, and the SE count was 13.  I'm going to have to dig into those EnsLib.EDI.X12.Document  properties and see if anything there can help me.  Really appreciate the nudge in the right direction!

Thanks,

Jason

I figured it out.  I set up a memory variable that I would just accumulate all the SegCount amounts until the SE was ready to get outputted.  When it was time to output the SE, I'd take the memory variable + 1 and it would get the correct segment count, then I'd clear the variable.

Thanks again for your help, Kimberly!