EDI DOM C# Attributes

Our EDI DOM defines a standard way for accessing and manipulating EDI documents. It allows all EDI building blocks to be represented with .NET C# attributes and thereby to turn any OOP class hierarchy, POCOs or domain model into EDI DOM.

EDI Transactions

[Message("X12", "002040", "810")]
public class TS810 : EdiMessage

Transaction set classes are annotated with MessageAttribute and inherit from EdiMessage. The first parameter is the EDI standard (X12 or EDIFACT). The second parameter is the EDI version (edition + release). The last parameter is the EDI transaction set identifier.

EdiFabric uses internally these attribute values to locate and load the correct transaction set class from an assembly. It will extract the information from all inbound EDI documents and will search for a match by all three values - EDI standard, EDI version and EDI transaction set. Classes with the same values for all three attributes are not allowed in the same assembly and are regarded as duplicates.

Position

[Pos(1)]
public ST ST { get; set; }
[Pos(2)]
public BIG BIG { get; set; }
[Pos(3)]
public List<NTE> NTE { get; set; }

EDI items are positional and the order in which they can appear is driven by the specification. Classes can contain only ordered public properties in the exact sequence as prescribed by the guidelines for every EDI transaction. To order EDI items annotate them with PosAttribute.

Repetitions

public List<NTE> NTE { get; set; }

EDI segment, EDI loop, EDI composite data element or EDI simple data element repetitions are represented as generic C# List<>. Whenever the parser encounters a property that is defined as a List<> it will automatically treat it as a repeating EDI item.

EDI Segments

[Segment("BHT", typeof(X12_ID_1005), typeof(X12_ID_353))]
public class BHT

EDI segments are annotated with SegmentAttribute. The first parameter is the EDI identifier of the segment. The second parameter is a reference to the class defining the EDI code set for the first data element in the segment. If the first data element is not a code set then this is null. The last parameter is a reference to the class defining the EDI code set for the second data element in the segment. If the second data element is not a code set then this is null.

NOTE: For X12 HL segments the last parameter is a reference to the class defining the EDI code set for the third data element in the segment.

The code sets are used by the EDI parser when searching for matching segments from the inbound EDI document to the EDI class.

EDI Loops

[Group(typeof(N1))]
public class TS810_N1Loop1

EDI loops (or EDI groups) are annotated with GroupAttribute. The only parameter is the type of the first (trigger) segment in the group. Every group must contain at least a mandatory non-repeating segment in the first position.

EDI no-order logical groups

[All()]
public class All_NM1

HIPAA specific non-sequence groupings are annotated with AllAttribute. These loops are logical containers for segments or loops regardless of their position. There is no trigger segment and All loops can't repeat.

EDI Composite Data Elements

[Composite("C108")]
public class C108

EDI composite data elements are annotated with CompositeAttribute. The first parameter is the EDI identifier of the composite element.

EDI Data Elements

public string TransactionTypeCode_07 { get; set; }

EDI simple data elements and EDI component data elements are represented as C# strings. Data elements can repeat in segments and in composite data elements.

EDI Code Sets

[EdiCodes(",00,18,")]
public class X12_ID_353

EDI code sets are represented as classes annotated with EdiCodesAttribute. The only parameter is a string containing all of the allowed EDI codes, delimited with a comma.