· May 23, 2019

Data Transformation - Outbound X12 EDI file - SE segment count


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!



Discussion (3)0
Log in or sign up to continue

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!


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!