X12Reader Module

Properties   Methods   Events   Config Settings   Errors  

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

Syntax

EDISDK.X12Reader

Remarks

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

As the class 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 class 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 module 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 module.
ComponentCountThe number of modules in the current Element.
ComponentIndexThe index of the current Module.
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 module 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 module 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 module at the specified path.
LoadSchemaLoads schema information from a file or string data.
ParseParse the EDI document and fire parsing events.
ResetSets the module 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.
ValidateValidate the EDI document and warn about any errors encountered.

Event List


The following is the full list of the events fired by the module 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 module 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 Module)

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

Syntax

public var ackType: X12ReaderAckTypes {
  get {...}
  set {...}
}

public enum X12ReaderAckTypes: Int32 { case at997 = 0 case at999 = 1 case atTA1 = 2 }

@property (nonatomic,readwrite,assign,getter=ackType,setter=setAckType:) int ackType;

- (int)ackType;
- (void)setAckType :(int)newAckType;

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.

BuildDOM Property (X12Reader Module)

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

Syntax

public var buildDOM: X12ReaderBuildDOMs {
  get {...}
  set {...}
}

public enum X12ReaderBuildDOMs: Int32 { case bdEntireDocument = 0 case bdInterchange = 1 case bdTranSet = 2 case bdNone = 3 }

@property (nonatomic,readwrite,assign,getter=buildDOM,setter=setBuildDOM:) int buildDOM;

- (int)buildDOM;
- (void)setBuildDOM :(int)newBuildDOM;

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.

Component Property (X12Reader Module)

The current module.

Syntax

public var component: EDIElement {
  get {...}
}

@property (nonatomic,readonly,assign,getter=componentDataType) NSString* componentDataType;

- (NSString*)componentDataType;

@property (nonatomic,readonly,assign,getter=componentIsComposite) BOOL componentIsComposite;

- (BOOL)componentIsComposite;

@property (nonatomic,readonly,assign,getter=componentMaxLen) int componentMaxLen;

- (int)componentMaxLen;

@property (nonatomic,readonly,assign,getter=componentMinLen) int componentMinLen;

- (int)componentMinLen;

@property (nonatomic,readonly,assign,getter=componentSchemaDesc) NSString* componentSchemaDesc;

- (NSString*)componentSchemaDesc;

@property (nonatomic,readonly,assign,getter=componentSchemaName) NSString* componentSchemaName;

- (NSString*)componentSchemaName;

@property (nonatomic,readonly,assign,getter=componentValue) NSString* componentValue;

- (NSString*)componentValue;

 

Default Value

1

Remarks

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

This property is read-only.

ComponentCount Property (X12Reader Module)

The number of modules in the current Element.

Syntax

public var componentCount: Int32 {
  get {...}
}

@property (nonatomic,readonly,assign,getter=componentCount) int componentCount;

- (int)componentCount;

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 Module)

The index of the current Module.

Syntax

public var componentIndex: Int32 {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=componentIndex,setter=setComponentIndex:) int componentIndex;

- (int)componentIndex;
- (void)setComponentIndex :(int)newComponentIndex;

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.

Delimiters Property (X12Reader Module)

Contains the delimiters for the EDI Document.

Syntax

public var delimiters: X12Delimiters {
  get {...}
}

@property (nonatomic,readwrite,assign,getter=delimiterComponent,setter=setDelimiterComponent:) NSString* delimiterComponent;

- (NSString*)delimiterComponent;
- (void)setDelimiterComponent :(NSString*)newDelimiterComponent;

@property (nonatomic,readwrite,assign,getter=delimiterElement,setter=setDelimiterElement:) NSString* delimiterElement;

- (NSString*)delimiterElement;
- (void)setDelimiterElement :(NSString*)newDelimiterElement;

@property (nonatomic,readwrite,assign,getter=delimiterRepetition,setter=setDelimiterRepetition:) NSString* delimiterRepetition;

- (NSString*)delimiterRepetition;
- (void)setDelimiterRepetition :(NSString*)newDelimiterRepetition;

@property (nonatomic,readwrite,assign,getter=delimiterSegment,setter=setDelimiterSegment:) NSString* delimiterSegment;

- (NSString*)delimiterSegment;
- (void)setDelimiterSegment :(NSString*)newDelimiterSegment;

 

Default Value

1

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.

Element Property (X12Reader Module)

The current element.

Syntax

public var element: EDIElement {
  get {...}
}

@property (nonatomic,readonly,assign,getter=elementDataType) NSString* elementDataType;

- (NSString*)elementDataType;

@property (nonatomic,readonly,assign,getter=elementIsComposite) BOOL elementIsComposite;

- (BOOL)elementIsComposite;

@property (nonatomic,readonly,assign,getter=elementMaxLen) int elementMaxLen;

- (int)elementMaxLen;

@property (nonatomic,readonly,assign,getter=elementMinLen) int elementMinLen;

- (int)elementMinLen;

@property (nonatomic,readonly,assign,getter=elementSchemaDesc) NSString* elementSchemaDesc;

- (NSString*)elementSchemaDesc;

@property (nonatomic,readonly,assign,getter=elementSchemaName) NSString* elementSchemaName;

- (NSString*)elementSchemaName;

@property (nonatomic,readonly,assign,getter=elementValue) NSString* elementValue;

- (NSString*)elementValue;

 

Default Value

1

Remarks

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

This property is read-only.

ElementCount Property (X12Reader Module)

The number of elements in the current Segment.

Syntax

public var elementCount: Int32 {
  get {...}
}

@property (nonatomic,readonly,assign,getter=elementCount) int elementCount;

- (int)elementCount;

Default Value

0

Remarks

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

This property is read-only.

ElementIndex Property (X12Reader Module)

The index of the current Element.

Syntax

public var elementIndex: Int32 {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=elementIndex,setter=setElementIndex:) int elementIndex;

- (int)elementIndex;
- (void)setElementIndex :(int)newElementIndex;

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.

FunctionalGroup Property (X12Reader Module)

The current FunctionalGroup.

Syntax

public var functionalGroup: X12FunctionalGroup {
  get {...}
}

@property (nonatomic,readwrite,assign,getter=FGroupAppReceiverCode,setter=setFGroupAppReceiverCode:) NSString* FGroupAppReceiverCode;

- (NSString*)FGroupAppReceiverCode;
- (void)setFGroupAppReceiverCode :(NSString*)newFGroupAppReceiverCode;

@property (nonatomic,readwrite,assign,getter=FGroupAppSenderCode,setter=setFGroupAppSenderCode:) NSString* FGroupAppSenderCode;

- (NSString*)FGroupAppSenderCode;
- (void)setFGroupAppSenderCode :(NSString*)newFGroupAppSenderCode;

@property (nonatomic,readwrite,assign,getter=FGroupDate,setter=setFGroupDate:) NSString* FGroupDate;

- (NSString*)FGroupDate;
- (void)setFGroupDate :(NSString*)newFGroupDate;

@property (nonatomic,readwrite,assign,getter=FGroupFunctionalIdentifierCode,setter=setFGroupFunctionalIdentifierCode:) NSString* FGroupFunctionalIdentifierCode;

- (NSString*)FGroupFunctionalIdentifierCode;
- (void)setFGroupFunctionalIdentifierCode :(NSString*)newFGroupFunctionalIdentifierCode;

@property (nonatomic,readwrite,assign,getter=FGroupGroupControlNum,setter=setFGroupGroupControlNum:) NSString* FGroupGroupControlNum;

- (NSString*)FGroupGroupControlNum;
- (void)setFGroupGroupControlNum :(NSString*)newFGroupGroupControlNum;

@property (nonatomic,readwrite,assign,getter=FGroupResponsibleAgencyCode,setter=setFGroupResponsibleAgencyCode:) NSString* FGroupResponsibleAgencyCode;

- (NSString*)FGroupResponsibleAgencyCode;
- (void)setFGroupResponsibleAgencyCode :(NSString*)newFGroupResponsibleAgencyCode;

@property (nonatomic,readwrite,assign,getter=FGroupTime,setter=setFGroupTime:) NSString* FGroupTime;

- (NSString*)FGroupTime;
- (void)setFGroupTime :(NSString*)newFGroupTime;

@property (nonatomic,readwrite,assign,getter=FGroupVersion,setter=setFGroupVersion:) NSString* FGroupVersion;

- (NSString*)FGroupVersion;
- (void)setFGroupVersion :(NSString*)newFGroupVersion;

 

Default Value

1

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.

FunctionalGroupCount Property (X12Reader Module)

The number of FunctionalGroups in the current Interchange.

Syntax

public var functionalGroupCount: Int32 {
  get {...}
}

@property (nonatomic,readonly,assign,getter=functionalGroupCount) int functionalGroupCount;

- (int)functionalGroupCount;

Default Value

0

Remarks

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

This property is read-only.

FunctionalGroupIndex Property (X12Reader Module)

The index of the current FunctionalGroup.

Syntax

public var functionalGroupIndex: Int32 {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=functionalGroupIndex,setter=setFunctionalGroupIndex:) int functionalGroupIndex;

- (int)functionalGroupIndex;
- (void)setFunctionalGroupIndex :(int)newFunctionalGroupIndex;

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.

InputData Property (X12Reader Module)

The EDI message, specified as a string.

Syntax

public var inputData: String {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=inputData,setter=setInputData:) NSString* inputData;

- (NSString*)inputData;
- (void)setInputData :(NSString*)newInputData;

Default Value

""

Remarks

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

InputFile Property (X12Reader Module)

The file containing the EDI message.

Syntax

public var inputFile: String {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=inputFile,setter=setInputFile:) NSString* inputFile;

- (NSString*)inputFile;
- (void)setInputFile :(NSString*)newInputFile;

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.

Interchange Property (X12Reader Module)

The current Interchange.

Syntax

public var interchange: X12Interchange {
  get {...}
}

@property (nonatomic,readwrite,assign,getter=interchangeAckRequest,setter=setInterchangeAckRequest:) NSString* interchangeAckRequest;

- (NSString*)interchangeAckRequest;
- (void)setInterchangeAckRequest :(NSString*)newInterchangeAckRequest;

@property (nonatomic,readwrite,assign,getter=interchangeAuthorizationInfo,setter=setInterchangeAuthorizationInfo:) NSString* interchangeAuthorizationInfo;

- (NSString*)interchangeAuthorizationInfo;
- (void)setInterchangeAuthorizationInfo :(NSString*)newInterchangeAuthorizationInfo;

@property (nonatomic,readwrite,assign,getter=interchangeAuthorizationInfoQualifier,setter=setInterchangeAuthorizationInfoQualifier:) NSString* interchangeAuthorizationInfoQualifier;

- (NSString*)interchangeAuthorizationInfoQualifier;
- (void)setInterchangeAuthorizationInfoQualifier :(NSString*)newInterchangeAuthorizationInfoQualifier;

@property (nonatomic,readwrite,assign,getter=interchangeDate,setter=setInterchangeDate:) NSString* interchangeDate;

- (NSString*)interchangeDate;
- (void)setInterchangeDate :(NSString*)newInterchangeDate;

@property (nonatomic,readwrite,assign,getter=interchangeInterchangeControlNum,setter=setInterchangeInterchangeControlNum:) NSString* interchangeInterchangeControlNum;

- (NSString*)interchangeInterchangeControlNum;
- (void)setInterchangeInterchangeControlNum :(NSString*)newInterchangeInterchangeControlNum;

@property (nonatomic,readwrite,assign,getter=interchangeInterchangeControlVersionNum,setter=setInterchangeInterchangeControlVersionNum:) NSString* interchangeInterchangeControlVersionNum;

- (NSString*)interchangeInterchangeControlVersionNum;
- (void)setInterchangeInterchangeControlVersionNum :(NSString*)newInterchangeInterchangeControlVersionNum;

@property (nonatomic,readwrite,assign,getter=interchangeReceiverID,setter=setInterchangeReceiverID:) NSString* interchangeReceiverID;

- (NSString*)interchangeReceiverID;
- (void)setInterchangeReceiverID :(NSString*)newInterchangeReceiverID;

@property (nonatomic,readwrite,assign,getter=interchangeReceiverIDQualifier,setter=setInterchangeReceiverIDQualifier:) NSString* interchangeReceiverIDQualifier;

- (NSString*)interchangeReceiverIDQualifier;
- (void)setInterchangeReceiverIDQualifier :(NSString*)newInterchangeReceiverIDQualifier;

@property (nonatomic,readwrite,assign,getter=interchangeSecurityInfo,setter=setInterchangeSecurityInfo:) NSString* interchangeSecurityInfo;

- (NSString*)interchangeSecurityInfo;
- (void)setInterchangeSecurityInfo :(NSString*)newInterchangeSecurityInfo;

@property (nonatomic,readwrite,assign,getter=interchangeSecurityInfoQualifier,setter=setInterchangeSecurityInfoQualifier:) NSString* interchangeSecurityInfoQualifier;

- (NSString*)interchangeSecurityInfoQualifier;
- (void)setInterchangeSecurityInfoQualifier :(NSString*)newInterchangeSecurityInfoQualifier;

@property (nonatomic,readwrite,assign,getter=interchangeSenderID,setter=setInterchangeSenderID:) NSString* interchangeSenderID;

- (NSString*)interchangeSenderID;
- (void)setInterchangeSenderID :(NSString*)newInterchangeSenderID;

@property (nonatomic,readwrite,assign,getter=interchangeSenderIDQualifier,setter=setInterchangeSenderIDQualifier:) NSString* interchangeSenderIDQualifier;

- (NSString*)interchangeSenderIDQualifier;
- (void)setInterchangeSenderIDQualifier :(NSString*)newInterchangeSenderIDQualifier;

@property (nonatomic,readwrite,assign,getter=interchangeTime,setter=setInterchangeTime:) NSString* interchangeTime;

- (NSString*)interchangeTime;
- (void)setInterchangeTime :(NSString*)newInterchangeTime;

@property (nonatomic,readwrite,assign,getter=interchangeUsageIndicator,setter=setInterchangeUsageIndicator:) NSString* interchangeUsageIndicator;

- (NSString*)interchangeUsageIndicator;
- (void)setInterchangeUsageIndicator :(NSString*)newInterchangeUsageIndicator;

 

Default Value

1

Remarks

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

This property is read-only.

InterchangeCount Property (X12Reader Module)

The number of Interchanges in the document.

Syntax

public var interchangeCount: Int32 {
  get {...}
}

@property (nonatomic,readonly,assign,getter=interchangeCount) int interchangeCount;

- (int)interchangeCount;

Default Value

0

Remarks

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

This property is read-only.

InterchangeIndex Property (X12Reader Module)

The index of the current Interchange.

Syntax

public var interchangeIndex: Int32 {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=interchangeIndex,setter=setInterchangeIndex:) int interchangeIndex;

- (int)interchangeIndex;
- (void)setInterchangeIndex :(int)newInterchangeIndex;

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.

Loop Property (X12Reader Module)

Specifies the loop to load segments from.

Syntax

public var loop: String {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=loop,setter=setLoop:) NSString* loop;

- (NSString*)loop;
- (void)setLoop :(NSString*)newLoop;

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.

Segment Property (X12Reader Module)

The current segment.

Syntax

public var segment: EDISegment {
  get {...}
}

@property (nonatomic,readonly,assign,getter=segmentOptional) BOOL segmentOptional;

- (BOOL)segmentOptional;

@property (nonatomic,readonly,assign,getter=segmentPath) NSString* segmentPath;

- (NSString*)segmentPath;

@property (nonatomic,readonly,assign,getter=segmentSchemaPath) NSString* segmentSchemaPath;

- (NSString*)segmentSchemaPath;

@property (nonatomic,readonly,assign,getter=segmentTag) NSString* segmentTag;

- (NSString*)segmentTag;

 

Default Value

1

Remarks

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

This property is read-only.

SegmentCount Property (X12Reader Module)

The number of segments in the current TransactionSet.

Syntax

public var segmentCount: Int32 {
  get {...}
}

@property (nonatomic,readonly,assign,getter=segmentCount) int segmentCount;

- (int)segmentCount;

Default Value

0

Remarks

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

This property is read-only.

SegmentIndex Property (X12Reader Module)

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

Syntax

public var segmentIndex: Int32 {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=segmentIndex,setter=setSegmentIndex:) int segmentIndex;

- (int)segmentIndex;
- (void)setSegmentIndex :(int)newSegmentIndex;

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.

TransactionSet Property (X12Reader Module)

The current TransactionSet.

Syntax

public var transactionSet: X12TransactionSet {
  get {...}
}

@property (nonatomic,readwrite,assign,getter=transSetImpConventionReference,setter=setTransSetImpConventionReference:) NSString* transSetImpConventionReference;

- (NSString*)transSetImpConventionReference;
- (void)setTransSetImpConventionReference :(NSString*)newTransSetImpConventionReference;

@property (nonatomic,readwrite,assign,getter=transSetTransactionSetControlNum,setter=setTransSetTransactionSetControlNum:) NSString* transSetTransactionSetControlNum;

- (NSString*)transSetTransactionSetControlNum;
- (void)setTransSetTransactionSetControlNum :(NSString*)newTransSetTransactionSetControlNum;

@property (nonatomic,readwrite,assign,getter=transSetTransactionSetIDCode,setter=setTransSetTransactionSetIDCode:) NSString* transSetTransactionSetIDCode;

- (NSString*)transSetTransactionSetIDCode;
- (void)setTransSetTransactionSetIDCode :(NSString*)newTransSetTransactionSetIDCode;

 

Default Value

1

Remarks

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

This property is read-only.

TransactionSetCount Property (X12Reader Module)

The number of TransactionSets in the current FunctionalGroup.

Syntax

public var transactionSetCount: Int32 {
  get {...}
}

@property (nonatomic,readonly,assign,getter=transactionSetCount) int transactionSetCount;

- (int)transactionSetCount;

Default Value

0

Remarks

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

This property is read-only.

TransactionSetIndex Property (X12Reader Module)

The current TransactionSet index.

Syntax

public var transactionSetIndex: Int32 {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=transactionSetIndex,setter=setTransactionSetIndex:) int transactionSetIndex;

- (int)transactionSetIndex;
- (void)setTransactionSetIndex :(int)newTransactionSetIndex;

Default Value

1

Remarks

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

ValidateOnParse Property (X12Reader Module)

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

Syntax

public var validateOnParse: Bool {
  get {...}
  set {...}
}

@property (nonatomic,readwrite,assign,getter=validateOnParse,setter=setValidateOnParse:) BOOL validateOnParse;

- (BOOL)validateOnParse;
- (void)setValidateOnParse :(BOOL)newValidateOnParse;

Default Value

False

Remarks

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

ValidationErrors Property (X12Reader Module)

Collection of validation errors for the current document.

Syntax

public var validationErrors: Array<X12ValidationErrorDetail> {
  get {...}
}

@property (nonatomic,readonly,assign,getter=validationErrorCount) int validationErrorCount;

- (int)validationErrorCount;

- (int)validationErrorColumn:(int)validationErrorIndex;

- (int)validationErrorComponentIndex:(int)validationErrorIndex;

- (int)validationErrorElementIndex:(int)validationErrorIndex;

- (NSString*)validationErrorErrorCode:(int)validationErrorIndex;

- (NSString*)validationErrorErrorMessage:(int)validationErrorIndex;

- (int)validationErrorErrorType:(int)validationErrorIndex;

- (int)validationErrorFGroupIndex:(int)validationErrorIndex;

- (int)validationErrorInterchangeIndex:(int)validationErrorIndex;

- (int)validationErrorLine:(int)validationErrorIndex;

- (long long)validationErrorPosition:(int)validationErrorIndex;

- (int)validationErrorSegmentIndex:(int)validationErrorIndex;

- (NSString*)validationErrorSegmentTag:(int)validationErrorIndex;

- (int)validationErrorTransactionSetIndex:(int)validationErrorIndex;

Default Value

1

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.

Config Method (X12Reader Module)

Sets or retrieves a configuration setting.

Syntax

public func config(configurationString: String) throws -> String
- (NSString*)config:(NSString*)configurationString;

Remarks

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

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, 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 Module)

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

Syntax

public func generateAck() throws -> String
- (NSString*)generateAck;

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 Module)

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

Syntax

public func getElementValue(path: String) throws -> String
- (NSString*)getElementValue:(NSString*)path;

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 Module)

Loads schema information from a file or string data.

Syntax

public func loadSchema(fileOrData: String, messagename: String) throws -> Void
- (void)loadSchema:(NSString*)fileOrData :(NSString*)messagename;

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 Module)

Parse the EDI document and fire parsing events.

Syntax

public func parse() throws -> Void
- (void)parse;

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 Module)

Sets the component to its initial state.

Syntax

public func reset() throws -> Void
- (void)reset;

Remarks

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

SchemaCode Method (X12Reader Module)

Defines a code value within a list of codes.

Syntax

public func schemaCode(schemaId: String, codeListId: String, value: String, description_: String) throws -> Void
- (void)schemaCode:(NSString*)schemaId :(NSString*)codeListId :(NSString*)value :(NSString*)description;

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 Module)

Defines a list of codes.

Syntax

public func schemaCodeList(schemaId: String, codeListId: String, description_: String) throws -> Void
- (void)schemaCodeList:(NSString*)schemaId :(NSString*)codeListId :(NSString*)description;

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 Module)

Defines a composite element.

Syntax

public func schemaComposite(schemaId: String, compositeId: String, description_: String) throws -> Void
- (void)schemaComposite:(NSString*)schemaId :(NSString*)compositeId :(NSString*)description;

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 Module)

Defines a simple element.

Syntax

public func schemaElement(schemaId: String, elementId: String, dataType: String, minLength: Int32, maxLength: Int32, codeId: String, description_: String) throws -> Void
- (void)schemaElement:(NSString*)schemaId :(NSString*)elementId :(NSString*)dataType :(int)minLength :(int)maxLength :(NSString*)codeId :(NSString*)description;

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 Module)

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

Syntax

public func schemaElementRef(schemaId: String, parentId: String, elementId: String, refId: String, required: Bool, maxCount: Int32) throws -> Void
- (void)schemaElementRef:(NSString*)schemaId :(NSString*)parentId :(NSString*)elementId :(NSString*)refId :(BOOL)required :(int)maxCount;

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 Module)

Ends a schema definition.

Syntax

public func schemaEnd() throws -> Void
- (void)schemaEnd;

Remarks

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

SchemaGroup Method (X12Reader Module)

Defines a group of segments.

Syntax

public func schemaGroup(schemaId: String, groupPath: String, groupId: String, required: Bool, maxCount: Int32) throws -> Void
- (void)schemaGroup:(NSString*)schemaId :(NSString*)groupPath :(NSString*)groupId :(BOOL)required :(int)maxCount;

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 Module)

Defines a message.

Syntax

public func schemaMessage(schemaId: String, messageId: String, description_: String) throws -> Void
- (void)schemaMessage:(NSString*)schemaId :(NSString*)messageId :(NSString*)description;

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 Module)

Defines a segment.

Syntax

public func schemaSegment(schemaId: String, segmentId: String, description_: String) throws -> Void
- (void)schemaSegment:(NSString*)schemaId :(NSString*)segmentId :(NSString*)description;

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 Module)

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

Syntax

public func schemaSegmentRef(schemaId: String, segmentPath: String, segmentId: String, required: Bool, maxCount: Int32) throws -> Void
- (void)schemaSegmentRef:(NSString*)schemaId :(NSString*)segmentPath :(NSString*)segmentId :(BOOL)required :(int)maxCount;

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 Module)

Starts a schema definition.

Syntax

public func schemaStart(schemaId: String) throws -> Void
- (void)schemaStart:(NSString*)schemaId;

Remarks

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

Validate Method (X12Reader Module)

Validate the EDI document and warn about any errors encountered.

Syntax

public func validate() throws -> Void
- (void)validate;

Remarks

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

EndFunctionalGroup Event (X12Reader Module)

Fires at the end of a functional group while parsing.

Syntax

func onEndFunctionalGroup(tag: String, transactionCount: Int32, controlNumber: String)
- (void)onEndFunctionalGroup:(NSString*)tag :(int)transactionCount :(NSString*)controlNumber;

Remarks

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

EndInterchange Event (X12Reader Module)

Fires at the end of a interchange while parsing.

Syntax

func onEndInterchange(tag: String, groupCount: Int32, controlNumber: String)
- (void)onEndInterchange:(NSString*)tag :(int)groupCount :(NSString*)controlNumber;

Remarks

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

EndLoop Event (X12Reader Module)

Fires at the end of a loop while parsing.

Syntax

func onEndLoop(name: String, index: Int32)
- (void)onEndLoop:(NSString*)name :(int)index;

Remarks

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

EndTransactionSet Event (X12Reader Module)

Fires at the end of a transaction set while parsing.

Syntax

func onEndTransactionSet(tag: String, segmentCount: Int32, controlNumber: String)
- (void)onEndTransactionSet:(NSString*)tag :(int)segmentCount :(NSString*)controlNumber;

Remarks

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

Error Event (X12Reader Module)

Fires when a parsing error occurs.

Syntax

func onError(errorCode: Int32, description: String)
- (void)onError:(int)errorCode :(NSString*)description;

Remarks

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

ResolveSchema Event (X12Reader Module)

Fires to request schema information for a specific transaction set.

Syntax

func onResolveSchema(versionNumber: String, transactionSetIDCode: String)
- (void)onResolveSchema:(NSString*)versionNumber :(NSString*)transactionSetIDCode;

Remarks

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

Segment Event (X12Reader Module)

Fires at the end of a Segment while parsing.

Syntax

func onSegment(tag: String, schemaPath: String, optional: Bool, elementCount: Int32, schemaIndex: Int32, segmentIndex: Int32, maxCount: Int32, path: String)
- (void)onSegment:(NSString*)tag :(NSString*)schemaPath :(BOOL)optional :(int)elementCount :(int)schemaIndex :(int)segmentIndex :(int)maxCount :(NSString*)path;

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 Module)

Fires at the beginning of a functional group while parsing.

Syntax

func onStartFunctionalGroup(tag: String, appSenderCode: String, appReceiverCode: String, dateTime: String, controlNumber: String)
- (void)onStartFunctionalGroup:(NSString*)tag :(NSString*)appSenderCode :(NSString*)appReceiverCode :(NSString*)dateTime :(NSString*)controlNumber;

Remarks

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

StartInterchange Event (X12Reader Module)

Fires at the beginning of an interchange while parsing.

Syntax

func onStartInterchange(tag: String, senderID: String, receiverID: String, dateTime: String, controlNumber: String)
- (void)onStartInterchange:(NSString*)tag :(NSString*)senderID :(NSString*)receiverID :(NSString*)dateTime :(NSString*)controlNumber;

Remarks

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

StartLoop Event (X12Reader Module)

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

Syntax

func onStartLoop(name: String, index: Int32, maxCount: Int32, path: String)
- (void)onStartLoop:(NSString*)name :(int)index :(int)maxCount :(NSString*)path;

Remarks

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

StartTransactionSet Event (X12Reader Module)

Fires at the beginning of a transaction set while parsing.

Syntax

func onStartTransactionSet(tag: String, versionNumber: String, transactionSetIDCode: String, controlNumber: String, schemaLoaded: Bool)
- (void)onStartTransactionSet:(NSString*)tag :(NSString*)versionNumber :(NSString*)transactionSetIDCode :(NSString*)controlNumber :(BOOL)schemaLoaded;

Remarks

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

ValidateWarning Event (X12Reader Module)

Fires to warn about validation errors.

Syntax

func onValidateWarning(position: Int64, line: Int32, column: Int32, errorCode: String, errorMessage: String, errorType: Int32)
- (void)onValidateWarning:(long long)position :(int)line :(int)column :(NSString*)errorCode :(NSString*)errorMessage :(int)errorType;

Remarks

When the class 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 Value: ""

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 Value: False

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

maxLen
Int32 (read-only)

Default Value: 0

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

minLen
Int32 (read-only)

Default Value: 0

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

schemaDesc
String (read-only)

Default Value: ""

The description of the element as specified in the schema.

schemaName
String (read-only)

Default Value: ""

The name of the element as specified in the schema.

value
String (read-only)

Default Value: ""

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

Constructors

public init()

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 Value: False

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

path
String (read-only)

Default Value: ""

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

schemaPath
String (read-only)

Default Value: ""

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 Value: ""

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

Constructors

public init()

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 Value: ":"

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 Value: "*"

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 Value: "^"

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 Value: "~"

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 init()

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 Value: ""

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 Value: ""

Code identifying the sender of FunctionalGroup

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

date
String

Default Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

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

public init()

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 Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

The identification code of the receiver of the transaction set.

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

receiverIDQualifier
String

Default Value: ""

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 Value: ""

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 Value: ""

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 Value: ""

The identification code of the sender of the transaction set.

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

senderIDQualifier
String

Default Value: ""

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 Value: ""

The time that the Interchange sets was prepared.

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

usageIndicator
String

Default Value: ""

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 init()

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 Value: ""

Reference used to identify the implementation convention.

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

transactionSetControlNum
String

Default Value: ""

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 Value: ""

The identifier code for the transaction set.

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

Constructors

public init()

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
Int32 (read-only)

Default Value: 0

The column number where the error occurred.

componentIndex
Int32 (read-only)

Default Value: 1

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

elementIndex
Int32 (read-only)

Default Value: 1

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

errorCode
String (read-only)

Default Value: "0"

The property contains the type of error encountered.

errorMessage
String (read-only)

Default Value: ""

is a textual description of the error.

errorType
Int32 (read-only)

Default Value: 0

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

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

fGroupIndex
Int32 (read-only)

Default Value: 1

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

interchangeIndex
Int32 (read-only)

Default Value: 1

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

line
Int32 (read-only)

Default Value: 0

The line number where the error occurred.

position
Int64 (read-only)

Default Value: 0

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

segmentIndex
Int32 (read-only)

Default Value: 1

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

segmentTag
String (read-only)

Default Value: ""

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

transactionSetIndex
Int32 (read-only)

Default Value: 1

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

Config Settings (X12Reader Module)

The class 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 class, 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 Module)

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.