X12Reader Component

Properties   Methods   Events   Config Settings   Errors  

The X12Reader component efficiently parses complete X12 transmissions, providing a convenient way to extract and explore data from all included transaction sets.

Syntax

nsoftware.EDISDK.X12Reader

Remarks

The component allows you to parse an incoming EDI document. To parse a document, first, use LoadSchema to load a schema file into the component. Next, select the document you want to process by setting InputFile or InputData and calling Parse.

As the component processes the document, its events will fire and the contents of the document will be available in the Interchange, FunctionalGroup, Message, Segment, Element, and Component properties. The corresponding *Index properties can be thought of as a path within the document. For example, setting the MessageIndex property will cause the SegmentCount property to be updated with the number of segments within the selected message, and then the SegmentIndex property can be used to select one of the segments within that message.

To manage the amount of memory used during processing, the BuildDOM property can be used to select how much of the message will be available in the properties at once:

  • bdEntireDocument - The entire document will be available at once.
  • bdInterchange - Only the current interchange and its contents will be available.
  • bdMessage - Only the current message will be available.
  • bdNone - Only the current segment and its elements will be available.

During parsing, the component performs basic validation of the incoming document. If an error is encountered, the ValidateWarning event will fire.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

AckTypeSpecifies the type of ACK that will be generated by GenerateAck .
BuildDOMSpecifies how much of the current document should be held in memory.
ComponentThe current component.
ComponentCountThe number of components in the current Element.
ComponentIndexThe index of the current Component.
DelimitersContains the delimiters for the EDI Document.
ElementThe current element.
ElementCountThe number of elements in the current Segment.
ElementIndexThe index of the current Element.
FunctionalGroupThe current FunctionalGroup
FunctionalGroupCountThe number of FunctionalGroups in the current Interchange.
FunctionalGroupIndexThe index of the current FunctionalGroup.
InputDataThe EDI message, specified as a string.
InputFileThe file containing the EDI message.
InterchangeThe current Interchange.
InterchangeCountThe number of Interchanges in the document.
InterchangeIndexThe index of the current Interchange
LoopSpecifies the loop to load segments from.
SegmentThe current segment.
SegmentCountThe number of segments in the current TransactionSet.
SegmentIndexThis property is used to specify a Segment within the current TransactionSet .
TransactionSetThe current TransactionSet.
TransactionSetCountThe number of TransactionSets in the current FunctionalGroup.
TransactionSetIndexThe current TransactionSet index.
ValidateOnParseWhen true, the component will validate any documents it parses.
ValidationErrorsCollection of validation errors for the current document.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
GenerateAckGenerates an ACK in response to the most recently parsed TransactionSet.
GetElementValueReturns the value of the element or component at the specified path.
LoadSchemaLoads schema information from a file or string data.
ParseParse the EDI document and fire parsing events.
ResetSets the component to its initial state.
SchemaCodeDefines a code value within a list of codes.
SchemaCodeListDefines a list of codes.
SchemaCompositeDefines a composite element.
SchemaElementDefines a simple element.
SchemaElementRefAdds a reference to an element in a segment or composite element.
SchemaEndEnds a schema definition.
SchemaGroupDefines a group of segments.
SchemaMessageDefines a message.
SchemaSegmentDefines a segment.
SchemaSegmentRefAdds a reference to a segment in a message or group.
SchemaStartStarts a schema definition.
SetInputStreamThe stream containing the EDI data.
ValidateValidate the EDI document and warn about any errors encountered.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

EndFunctionalGroupFires at the end of a functional group while parsing.
EndInterchangeFires at the end of a interchange while parsing.
EndLoopFires at the end of a loop while parsing.
EndTransactionSetFires at the end of a transaction set while parsing.
ErrorFires when a parsing error occurs.
ResolveSchemaFires to request schema information for a specific transaction set.
SegmentFires at the end of a Segment while parsing.
StartFunctionalGroupFires at the beginning of a functional group while parsing.
StartInterchangeFires at the beginning of an interchange while parsing.
StartLoopFires at the beginning of a loop while parsing a transaction set.
StartTransactionSetFires at the beginning of a transaction set while parsing.
ValidateWarningFires to warn about validation errors.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

InputFormatThe format of the input document.
MaxValidationErrorsThe maximum number of validation errors to return.

AckType Property (X12Reader Component)

Specifies the type of ACK that will be generated by GenerateAck .

Syntax

public X12ReaderAckTypes AckType { get; set; }

enum X12ReaderAckTypes { at997, at999, atTA1 }
Public Property AckType As X12readerAckTypes

Enum X12ReaderAckTypes at997 at999 atTA1 End Enum

Default Value

0

Remarks

This setting specifies the type of ACK that will be generated when GenerateAck is called. Options include:

997 Functional Acknowledgement (at997 - 0)A 997 functional acknowledgement. If any syntax errors are encountered when parsing the data, the response will indicate the details of the issue.
999 Implementation Acknowledgement (at999 - 0)A 999 implementation acknowledgement. This ACK replaces a 997 ACK when in a healthcare setting, and can also report issues with standards such as HIPAA compliance.
TA1 Interchange Acknowledgement (atTA1 - 0)A TA1 technical acknowledgement, which confirms the ISA header and IEA footer are valid but does not report on the processing of the contents.

This property is not available at design time.

BuildDOM Property (X12Reader Component)

Specifies how much of the current document should be held in memory.

Syntax

public X12ReaderBuildDOMs BuildDOM { get; set; }

enum X12ReaderBuildDOMs { bdEntireDocument, bdInterchange, bdTranSet, bdNone }
Public Property BuildDOM As X12readerBuildDOMs

Enum X12ReaderBuildDOMs bdEntireDocument bdInterchange bdTranSet bdNone End Enum

Default Value

0

Remarks

Set BuildDOM to bdEntireDocument (0) when you need to browse the current document.

Use bdInterchange (1) when parsing large documents to tell the component to only hold an internal object model of the current Interchange being parsed. When this value is used, and a new Interchange is encountered during parsing, the old interchange is cleared from memory. If the input contains a single Interchange, this is equivalent to using bdEntireDocument.

Use bdTranSet (2) when parsing large documents to tell the component to only hold an internal object model of the current transaction being parsed. When this value is used, and a new transaction is encountered during parsing, the old transaction is cleared from memory.

A value of bdNone (3) will tell the component to not save any internal state of the document being parsed, and thus browsing will be unavailable.

This property is not available at design time.

Component Property (X12Reader Component)

The current component.

Syntax

public EDIElement Component { get; }
Public ReadOnly Property Component As EDIElement

Remarks

When the current Element is a composite element, this property contains the component specified by ComponentIndex.

This property is read-only.

Please refer to the EDIElement type for a complete list of fields.

ComponentCount Property (X12Reader Component)

The number of components in the current Element.

Syntax

public int ComponentCount { get; }
Public ReadOnly Property ComponentCount As Integer

Default Value

0

Remarks

If the current Element is composite, this property contains the number of components within the element.

This property is read-only.

ComponentIndex Property (X12Reader Component)

The index of the current Component.

Syntax

public int ComponentIndex { get; set; }
Public Property ComponentIndex As Integer

Default Value

1

Remarks

If the current Element is composite, this property is used to specify a Component within the element.

Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, MessageIndex, SegmentIndex, ElementIndex and ComponentIndex to navigate to a specific Component within the parsed document.

This property is not available at design time.

Delimiters Property (X12Reader Component)

Contains the delimiters for the EDI Document.

Syntax

public X12Delimiters Delimiters { get; }
Public ReadOnly Property Delimiters As X12Delimiters

Remarks

This property contains the delimiters that will be used when parsing the X12 document. If the document uses delimiters other than the default, change the properties of this object to parse the document correctly.

This property is read-only and not available at design time.

Please refer to the X12Delimiters type for a complete list of fields.

Element Property (X12Reader Component)

The current element.

Syntax

public EDIElement Element { get; }
Public ReadOnly Property Element As EDIElement

Remarks

This property contains the element within the current Segment specified by ElementIndex.

This property is read-only.

Please refer to the EDIElement type for a complete list of fields.

ElementCount Property (X12Reader Component)

The number of elements in the current Segment.

Syntax

public int ElementCount { get; }
Public ReadOnly Property ElementCount As Integer

Default Value

0

Remarks

This property contains the total number of elements in the current Segment.

This property is read-only.

ElementIndex Property (X12Reader Component)

The index of the current Element.

Syntax

public int ElementIndex { get; set; }
Public Property ElementIndex As Integer

Default Value

1

Remarks

This property is used to specify an Element within the current Segment.

Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, MessageIndex, SegmentIndex and ElementIndex to navigate to specific Element within the parsed document.

This property is not available at design time.

FunctionalGroup Property (X12Reader Component)

The current FunctionalGroup

Syntax

public X12FunctionalGroup FunctionalGroup { get; }
Public ReadOnly Property FunctionalGroup As X12FunctionalGroup

Remarks

This property contains the current FunctionalGroup within the Interchange

This property is read-only and not available at design time.

Please refer to the FunctionalGroup type for a complete list of fields.

This property is read-only.

Please refer to the X12FunctionalGroup type for a complete list of fields.

FunctionalGroupCount Property (X12Reader Component)

The number of FunctionalGroups in the current Interchange.

Syntax

public int FunctionalGroupCount { get; }
Public ReadOnly Property FunctionalGroupCount As Integer

Default Value

0

Remarks

This property contains the number of FunctionalGroups in the current Interchange.

This property is read-only.

FunctionalGroupIndex Property (X12Reader Component)

The index of the current FunctionalGroup.

Syntax

public int FunctionalGroupIndex { get; set; }
Public Property FunctionalGroupIndex As Integer

Default Value

1

Remarks

This property is used to specify a FunctionalGroup within the current Interchange.

Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory, including all interchanges, and functional groups. You can then use InterchangeIndex and FunctionalGroupIndex to navigate to a specific FunctionalGroup within the parsed document.

This property is not available at design time.

InputData Property (X12Reader Component)

The EDI message, specified as a string.

Syntax

public string InputData { get; set; }
Public Property InputData As String

Default Value

""

Remarks

Set this property to specify the input EDI message as a string. The message can then be parsed with Parse.

This property is not available at design time.

InputFile Property (X12Reader Component)

The file containing the EDI message.

Syntax

public string InputFile { get; set; }
Public Property InputFile As String

Default Value

""

Remarks

Set this property to specify the input EDI message as a file. The message can then be parsed with Parse.

If the file is not found or cannot be opened, an error will be returned.

Note: If both InputFile and InputData are set, InputData takes precedence.

This property is not available at design time.

Interchange Property (X12Reader Component)

The current Interchange.

Syntax

public X12Interchange Interchange { get; }
Public ReadOnly Property Interchange As X12Interchange

Remarks

This property contains the current Interchange within the document specified by InterchangeIndex.

This property is read-only.

Please refer to the X12Interchange type for a complete list of fields.

InterchangeCount Property (X12Reader Component)

The number of Interchanges in the document.

Syntax

public int InterchangeCount { get; }
Public ReadOnly Property InterchangeCount As Integer

Default Value

0

Remarks

This property contains the number of Interchanges in the current document.

This property is read-only.

InterchangeIndex Property (X12Reader Component)

The index of the current Interchange

Syntax

public int InterchangeIndex { get; set; }
Public Property InterchangeIndex As Integer

Default Value

1

Remarks

This property is used to specify an Interchange within the document.

Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory, including all interchanges. You can then use InterchangeIndex to navigate to specific Interchange within the parsed document.

This property is not available at design time.

Loop Property (X12Reader Component)

Specifies the loop to load segments from.

Syntax

public string Loop { get; set; }
Public Property Loop As String

Default Value

""

Remarks

When this property is set, only segments from the specified loop and iteration will be available through the Segment properties.

A path for a loop consists of the name of the loop followed by an index indicating the iteration, like this:

reader.Loop = "N1Loop[2]";

If the loop is nested inside of another loop, the parent and child are connected by a ".":

reader.Loop = ""AK2Loop[2].AK3Loop[1]"; That can be repeated if a loop is nested more than one level deep.

This property is not available at design time.

Segment Property (X12Reader Component)

The current segment.

Syntax

public EDISegment Segment { get; }
Public ReadOnly Property Segment As EDISegment

Remarks

This property contains the segment within the current Message specified by SegmentIndex.

This property is read-only.

Please refer to the EDISegment type for a complete list of fields.

SegmentCount Property (X12Reader Component)

The number of segments in the current TransactionSet.

Syntax

public int SegmentCount { get; }
Public ReadOnly Property SegmentCount As Integer

Default Value

0

Remarks

This property contains the number of elements in the current TransactionSet.

This property is read-only.

SegmentIndex Property (X12Reader Component)

This property is used to specify a Segment within the current TransactionSet .

Syntax

public int SegmentIndex { get; set; }
Public Property SegmentIndex As Integer

Default Value

1

Remarks

Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, TransactionSetIndex and SegmentIndex to navigate to specific Segment within the parsed document.

This property is not available at design time.

TransactionSet Property (X12Reader Component)

The current TransactionSet.

Syntax

public X12TransactionSet TransactionSet { get; }
Public ReadOnly Property TransactionSet As X12TransactionSet

Remarks

This property contains the TransactionSet within the current Interchange or FunctionalGroup specified by TransactionSetIndex.

This property is read-only.

Please refer to the X12TransactionSet type for a complete list of fields.

TransactionSetCount Property (X12Reader Component)

The number of TransactionSets in the current FunctionalGroup.

Syntax

public int TransactionSetCount { get; }
Public ReadOnly Property TransactionSetCount As Integer

Default Value

0

Remarks

This property contains the count of TransactionSets in the current FunctionalGroup.

This property is read-only.

TransactionSetIndex Property (X12Reader Component)

The current TransactionSet index.

Syntax

public int TransactionSetIndex { get; set; }
Public Property TransactionSetIndex As Integer

Default Value

1

Remarks

This property contains the index of the current TransactionSet within the current FunctionalGroup.

This property is not available at design time.

ValidateOnParse Property (X12Reader Component)

When true, the component will validate any documents it parses.

Syntax

public bool ValidateOnParse { get; set; }
Public Property ValidateOnParse As Boolean

Default Value

False

Remarks

When this property is set to True, the component will perform validation on the document when Parse is called. The ValidateWarning event will fire for each error it encounters.

This property is not available at design time.

ValidationErrors Property (X12Reader Component)

Collection of validation errors for the current document.

Syntax

public X12ValidationErrorDetailList ValidationErrors { get; }
Public ReadOnly Property ValidationErrors As X12ValidationErrorDetailList

Remarks

After calling Validate this property contains details of any validation errors. Validation errors are also accessible through the ValidateWarning event as the document is validated.

This property is read-only and not available at design time.

Please refer to the X12ValidationErrorDetail type for a complete list of fields.

Config Method (X12Reader Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);

Async Version
public async Task<string> Config(string configurationString);
public async Task<string> Config(string configurationString, CancellationToken cancellationToken);
Public Function Config(ByVal ConfigurationString As String) As String

Async Version
Public Function Config(ByVal ConfigurationString As String) As Task(Of String)
Public Function Config(ByVal ConfigurationString As String, cancellationToken As CancellationToken) As Task(Of String)

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

GenerateAck Method (X12Reader Component)

Generates an ACK in response to the most recently parsed TransactionSet.

Syntax

public string GenerateAck();

Async Version
public async Task<string> GenerateAck();
public async Task<string> GenerateAck(CancellationToken cancellationToken);
Public Function GenerateAck() As String

Async Version
Public Function GenerateAck() As Task(Of String)
Public Function GenerateAck(cancellationToken As CancellationToken) As Task(Of String)

Remarks

After parsing a TransactionSet, call this method to generate an ACK that you can send back in response. The type of ACK generated can be controlled by setting the AckType property.

GetElementValue Method (X12Reader Component)

Returns the value of the element or component at the specified path.

Syntax

public string GetElementValue(string path);

Async Version
public async Task<string> GetElementValue(string path);
public async Task<string> GetElementValue(string path, CancellationToken cancellationToken);
Public Function GetElementValue(ByVal Path As String) As String

Async Version
Public Function GetElementValue(ByVal Path As String) As Task(Of String)
Public Function GetElementValue(ByVal Path As String, cancellationToken As CancellationToken) As Task(Of String)

Remarks

This method returns the value of the element at the specified path. The path starts at the current Message and consists of loops (with indexes to indicate the iteration), a segment tag, and 1-2 indexes to indicate the element or component.

For a simple element the path should include the path to a specific iteration of a loop (as in the Loop property), followed by a segment tag and an index for the element position within the segment, each separated by a ".":

reader.GetElementValue("N1Loop[2].N4.4");

When selecting a component of a composite element, the component index should be added after the element index:

reader.GetElementValue("AK2Loop[2].AK3Loop[1].AK4.1.1");

LoadSchema Method (X12Reader Component)

Loads schema information from a file or string data.

Syntax

public void LoadSchema(string fileOrData, string messagename);

Async Version
public async Task LoadSchema(string fileOrData, string messagename);
public async Task LoadSchema(string fileOrData, string messagename, CancellationToken cancellationToken);
Public Sub LoadSchema(ByVal fileOrData As String, ByVal messagename As String)

Async Version
Public Sub LoadSchema(ByVal fileOrData As String, ByVal messagename As String) As Task
Public Sub LoadSchema(ByVal fileOrData As String, ByVal messagename As String, cancellationToken As CancellationToken) As Task

Remarks

This method loads schema information for use when parsing, validating, and translating messages.

The FileOrData parameter can be set to the path of a file containing schema data, or can be set to the contents of a schema file directly.

MessageName can be set to the name of a specific message to load only the specified message's schema information. If left empty or set to "*", the entire schema will be loaded.

Parse Method (X12Reader Component)

Parse the EDI document and fire parsing events.

Syntax

public void Parse();

Async Version
public async Task Parse();
public async Task Parse(CancellationToken cancellationToken);
Public Sub Parse()

Async Version
Public Sub Parse() As Task
Public Sub Parse(cancellationToken As CancellationToken) As Task

Remarks

This method parses the input EDI document, firing the following events as it parses:

When multiple input sources are specified, only the highest-priority input will be used, in the following order:

  1. SetInputStream
  2. InputFile
  3. InputData

Reset Method (X12Reader Component)

Sets the component to its initial state.

Syntax

public void Reset();

Async Version
public async Task Reset();
public async Task Reset(CancellationToken cancellationToken);
Public Sub Reset()

Async Version
Public Sub Reset() As Task
Public Sub Reset(cancellationToken As CancellationToken) As Task

Remarks

When called the component clears all inputs and outputs, and resets all properties to their default values.

SchemaCode Method (X12Reader Component)

Defines a code value within a list of codes.

Syntax

public void SchemaCode(string schemaId, string codeListId, string value, string description);

Async Version
public async Task SchemaCode(string schemaId, string codeListId, string value, string description);
public async Task SchemaCode(string schemaId, string codeListId, string value, string description, CancellationToken cancellationToken);
Public Sub SchemaCode(ByVal SchemaId As String, ByVal CodeListId As String, ByVal Value As String, ByVal Description As String)

Async Version
Public Sub SchemaCode(ByVal SchemaId As String, ByVal CodeListId As String, ByVal Value As String, ByVal Description As String) As Task
Public Sub SchemaCode(ByVal SchemaId As String, ByVal CodeListId As String, ByVal Value As String, ByVal Description As String, cancellationToken As CancellationToken) As Task

Remarks

Creates a schema definition for a code value within a particular list of codes.

This method can be used when defining a schema instead of loading one from a file.

SchemaCodeList Method (X12Reader Component)

Defines a list of codes.

Syntax

public void SchemaCodeList(string schemaId, string codeListId, string description);

Async Version
public async Task SchemaCodeList(string schemaId, string codeListId, string description);
public async Task SchemaCodeList(string schemaId, string codeListId, string description, CancellationToken cancellationToken);
Public Sub SchemaCodeList(ByVal SchemaId As String, ByVal CodeListId As String, ByVal Description As String)

Async Version
Public Sub SchemaCodeList(ByVal SchemaId As String, ByVal CodeListId As String, ByVal Description As String) As Task
Public Sub SchemaCodeList(ByVal SchemaId As String, ByVal CodeListId As String, ByVal Description As String, cancellationToken As CancellationToken) As Task

Remarks

Creates a schema definition for an empty list of codes. SchemaCode can be used to add code values to the list.

This method can be used when defining a schema instead of loading one from a file.

SchemaComposite Method (X12Reader Component)

Defines a composite element.

Syntax

public void SchemaComposite(string schemaId, string compositeId, string description);

Async Version
public async Task SchemaComposite(string schemaId, string compositeId, string description);
public async Task SchemaComposite(string schemaId, string compositeId, string description, CancellationToken cancellationToken);
Public Sub SchemaComposite(ByVal SchemaId As String, ByVal CompositeId As String, ByVal Description As String)

Async Version
Public Sub SchemaComposite(ByVal SchemaId As String, ByVal CompositeId As String, ByVal Description As String) As Task
Public Sub SchemaComposite(ByVal SchemaId As String, ByVal CompositeId As String, ByVal Description As String, cancellationToken As CancellationToken) As Task

Remarks

Creates a schema definition for a composite element. SchemaElementRef can be used to add components to the element.

This method can be used when defining a schema instead of loading one from a file.

SchemaElement Method (X12Reader Component)

Defines a simple element.

Syntax

public void SchemaElement(string schemaId, string elementId, string dataType, int minLength, int maxLength, string codeId, string description);

Async Version
public async Task SchemaElement(string schemaId, string elementId, string dataType, int minLength, int maxLength, string codeId, string description);
public async Task SchemaElement(string schemaId, string elementId, string dataType, int minLength, int maxLength, string codeId, string description, CancellationToken cancellationToken);
Public Sub SchemaElement(ByVal SchemaId As String, ByVal ElementId As String, ByVal DataType As String, ByVal MinLength As Integer, ByVal MaxLength As Integer, ByVal CodeId As String, ByVal Description As String)

Async Version
Public Sub SchemaElement(ByVal SchemaId As String, ByVal ElementId As String, ByVal DataType As String, ByVal MinLength As Integer, ByVal MaxLength As Integer, ByVal CodeId As String, ByVal Description As String) As Task
Public Sub SchemaElement(ByVal SchemaId As String, ByVal ElementId As String, ByVal DataType As String, ByVal MinLength As Integer, ByVal MaxLength As Integer, ByVal CodeId As String, ByVal Description As String, cancellationToken As CancellationToken) As Task

Remarks

Creates a schema definition for a simple element.

This method can be used when defining a schema instead of loading one from a file.

SchemaElementRef Method (X12Reader Component)

Adds a reference to an element in a segment or composite element.

Syntax

public void SchemaElementRef(string schemaId, string parentId, string elementId, string refId, bool required, int maxCount);

Async Version
public async Task SchemaElementRef(string schemaId, string parentId, string elementId, string refId, bool required, int maxCount);
public async Task SchemaElementRef(string schemaId, string parentId, string elementId, string refId, bool required, int maxCount, CancellationToken cancellationToken);
Public Sub SchemaElementRef(ByVal SchemaId As String, ByVal ParentId As String, ByVal ElementId As String, ByVal RefId As String, ByVal Required As Boolean, ByVal MaxCount As Integer)

Async Version
Public Sub SchemaElementRef(ByVal SchemaId As String, ByVal ParentId As String, ByVal ElementId As String, ByVal RefId As String, ByVal Required As Boolean, ByVal MaxCount As Integer) As Task
Public Sub SchemaElementRef(ByVal SchemaId As String, ByVal ParentId As String, ByVal ElementId As String, ByVal RefId As String, ByVal Required As Boolean, ByVal MaxCount As Integer, cancellationToken As CancellationToken) As Task

Remarks

Adds a reference to an element to the specified parent, which can be the most recently defined segment or composite element.

This method can be used when defining a schema instead of loading one from a file.

SchemaEnd Method (X12Reader Component)

Ends a schema definition.

Syntax

public void SchemaEnd();

Async Version
public async Task SchemaEnd();
public async Task SchemaEnd(CancellationToken cancellationToken);
Public Sub SchemaEnd()

Async Version
Public Sub SchemaEnd() As Task
Public Sub SchemaEnd(cancellationToken As CancellationToken) As Task

Remarks

Ends a schema definition when a schema is being defined manually instead of loaded from a file.

SchemaGroup Method (X12Reader Component)

Defines a group of segments.

Syntax

public void SchemaGroup(string schemaId, string groupPath, string groupId, bool required, int maxCount);

Async Version
public async Task SchemaGroup(string schemaId, string groupPath, string groupId, bool required, int maxCount);
public async Task SchemaGroup(string schemaId, string groupPath, string groupId, bool required, int maxCount, CancellationToken cancellationToken);
Public Sub SchemaGroup(ByVal SchemaId As String, ByVal GroupPath As String, ByVal GroupId As String, ByVal Required As Boolean, ByVal MaxCount As Integer)

Async Version
Public Sub SchemaGroup(ByVal SchemaId As String, ByVal GroupPath As String, ByVal GroupId As String, ByVal Required As Boolean, ByVal MaxCount As Integer) As Task
Public Sub SchemaGroup(ByVal SchemaId As String, ByVal GroupPath As String, ByVal GroupId As String, ByVal Required As Boolean, ByVal MaxCount As Integer, cancellationToken As CancellationToken) As Task

Remarks

Creates a schema definition for a group of segments. SchemaSegmentRef can be used to add references to defined segments.

This method can be used when defining a schema instead of loading one from a file.

SchemaMessage Method (X12Reader Component)

Defines a message.

Syntax

public void SchemaMessage(string schemaId, string messageId, string description);

Async Version
public async Task SchemaMessage(string schemaId, string messageId, string description);
public async Task SchemaMessage(string schemaId, string messageId, string description, CancellationToken cancellationToken);
Public Sub SchemaMessage(ByVal SchemaId As String, ByVal MessageId As String, ByVal Description As String)

Async Version
Public Sub SchemaMessage(ByVal SchemaId As String, ByVal MessageId As String, ByVal Description As String) As Task
Public Sub SchemaMessage(ByVal SchemaId As String, ByVal MessageId As String, ByVal Description As String, cancellationToken As CancellationToken) As Task

Remarks

Creates a schema definition for a message. SchemaSegmentRef and SchemaGroup can be used to add segment references and groups to the message.

This method can be used when defining a schema instead of loading one from a file.

SchemaSegment Method (X12Reader Component)

Defines a segment.

Syntax

public void SchemaSegment(string schemaId, string segmentId, string description);

Async Version
public async Task SchemaSegment(string schemaId, string segmentId, string description);
public async Task SchemaSegment(string schemaId, string segmentId, string description, CancellationToken cancellationToken);
Public Sub SchemaSegment(ByVal SchemaId As String, ByVal SegmentId As String, ByVal Description As String)

Async Version
Public Sub SchemaSegment(ByVal SchemaId As String, ByVal SegmentId As String, ByVal Description As String) As Task
Public Sub SchemaSegment(ByVal SchemaId As String, ByVal SegmentId As String, ByVal Description As String, cancellationToken As CancellationToken) As Task

Remarks

Creates a schema definition for a segment. SchemaElementRef can be used to add component references to the segment.

This method can be used when defining a schema instead of loading one from a file.

SchemaSegmentRef Method (X12Reader Component)

Adds a reference to a segment in a message or group.

Syntax

public void SchemaSegmentRef(string schemaId, string segmentPath, string segmentId, bool required, int maxCount);

Async Version
public async Task SchemaSegmentRef(string schemaId, string segmentPath, string segmentId, bool required, int maxCount);
public async Task SchemaSegmentRef(string schemaId, string segmentPath, string segmentId, bool required, int maxCount, CancellationToken cancellationToken);
Public Sub SchemaSegmentRef(ByVal SchemaId As String, ByVal SegmentPath As String, ByVal SegmentId As String, ByVal Required As Boolean, ByVal MaxCount As Integer)

Async Version
Public Sub SchemaSegmentRef(ByVal SchemaId As String, ByVal SegmentPath As String, ByVal SegmentId As String, ByVal Required As Boolean, ByVal MaxCount As Integer) As Task
Public Sub SchemaSegmentRef(ByVal SchemaId As String, ByVal SegmentPath As String, ByVal SegmentId As String, ByVal Required As Boolean, ByVal MaxCount As Integer, cancellationToken As CancellationToken) As Task

Remarks

Adds a reference to a segment to the specified path.

This method can be used when defining a schema instead of loading one from a file.

SchemaStart Method (X12Reader Component)

Starts a schema definition.

Syntax

public void SchemaStart(string schemaId);

Async Version
public async Task SchemaStart(string schemaId);
public async Task SchemaStart(string schemaId, CancellationToken cancellationToken);
Public Sub SchemaStart(ByVal SchemaId As String)

Async Version
Public Sub SchemaStart(ByVal SchemaId As String) As Task
Public Sub SchemaStart(ByVal SchemaId As String, cancellationToken As CancellationToken) As Task

Remarks

Starts manually defining a schema, as an alternative to loading one from a file.

SetInputStream Method (X12Reader Component)

The stream containing the EDI data.

Syntax

public void SetInputStream(System.IO.Stream inputStream);

Async Version
public async Task SetInputStream(System.IO.Stream inputStream);
public async Task SetInputStream(System.IO.Stream inputStream, CancellationToken cancellationToken);
Public Sub SetInputStream(ByVal InputStream As System.IO.Stream)

Async Version
Public Sub SetInputStream(ByVal InputStream As System.IO.Stream) As Task
Public Sub SetInputStream(ByVal InputStream As System.IO.Stream, cancellationToken As CancellationToken) As Task

Remarks

Call this method to specify a stream to read the input EDI data from. The data can then be parsed with Parse.

Validate Method (X12Reader Component)

Validate the EDI document and warn about any errors encountered.

Syntax

public void Validate();

Async Version
public async Task Validate();
public async Task Validate(CancellationToken cancellationToken);
Public Sub Validate()

Async Version
Public Sub Validate() As Task
Public Sub Validate(cancellationToken As CancellationToken) As Task

Remarks

This method parses the input EDI document, firing the ValidateWarning event for any non-blocking errors it encounters.

EndFunctionalGroup Event (X12Reader Component)

Fires at the end of a functional group while parsing.

Syntax

public event OnEndFunctionalGroupHandler OnEndFunctionalGroup;

public delegate void OnEndFunctionalGroupHandler(object sender, X12ReaderEndFunctionalGroupEventArgs e);

public class X12ReaderEndFunctionalGroupEventArgs : EventArgs {
  public string Tag { get; }
  public int TransactionCount { get; }
  public string ControlNumber { get; }
}
Public Event OnEndFunctionalGroup As OnEndFunctionalGroupHandler

Public Delegate Sub OnEndFunctionalGroupHandler(sender As Object, e As X12ReaderEndFunctionalGroupEventArgs)

Public Class X12ReaderEndFunctionalGroupEventArgs Inherits EventArgs
  Public ReadOnly Property Tag As String
  Public ReadOnly Property TransactionCount As Integer
  Public ReadOnly Property ControlNumber As String
End Class

Remarks

This event fires when the component encounters the end of a functional group while parsing a document.

EndInterchange Event (X12Reader Component)

Fires at the end of a interchange while parsing.

Syntax

public event OnEndInterchangeHandler OnEndInterchange;

public delegate void OnEndInterchangeHandler(object sender, X12ReaderEndInterchangeEventArgs e);

public class X12ReaderEndInterchangeEventArgs : EventArgs {
  public string Tag { get; }
  public int GroupCount { get; }
  public string ControlNumber { get; }
}
Public Event OnEndInterchange As OnEndInterchangeHandler

Public Delegate Sub OnEndInterchangeHandler(sender As Object, e As X12ReaderEndInterchangeEventArgs)

Public Class X12ReaderEndInterchangeEventArgs Inherits EventArgs
  Public ReadOnly Property Tag As String
  Public ReadOnly Property GroupCount As Integer
  Public ReadOnly Property ControlNumber As String
End Class

Remarks

This event fires when the component encounters the end of a interchange while parsing a document.

EndLoop Event (X12Reader Component)

Fires at the end of a loop while parsing.

Syntax

public event OnEndLoopHandler OnEndLoop;

public delegate void OnEndLoopHandler(object sender, X12ReaderEndLoopEventArgs e);

public class X12ReaderEndLoopEventArgs : EventArgs {
  public string Name { get; }
  public int Index { get; }
}
Public Event OnEndLoop As OnEndLoopHandler

Public Delegate Sub OnEndLoopHandler(sender As Object, e As X12ReaderEndLoopEventArgs)

Public Class X12ReaderEndLoopEventArgs Inherits EventArgs
  Public ReadOnly Property Name As String
  Public ReadOnly Property Index As Integer
End Class

Remarks

This event fires when the component encounters the end of a loop while parsing a document.

EndTransactionSet Event (X12Reader Component)

Fires at the end of a transaction set while parsing.

Syntax

public event OnEndTransactionSetHandler OnEndTransactionSet;

public delegate void OnEndTransactionSetHandler(object sender, X12ReaderEndTransactionSetEventArgs e);

public class X12ReaderEndTransactionSetEventArgs : EventArgs {
  public string Tag { get; }
  public int SegmentCount { get; }
  public string ControlNumber { get; }
}
Public Event OnEndTransactionSet As OnEndTransactionSetHandler

Public Delegate Sub OnEndTransactionSetHandler(sender As Object, e As X12ReaderEndTransactionSetEventArgs)

Public Class X12ReaderEndTransactionSetEventArgs Inherits EventArgs
  Public ReadOnly Property Tag As String
  Public ReadOnly Property SegmentCount As Integer
  Public ReadOnly Property ControlNumber As String
End Class

Remarks

This event fires when the component encounters the end of a transaction set while parsing a document.

Error Event (X12Reader Component)

Fires when a parsing error occurs.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, X12ReaderErrorEventArgs e);

public class X12ReaderErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As X12ReaderErrorEventArgs)

Public Class X12ReaderErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

This event fires when the component encounters a parsing error while processing a document.

ResolveSchema Event (X12Reader Component)

Fires to request schema information for a specific transaction set.

Syntax

public event OnResolveSchemaHandler OnResolveSchema;

public delegate void OnResolveSchemaHandler(object sender, X12ReaderResolveSchemaEventArgs e);

public class X12ReaderResolveSchemaEventArgs : EventArgs {
  public string VersionNumber { get; }
  public string TransactionSetIDCode { get; }
}
Public Event OnResolveSchema As OnResolveSchemaHandler

Public Delegate Sub OnResolveSchemaHandler(sender As Object, e As X12ReaderResolveSchemaEventArgs)

Public Class X12ReaderResolveSchemaEventArgs Inherits EventArgs
  Public ReadOnly Property VersionNumber As String
  Public ReadOnly Property TransactionSetIDCode As String
End Class

Remarks

LoadSchema can be called from within this event to load the schema information for the specified transaction set.

Segment Event (X12Reader Component)

Fires at the end of a Segment while parsing.

Syntax

public event OnSegmentHandler OnSegment;

public delegate void OnSegmentHandler(object sender, X12ReaderSegmentEventArgs e);

public class X12ReaderSegmentEventArgs : EventArgs {
  public string Tag { get; }
  public string SchemaPath { get; }
  public bool Optional { get; }
  public int ElementCount { get; }
  public int SchemaIndex { get; }
  public int SegmentIndex { get; }
  public int MaxCount { get; }
  public string Path { get; }
}
Public Event OnSegment As OnSegmentHandler

Public Delegate Sub OnSegmentHandler(sender As Object, e As X12ReaderSegmentEventArgs)

Public Class X12ReaderSegmentEventArgs Inherits EventArgs
  Public ReadOnly Property Tag As String
  Public ReadOnly Property SchemaPath As String
  Public ReadOnly Property Optional As Boolean
  Public ReadOnly Property ElementCount As Integer
  Public ReadOnly Property SchemaIndex As Integer
  Public ReadOnly Property SegmentIndex As Integer
  Public ReadOnly Property MaxCount As Integer
  Public ReadOnly Property Path As String
End Class

Remarks

Fires at the end of a Segment while parsing a document with the Parse method. The parameters provide information about the segment that was just parsed: Tag: The segment tag (e.g., "ISA", "GS", "ST", etc.).

SchemaPath: The schema path for the segment, if schema information is available.

Optional: A boolean indicating whether the segment is optional (true) or required (false) according to the schema.

ElementCount: The number of elements in the segment.

SchemaIndex: The index of the segment in the schema, if schema information is available.

SegmentIndex: The index of the segment within the current transaction set.

MaxCount: The maximum number of times this segment can occur in the current context, according to the schema.

Path: The full path to the segment within the message structure.

StartFunctionalGroup Event (X12Reader Component)

Fires at the beginning of a functional group while parsing.

Syntax

public event OnStartFunctionalGroupHandler OnStartFunctionalGroup;

public delegate void OnStartFunctionalGroupHandler(object sender, X12ReaderStartFunctionalGroupEventArgs e);

public class X12ReaderStartFunctionalGroupEventArgs : EventArgs {
  public string Tag { get; }
  public string AppSenderCode { get; }
  public string AppReceiverCode { get; }
  public string DateTime { get; }
  public string ControlNumber { get; }
}
Public Event OnStartFunctionalGroup As OnStartFunctionalGroupHandler

Public Delegate Sub OnStartFunctionalGroupHandler(sender As Object, e As X12ReaderStartFunctionalGroupEventArgs)

Public Class X12ReaderStartFunctionalGroupEventArgs Inherits EventArgs
  Public ReadOnly Property Tag As String
  Public ReadOnly Property AppSenderCode As String
  Public ReadOnly Property AppReceiverCode As String
  Public ReadOnly Property DateTime As String
  Public ReadOnly Property ControlNumber As String
End Class

Remarks

This event fires when the component encounters the start of a functional group while parsing a document.

StartInterchange Event (X12Reader Component)

Fires at the beginning of an interchange while parsing.

Syntax

public event OnStartInterchangeHandler OnStartInterchange;

public delegate void OnStartInterchangeHandler(object sender, X12ReaderStartInterchangeEventArgs e);

public class X12ReaderStartInterchangeEventArgs : EventArgs {
  public string Tag { get; }
  public string SenderID { get; }
  public string ReceiverID { get; }
  public string DateTime { get; }
  public string ControlNumber { get; }
}
Public Event OnStartInterchange As OnStartInterchangeHandler

Public Delegate Sub OnStartInterchangeHandler(sender As Object, e As X12ReaderStartInterchangeEventArgs)

Public Class X12ReaderStartInterchangeEventArgs Inherits EventArgs
  Public ReadOnly Property Tag As String
  Public ReadOnly Property SenderID As String
  Public ReadOnly Property ReceiverID As String
  Public ReadOnly Property DateTime As String
  Public ReadOnly Property ControlNumber As String
End Class

Remarks

This event fires at the beginning of an interchange while parsing a document.

StartLoop Event (X12Reader Component)

Fires at the beginning of a loop while parsing a transaction set.

Syntax

public event OnStartLoopHandler OnStartLoop;

public delegate void OnStartLoopHandler(object sender, X12ReaderStartLoopEventArgs e);

public class X12ReaderStartLoopEventArgs : EventArgs {
  public string Name { get; }
  public int Index { get; }
  public int MaxCount { get; }
  public string Path { get; }
}
Public Event OnStartLoop As OnStartLoopHandler

Public Delegate Sub OnStartLoopHandler(sender As Object, e As X12ReaderStartLoopEventArgs)

Public Class X12ReaderStartLoopEventArgs Inherits EventArgs
  Public ReadOnly Property Name As String
  Public ReadOnly Property Index As Integer
  Public ReadOnly Property MaxCount As Integer
  Public ReadOnly Property Path As String
End Class

Remarks

This event fires when the component encounters the start of a loop while parsing a transaction set.

StartTransactionSet Event (X12Reader Component)

Fires at the beginning of a transaction set while parsing.

Syntax

public event OnStartTransactionSetHandler OnStartTransactionSet;

public delegate void OnStartTransactionSetHandler(object sender, X12ReaderStartTransactionSetEventArgs e);

public class X12ReaderStartTransactionSetEventArgs : EventArgs {
  public string Tag { get; }
  public string VersionNumber { get; }
  public string TransactionSetIDCode { get; }
  public string ControlNumber { get; }
  public bool SchemaLoaded { get; }
}
Public Event OnStartTransactionSet As OnStartTransactionSetHandler

Public Delegate Sub OnStartTransactionSetHandler(sender As Object, e As X12ReaderStartTransactionSetEventArgs)

Public Class X12ReaderStartTransactionSetEventArgs Inherits EventArgs
  Public ReadOnly Property Tag As String
  Public ReadOnly Property VersionNumber As String
  Public ReadOnly Property TransactionSetIDCode As String
  Public ReadOnly Property ControlNumber As String
  Public ReadOnly Property SchemaLoaded As Boolean
End Class

Remarks

This event fires when the component encounters the start of a transaction set while parsing a document.

ValidateWarning Event (X12Reader Component)

Fires to warn about validation errors.

Syntax

public event OnValidateWarningHandler OnValidateWarning;

public delegate void OnValidateWarningHandler(object sender, X12ReaderValidateWarningEventArgs e);

public class X12ReaderValidateWarningEventArgs : EventArgs {
  public long Position { get; }
  public int Line { get; }
  public int Column { get; }
  public string ErrorCode { get; }
  public string ErrorMessage { get; }
  public int ErrorType { get; }
}
Public Event OnValidateWarning As OnValidateWarningHandler

Public Delegate Sub OnValidateWarningHandler(sender As Object, e As X12ReaderValidateWarningEventArgs)

Public Class X12ReaderValidateWarningEventArgs Inherits EventArgs
  Public ReadOnly Property Position As Long
  Public ReadOnly Property Line As Integer
  Public ReadOnly Property Column As Integer
  Public ReadOnly Property ErrorCode As String
  Public ReadOnly Property ErrorMessage As String
  Public ReadOnly Property ErrorType As Integer
End Class

Remarks

When the component encounters a non-blocking error while validating a document, this event fires with information about the error.

EDIElement Type

An element of an EDI document.

Remarks

This represents an element appearing in an EDI document.

The following fields are available:

Fields

DataType
string (read-only)

Default: ""

The type of data contained in the element.

Possible values for EDIFACT include:

A The element can only contain alphabetic characters.
AN The element can contain any alphanumeric characters.
N The element can only contain numeric characters.
composite The element is a composite element containing multiple components.

Possible values for X12 include:

AN The element can contain any alphanumeric characters.
ID The element contains an identifier for a code value.
Nn The element contains a numeric integer value.
R The element contains a number with an optional decimal value.
DT The element contains a string representing a date.
TM The element contains a string representing a time.
B The element contains binary data.
composite The element is a composite element containing multiple components.

IsComposite
bool (read-only)

Default: False

Specifies whether the element is a simple or composite element. If true, the element is a composite element that contains other components.

MaxLen
int (read-only)

Default: 0

For a simple element, this specifies the maximum length of the element according to the schema.

MinLen
int (read-only)

Default: 0

For a simple element, this specifies the minimum length of the element according to the schema.

SchemaDesc
string (read-only)

Default: ""

The description of the element as specified in the schema.

SchemaName
string (read-only)

Default: ""

The name of the element as specified in the schema.

Value
string (read-only)

Default: ""

If the element is a simple element, this field contains its value.

Constructors

public EDIElement();
Public EDIElement()

EDISegment Type

A segment of an EDI document.

Remarks

This represents a segment appearing in an EDI document.

The following fields are available:

Fields

Optional
bool (read-only)

Default: False

Specifies whether the segment is required or optional. If true, the element is optional.

Path
string (read-only)

Default: ""

Contains the path to the segment, including the groups that the segment is contained in.

SchemaPath
string (read-only)

Default: ""

Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \4[3]\5[6]\7[8].

Tag
string (read-only)

Default: ""

The tag of the segment, such as BGM, DTM, FTX, etc.

Constructors

public EDISegment();
Public EDISegment()

X12Delimiters Type

The delimiters used in the X12 document.

Remarks

This type contains fields specifying the various delimiters used within the X12 document.

The following fields are available:

Fields

Component
string

Default: ":"

The delimiter separating components.

In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

Element
string

Default: "*"

The delimiter separating elements.

In X12Reader, this type is used to hold the delimiters found when parsing the element, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

Repetition
string

Default: "^"

The delimiter separating components.

In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

Segment
string

Default: "~"

The delimiter separating segments.

In X12Reader, this type is used to hold the delimiters found when parsing the segment, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

Constructors

public X12Delimiters();
Public X12Delimiters()

X12FunctionalGroup Type

A functional group of messages.

Remarks

This type represents a functional group of messages, with fields describing the values from the GS segment.

The following fields are available:

Fields

AppReceiverCode
string

Default: ""

The name or code of the intended receiver of the transaction set group.

This is an alphanumeric field with a value between 2 and 15 characters.

AppSenderCode
string

Default: ""

Code identifying the sender of FunctionalGroup

This is an alphanumeric field with a value between 2 and 15 characters long.

Date
string

Default: ""

The date that the group of transaction sets was prepared.

This is a numeric field with a value in the format YYMMDD.

FunctionalIdentifierCode
string

Default: ""

A code identifying the type of transaction sets included in the functional group.

This is an alphanumeric field with a code value between of 2 characters.

GroupControlNum
string

Default: ""

An identification number assigned by the sender to uniquely identify the group of transaction sets.

This is a numeric field with a value between 1 and 9 digits.

ResponsibleAgencyCode
string

Default: ""

A code identifying the issuer of the standard that the transaction set conforms to.

This is an alphanumeric field with a code value of 1 to 2 characters.

Time
string

Default: ""

The time that the group of transaction sets was prepared.

This is a numeric field with a value between 4 and 8 digits in the format HHMM, HHMMSS, or HHMMSSDD. Time should be in the 24-hour format.

Version
string

Default: ""

Code indicating the version of the X12 standard used to construct the transaction set.

This is an alphanumeric field with a code value between 1 and 12 characters.

Constructors

X12Interchange Type

An interchange containing functional groups and transaction sets.

Remarks

This type represents an X12 interchange, with fields describing the values from the ISA segment.

The following fields are available:

Fields

AckRequest
string

Default: ""

Code indicating whether an interchange acknowledgment is requested.

This is an alphanumeric field with a code value of 1 character, either "0" (no acknowledgment requested) or "1" (acknowledgment requested).

AuthorizationInfo
string

Default: ""

Information used for additional identification or authorization of the interchange sender or the data in the interchange.

The type of information is set by the AuthorizationInfoQual field.

AuthorizationInfoQualifier
string

Default: ""

A code indicating the type of data supplied in Authorization Information field.

This is an alphanumeric field with a code value of 2 characters.

Date
string

Default: ""

The date that the Interchange was prepared.

This is a numeric field with a value of 6 digits in the format YYMMDD.

InterchangeControlNum
string

Default: ""

A control number assigned by the sender to uniquely identify the interchange.

This is a numeric field with a value of 9 digits.

InterchangeControlVersionNum
string

Default: ""

A code specifying the version of the X12 standard used to construct the Interchange.

This is an alphanumeric field with a code value 5 characters.

ReceiverID
string

Default: ""

The identification code of the receiver of the transaction set.

This is an alphanumeric field with a value of 15 characters.

ReceiverIDQualifier
string

Default: ""

A code that identifies the format of the receiver ID.

This is an alphanumeric field with a code value of 2 characters.

SecurityInfo
string

Default: ""

Coded security information associated with the Interchange.

The type of information is set by the SecurityInfoQualifier.

This is an alphanumeric field with a value between of 10 characters.

SecurityInfoQualifier
string

Default: ""

A code indicating the type of data in the Security Information field.

This is an alphanumeric field with a code value of 2 characters.

SenderID
string

Default: ""

The identification code of the sender of the transaction set.

This is an alphanumeric field with a value of 15 characters.

SenderIDQualifier
string

Default: ""

A code that identifies the format of the sender ID.

This is an alphanumeric field with a code value of 2 characters.

Time
string

Default: ""

The time that the Interchange sets was prepared.

This is a numeric field with a value in the format HHMM.

UsageIndicator
string

Default: ""

Code to indicate whether the interchange is a test or production.

This is an alphanumeric field with a code value of 1 character.

Constructors

public X12Interchange();
Public X12Interchange()

X12TransactionSet Type

An X12 transaction set.

Remarks

This type represents an X12 transaction set, with fields describing the values from the ST segment.

The following fields are available:

Fields

ImpConventionReference
string

Default: ""

Reference used to identify the implementation convention.

This is an alphanumeric field with a value up to 35 characters long.

TransactionSetControlNum
string

Default: ""

The unique transaction set control number assigned for a transaction set.

This is an alphanumeric field with a value between 4 and 9 characters long.

TransactionSetIDCode
string

Default: ""

The identifier code for the transaction set.

This is an alphanumeric field with a code value of 3 characters long.

Constructors

X12ValidationErrorDetail Type

Contains the details of a validation error.

Remarks

This represents an error that was encountered while validating an X12 document. The fields contain a description of the error and where in the document it occurred.

The following fields are available:

Fields

Column
int (read-only)

Default: 0

The column number where the error occurred.

ComponentIndex
int (read-only)

Default: 1

This field holds the position of the component element where the error occurred.

ElementIndex
int (read-only)

Default: 1

This field holds the position of the element where the error occurred.

ErrorCode
string (read-only)

Default: "0"

The ErrorCode field contains the type of error encountered.

ErrorMessage
string (read-only)

Default: ""

ErrorMessage is a textual description of the error.

ErrorType
int (read-only)

Default: 0

Indicates the level of the document where the error was encountered. Possible values include:

1Interchange
2Functional group
3Transaction set
4Segment
5Element

FGroupIndex
int (read-only)

Default: 1

This field holds the position of the functional group where the error occurred.

InterchangeIndex
int (read-only)

Default: 1

This field holds the position of the interchange where the error occurred.

Line
int (read-only)

Default: 0

The line number where the error occurred.

Position
long (read-only)

Default: 0

This field holds the byte position in the EDI stream where the error occurred.

SegmentIndex
int (read-only)

Default: 1

This field is the index of the segment where the error occurred.

SegmentTag
string (read-only)

Default: ""

This field specifies the tag name of the segment where the error occurred.

TransactionSetIndex
int (read-only)

Default: 1

This field holds the position of the message where the error occurred.

Config Settings (X12Reader Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

X12Reader Config Settings

InputFormat:   The format of the input document.

This setting controls the type of input document for parsing. Possible values are:

0 (default)X12
1XML
MaxValidationErrors:   The maximum number of validation errors to return.

This setting controls the maximum number of validation errors that will be returned during the validation process. The default value is 200.

Trappable Errors (X12Reader Component)

X12Reader Errors

202   Invalid argument.
304   Cannot write to file.
1003   Could not find the selected schema in the chosen file.
1099   Encountered an unexpected segment tag.
1100   Attempted to perform an action while the component was busy, or close an incomplete interchange.
1044   Tried to load an invalid schema file.
1201   The index is out of range.
1202   The selected ACK type is invalid.
1204   Encountered an error while validating the ISA segment.