Segment validation with custom values

Post author

We have a partner that sends a 270 data stream.  They have some custom values for X12_ID_1365_3. One of the values is “EA” so we created a code set map

         var codeSetMap = new Dictionary<string, List<string>>();

            codeSetMap.Add("X12_ID_1365_3", new List<string> { "1", "10", "BE", "EA", "5", "23", "PB" });                   ts270.IsValid(out MessageErrorContext messageErrorContext, new ValidationSettings { DataElementCodesMap = codeSetMap });

However if the 270 EQ entry starts with EA or is only EA, we are receiving an error for the following EQ segment.


“Segment EQ*EA^1^10^BE is not allowed in this position. Only the following segments can appear: INS, HI, DTP, EQ, HL, HL, HL, HL, SE”

The following EQ segment will process correctly.



I realize there is a way to create custom templates for partners but was hoping to use this functionality to save time.

We are using 10.2.0 Enterprise library.



  • Comment author

    Hi Jim,

    Because parsing and validation are separate operations, you need to parse the transaction first and then validate it. Codeset maps are only available for validation only, and what you are trying to do would work for all items that are not used for parsing, e.g., codesets in the first position after the segment ID.

    We will be adding codeset maps to ReaderSettings in the next version to counteract the issue you are experiencing with codesets in position 1.

  • Comment author

    BTW, if you are on the Enterprise plan, please raise all your tickets in the dedicated support portal here, because this is the community forum.


Please sign in to leave a comment.