Handling large EDI files

Processing large EDI files where all data is batched under a single transaction is possible by splitting it into multiple parts. The parser can be configured to split by a repeating group at the top level just under the transaction root.

Each part retains the message name (transaction id), the control number and all other base properties of the original. All parts but the last contain only 1 instance of the split item and all other segments\groups are null.

The last part contains all other segments\groups from the original document and the last split item.

Transactions can be split by:

  • EDI loops only
  • EDI loop must be repeatable
  • EDI loop must be at the first level

If you want to split the following transaction by the block of segments in the repetitive N1 loop of the first level.

    [Serializable()]
    [Message("X12", "004010", "850")]
    public class TS850 : EdiMessage
    {        
        [Pos(1)]
        public ST ST { get; set; }
        [Required]
        [Pos(2)]
        public BEG BEG { get; set; }
        [Pos(3)]
        public CUR CUR { get; set; }
        [Pos(4)]
        public List<REF> REF { get; set; }

        ...

        [ListCount(200)]
        [Pos(34)]
        public List<TS850_N1Loop1> N1Loop1 { get; set; }

Then simply inherit the loop class from EdiItem.

[Group(typeof(N1))]
public class TS850_N1Loop : EdiItem

This way the following EDI message will be split by the number of occurrences of the N1 loop:

EDI Segment Split

The resulting EDI object will contain 4 separate items - one for each N1 loop:

EDI Segment Split