EDI Rules Reader

View All EDI Validation Rules

Main Features

  • Reads any X12 EDI rules file
  • Allow you to dynamically change EDI rules before validation
  • Automatically loads all loops, segments, elements, composite elements, accepted values, etc. into one data structure
  • Contains all validation rules and constraints
  • Creates a tree node object with EDI file structure for graphical view of EDI rules
  • Track loading progress with its progress event
  • Easy to use API


Arguably one of the most important components in RDPCrystal EDI Library, EDIRulesReader creates a validation structure that can be used to validate and load EDI data.  It is used by the EDIValidator component to validate EDI data.

It contains the following meta data for each Implementation Guide

  • Element Definitions – ID, Type, Minimum, Maximum, Description
  • Segment Definitions – Names, Usage
  • Composite Elements Definitions – Names, Usage
  • EDI File Structure – Loop Hierarchy
  • Elements Formats – Regular Expressions used to validate data like dates, times, ids etc.
  • Validation Rules – Required, Optional, Not Used loops, segments and elements
  • Summary Rules
  • Segment Constraints
  • Element Constraints
  • Code List and Accepted Values
  • Plus much more

Customized views of the EDI rules can be created depending on usage


The Code

// Create an instance of the EDI Rules Reader
EDIRulesReader reader = new EDIRulesReader("C:\\EDIRules.Rules");

// Load EDI Rules

// After parsing the following dictionary lists are available for custom programming and application development
// All the elements in the rules file
this.elements = reader.Elements;

// All the segments in the rules file
this.segments = reader.Segments;

// All the composite segments in the rules file
this.compositeSegments = reader.CompositesSegments;

// All the segment schemas in the rules file
this.segmentSchemas = reader.SegmentSchemas;

// All code list in the rules files (internal and external)
this.codeLists = reader.CodeLists;

// All element formats
this.elementFormats = reader.ElementFormats;

// The complete rules of the .Rules format included loops, usages, segments, elements, element values
this.loopSchema = reader.Schema;