X12Reader Class
Properties Methods Events Config Settings Errors
The X12Reader class efficiently parses complete X12 transmissions, providing a convenient way to extract and explore data from all included transaction sets.
Class Name
EDISDK_X12Reader
Procedural Interface
edisdk_x12reader_open(); edisdk_x12reader_close($res); edisdk_x12reader_register_callback($res, $id, $function); edisdk_x12reader_get_last_error($res); edisdk_x12reader_get_last_error_code($res); edisdk_x12reader_set($res, $id, $index, $value); edisdk_x12reader_get($res, $id, $index); edisdk_x12reader_do_config($res, $configurationstring); edisdk_x12reader_do_generateack($res); edisdk_x12reader_do_getelementvalue($res, $path); edisdk_x12reader_do_loadschema($res, $fileordata, $messagename); edisdk_x12reader_do_parse($res); edisdk_x12reader_do_reset($res); edisdk_x12reader_do_schemacode($res, $schemaid, $codelistid, $value, $description); edisdk_x12reader_do_schemacodelist($res, $schemaid, $codelistid, $description); edisdk_x12reader_do_schemacomposite($res, $schemaid, $compositeid, $description); edisdk_x12reader_do_schemaelement($res, $schemaid, $elementid, $datatype, $minlength, $maxlength, $codeid, $description); edisdk_x12reader_do_schemaelementref($res, $schemaid, $parentid, $elementid, $refid, $required, $maxcount); edisdk_x12reader_do_schemaend($res); edisdk_x12reader_do_schemagroup($res, $schemaid, $grouppath, $groupid, $required, $maxcount); edisdk_x12reader_do_schemamessage($res, $schemaid, $messageid, $description); edisdk_x12reader_do_schemasegment($res, $schemaid, $segmentid, $description); edisdk_x12reader_do_schemasegmentref($res, $schemaid, $segmentpath, $segmentid, $required, $maxcount); edisdk_x12reader_do_schemastart($res, $schemaid); edisdk_x12reader_do_validate($res);
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 class with short descriptions. Click on the links for further details.
| AckType | Specifies the type of ACK that will be generated by GenerateAck . |
| BuildDOM | Specifies how much of the current document should be held in memory. |
| ComponentDataType | The type of data contained in the element. |
| ComponentIsComposite | Specifies whether the element is a simple or composite element. |
| ComponentMaxLen | For a simple element, this specifies the maximum length of the element according to the schema. |
| ComponentMinLen | For a simple element, this specifies the minimum length of the element according to the schema. |
| ComponentSchemaDesc | The description of the element as specified in the schema. |
| ComponentSchemaName | The name of the element as specified in the schema. |
| ComponentValue | If the element is a simple element, this property contains its value. |
| ComponentCount | The number of classes in the current Element. |
| ComponentIndex | The index of the current Class. |
| DelimiterComponent | The delimiter separating classes. |
| DelimiterElement | The delimiter separating elements. |
| DelimiterRepetition | The delimiter separating classes. |
| DelimiterSegment | The delimiter separating segments. |
| ElementDataType | The type of data contained in the element. |
| ElementIsComposite | Specifies whether the element is a simple or composite element. |
| ElementMaxLen | For a simple element, this specifies the maximum length of the element according to the schema. |
| ElementMinLen | For a simple element, this specifies the minimum length of the element according to the schema. |
| ElementSchemaDesc | The description of the element as specified in the schema. |
| ElementSchemaName | The name of the element as specified in the schema. |
| ElementValue | If the element is a simple element, this property contains its value. |
| ElementCount | The number of elements in the current Segment. |
| ElementIndex | The index of the current Element. |
| FGroupAppReceiverCode | The name or code of the intended receiver of the transaction set group. |
| FGroupAppSenderCode | Code identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long. |
| FGroupDate | The date that the group of transaction sets was prepared. |
| FGroupFunctionalIdentifierCode | A code identifying the type of transaction sets included in the functional group. |
| FGroupGroupControlNum | An identification number assigned by the sender to uniquely identify the group of transaction sets. |
| FGroupResponsibleAgencyCode | A code identifying the issuer of the standard that the transaction set conforms to. |
| FGroupTime | The time that the group of transaction sets was prepared. |
| FGroupVersion | Code indicating the version of the X12 standard used to construct the transaction set. |
| FunctionalGroupCount | The number of FunctionalGroups in the current Interchange. |
| FunctionalGroupIndex | The index of the current FunctionalGroup. |
| InputData | The EDI message, specified as a string. |
| InputFile | The file containing the EDI message. |
| InterchangeAckRequest | Code indicating whether an interchange acknowledgment is requested. |
| InterchangeAuthorizationInfo | Information used for additional identification or authorization of the interchange sender or the data in the interchange. |
| InterchangeAuthorizationInfoQualifier | A code indicating the type of data supplied in Authorization Information property. |
| InterchangeDate | The date that the Interchange was prepared. |
| InterchangeInterchangeControlNum | A control number assigned by the sender to uniquely identify the interchange. |
| InterchangeInterchangeControlVersionNum | A code specifying the version of the X12 standard used to construct the Interchange. |
| InterchangeReceiverID | The identification code of the receiver of the transaction set. |
| InterchangeReceiverIDQualifier | A code that identifies the format of the receiver ID. |
| InterchangeSecurityInfo | Coded security information associated with the Interchange. |
| InterchangeSecurityInfoQualifier | A code indicating the type of data in the Security Information property. |
| InterchangeSenderID | The identification code of the sender of the transaction set. |
| InterchangeSenderIDQualifier | A code that identifies the format of the sender ID. |
| InterchangeTime | The time that the Interchange sets was prepared. |
| InterchangeUsageIndicator | Code to indicate whether the interchange is a test or production. |
| InterchangeCount | The number of Interchanges in the document. |
| InterchangeIndex | The index of the current Interchange. |
| Loop | Specifies the loop to load segments from. |
| SegmentOptional | Specifies whether the segment is required or optional. |
| SegmentPath | Contains the path to the segment, including the groups that the segment is contained in. |
| SegmentSchemaPath | Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \\4[3]\\5[6]\\7[8] . |
| SegmentTag | The tag of the segment, such as BGM , DTM , FTX , etc. |
| SegmentCount | The number of segments in the current TransactionSet. |
| SegmentIndex | This property is used to specify a Segment within the current TransactionSet . |
| TransSetImpConventionReference | Reference used to identify the implementation convention. |
| TransSetTransactionSetControlNum | The unique transaction set control number assigned for a transaction set. |
| TransSetTransactionSetIDCode | The identifier code for the transaction set. |
| TransactionSetCount | The number of TransactionSets in the current FunctionalGroup. |
| TransactionSetIndex | The current TransactionSet index. |
| ValidateOnParse | When true, the class will validate any documents it parses. |
| ValidationErrorCount | The number of records in the ValidationError arrays. |
| ValidationErrorColumn | The column number where the error occurred. |
| ValidationErrorComponentIndex | This property holds the position of the class element where the error occurred. |
| ValidationErrorElementIndex | This property holds the position of the element where the error occurred. |
| ValidationErrorErrorCode | The ErrorCode property contains the type of error encountered. |
| ValidationErrorErrorMessage | ErrorMessage is a textual description of the error. |
| ValidationErrorErrorType | Indicates the level of the document where the error was encountered. |
| ValidationErrorFGroupIndex | This property holds the position of the functional group where the error occurred. |
| ValidationErrorInterchangeIndex | This property holds the position of the interchange where the error occurred. |
| ValidationErrorLine | The line number where the error occurred. |
| ValidationErrorPosition | This property holds the byte position in the EDI stream where the error occurred. |
| ValidationErrorSegmentIndex | This property is the index of the segment where the error occurred. |
| ValidationErrorSegmentTag | This property specifies the tag name of the segment where the error occurred. |
| ValidationErrorTransactionSetIndex | This property holds the position of the message where the error occurred. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
| Config | Sets or retrieves a configuration setting. |
| GenerateAck | Generates an ACK in response to the most recently parsed TransactionSet. |
| GetElementValue | Returns the value of the element or class at the specified path. |
| LoadSchema | Loads schema information from a file or string data. |
| Parse | Parse the EDI document and fire parsing events. |
| Reset | Sets the class to its initial state. |
| SchemaCode | Defines a code value within a list of codes. |
| SchemaCodeList | Defines a list of codes. |
| SchemaComposite | Defines a composite element. |
| SchemaElement | Defines a simple element. |
| SchemaElementRef | Adds a reference to an element in a segment or composite element. |
| SchemaEnd | Ends a schema definition. |
| SchemaGroup | Defines a group of segments. |
| SchemaMessage | Defines a message. |
| SchemaSegment | Defines a segment. |
| SchemaSegmentRef | Adds a reference to a segment in a message or group. |
| SchemaStart | Starts a schema definition. |
| Validate | Validate the EDI document and warn about any errors encountered. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
| EndFunctionalGroup | Fires at the end of a functional group while parsing. |
| EndInterchange | Fires at the end of a interchange while parsing. |
| EndLoop | Fires at the end of a loop while parsing. |
| EndTransactionSet | Fires at the end of a transaction set while parsing. |
| Error | Fires when a parsing error occurs. |
| ResolveSchema | Fires to request schema information for a specific transaction set. |
| Segment | Fires at the end of a Segment while parsing. |
| StartFunctionalGroup | Fires at the beginning of a functional group while parsing. |
| StartInterchange | Fires at the beginning of an interchange while parsing. |
| StartLoop | Fires at the beginning of a loop while parsing a transaction set. |
| StartTransactionSet | Fires at the beginning of a transaction set while parsing. |
| ValidateWarning | Fires to warn about validation errors. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
| InputFormat | The format of the input document. |
| MaxValidationErrors | The maximum number of validation errors to return. |
AckType Property (EDISDK_X12Reader Class)
Specifies the type of ACK that will be generated by GenerateAck .
Object Oriented Interface
public function getAckType(); public function setAckType($value);
Procedural Interface
edisdk_x12reader_get($res, 1 ); edisdk_x12reader_set($res, 1, $value );
Possible Values
X12READER_ACKTYPE_997(0),
X12READER_ACKTYPE_999(1),
X12READER_ACKTYPE_TA1(2)
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.
Data Type
Integer
BuildDOM Property (EDISDK_X12Reader Class)
Specifies how much of the current document should be held in memory.
Object Oriented Interface
public function getBuildDOM(); public function setBuildDOM($value);
Procedural Interface
edisdk_x12reader_get($res, 2 ); edisdk_x12reader_set($res, 2, $value );
Possible Values
X12READER_BUILDDOM_ENTIRE_DOCUMENT(0),
X12READER_BUILDDOM_INTERCHANGE(1),
X12READER_BUILDDOM_TRAN_SET(2),
X12READER_BUILDDOM_NONE(3)
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.
Data Type
Integer
ComponentDataType Property (EDISDK_X12Reader Class)
The type of data contained in the element.
Object Oriented Interface
public function getComponentDataType();
Procedural Interface
edisdk_x12reader_get($res, 3 );
Default Value
''
Remarks
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. |
This property is read-only and not available at design time.
Data Type
String
ComponentIsComposite Property (EDISDK_X12Reader Class)
Specifies whether the element is a simple or composite element.
Object Oriented Interface
public function getComponentIsComposite();
Procedural Interface
edisdk_x12reader_get($res, 4 );
Default Value
false
Remarks
Specifies whether the element is a simple or composite element. If true, the element is a composite element that contains other components.
This property is read-only and not available at design time.
Data Type
Boolean
ComponentMaxLen Property (EDISDK_X12Reader Class)
For a simple element, this specifies the maximum length of the element according to the schema.
Object Oriented Interface
public function getComponentMaxLen();
Procedural Interface
edisdk_x12reader_get($res, 5 );
Default Value
0
Remarks
For a simple element, this specifies the maximum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ComponentMinLen Property (EDISDK_X12Reader Class)
For a simple element, this specifies the minimum length of the element according to the schema.
Object Oriented Interface
public function getComponentMinLen();
Procedural Interface
edisdk_x12reader_get($res, 6 );
Default Value
0
Remarks
For a simple element, this specifies the minimum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ComponentSchemaDesc Property (EDISDK_X12Reader Class)
The description of the element as specified in the schema.
Object Oriented Interface
public function getComponentSchemaDesc();
Procedural Interface
edisdk_x12reader_get($res, 7 );
Default Value
''
Remarks
The description of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ComponentSchemaName Property (EDISDK_X12Reader Class)
The name of the element as specified in the schema.
Object Oriented Interface
public function getComponentSchemaName();
Procedural Interface
edisdk_x12reader_get($res, 8 );
Default Value
''
Remarks
The name of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ComponentValue Property (EDISDK_X12Reader Class)
If the element is a simple element, this property contains its value.
Object Oriented Interface
public function getComponentValue();
Procedural Interface
edisdk_x12reader_get($res, 9 );
Default Value
''
Remarks
If the element is a simple element, this field contains its value.
This property is read-only and not available at design time.
Data Type
String
ComponentCount Property (EDISDK_X12Reader Class)
The number of classes in the current Element.
Object Oriented Interface
public function getComponentCount();
Procedural Interface
edisdk_x12reader_get($res, 10 );
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.
Data Type
Integer
ComponentIndex Property (EDISDK_X12Reader Class)
The index of the current Class.
Object Oriented Interface
public function getComponentIndex(); public function setComponentIndex($value);
Procedural Interface
edisdk_x12reader_get($res, 11 ); edisdk_x12reader_set($res, 11, $value );
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.
Data Type
Integer
DelimiterComponent Property (EDISDK_X12Reader Class)
The delimiter separating classes.
Object Oriented Interface
public function getDelimiterComponent(); public function setDelimiterComponent($value);
Procedural Interface
edisdk_x12reader_get($res, 12 ); edisdk_x12reader_set($res, 12, $value );
Default Value
':'
Remarks
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
This property is not available at design time.
Data Type
String
DelimiterElement Property (EDISDK_X12Reader Class)
The delimiter separating elements.
Object Oriented Interface
public function getDelimiterElement(); public function setDelimiterElement($value);
Procedural Interface
edisdk_x12reader_get($res, 13 ); edisdk_x12reader_set($res, 13, $value );
Default Value
'*'
Remarks
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
This property is not available at design time.
Data Type
String
DelimiterRepetition Property (EDISDK_X12Reader Class)
The delimiter separating classes.
Object Oriented Interface
public function getDelimiterRepetition(); public function setDelimiterRepetition($value);
Procedural Interface
edisdk_x12reader_get($res, 14 ); edisdk_x12reader_set($res, 14, $value );
Default Value
'^'
Remarks
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
This property is not available at design time.
Data Type
String
DelimiterSegment Property (EDISDK_X12Reader Class)
The delimiter separating segments.
Object Oriented Interface
public function getDelimiterSegment(); public function setDelimiterSegment($value);
Procedural Interface
edisdk_x12reader_get($res, 15 ); edisdk_x12reader_set($res, 15, $value );
Default Value
'~'
Remarks
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
This property is not available at design time.
Data Type
String
ElementDataType Property (EDISDK_X12Reader Class)
The type of data contained in the element.
Object Oriented Interface
public function getElementDataType();
Procedural Interface
edisdk_x12reader_get($res, 16 );
Default Value
''
Remarks
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. |
This property is read-only and not available at design time.
Data Type
String
ElementIsComposite Property (EDISDK_X12Reader Class)
Specifies whether the element is a simple or composite element.
Object Oriented Interface
public function getElementIsComposite();
Procedural Interface
edisdk_x12reader_get($res, 17 );
Default Value
false
Remarks
Specifies whether the element is a simple or composite element. If true, the element is a composite element that contains other components.
This property is read-only and not available at design time.
Data Type
Boolean
ElementMaxLen Property (EDISDK_X12Reader Class)
For a simple element, this specifies the maximum length of the element according to the schema.
Object Oriented Interface
public function getElementMaxLen();
Procedural Interface
edisdk_x12reader_get($res, 18 );
Default Value
0
Remarks
For a simple element, this specifies the maximum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ElementMinLen Property (EDISDK_X12Reader Class)
For a simple element, this specifies the minimum length of the element according to the schema.
Object Oriented Interface
public function getElementMinLen();
Procedural Interface
edisdk_x12reader_get($res, 19 );
Default Value
0
Remarks
For a simple element, this specifies the minimum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ElementSchemaDesc Property (EDISDK_X12Reader Class)
The description of the element as specified in the schema.
Object Oriented Interface
public function getElementSchemaDesc();
Procedural Interface
edisdk_x12reader_get($res, 20 );
Default Value
''
Remarks
The description of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ElementSchemaName Property (EDISDK_X12Reader Class)
The name of the element as specified in the schema.
Object Oriented Interface
public function getElementSchemaName();
Procedural Interface
edisdk_x12reader_get($res, 21 );
Default Value
''
Remarks
The name of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ElementValue Property (EDISDK_X12Reader Class)
If the element is a simple element, this property contains its value.
Object Oriented Interface
public function getElementValue();
Procedural Interface
edisdk_x12reader_get($res, 22 );
Default Value
''
Remarks
If the element is a simple element, this field contains its value.
This property is read-only and not available at design time.
Data Type
String
ElementCount Property (EDISDK_X12Reader Class)
The number of elements in the current Segment.
Object Oriented Interface
public function getElementCount();
Procedural Interface
edisdk_x12reader_get($res, 23 );
Default Value
0
Remarks
This property contains the total number of elements in the current Segment.
This property is read-only.
Data Type
Integer
ElementIndex Property (EDISDK_X12Reader Class)
The index of the current Element.
Object Oriented Interface
public function getElementIndex(); public function setElementIndex($value);
Procedural Interface
edisdk_x12reader_get($res, 24 ); edisdk_x12reader_set($res, 24, $value );
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.
Data Type
Integer
FGroupAppReceiverCode Property (EDISDK_X12Reader Class)
The name or code of the intended receiver of the transaction set group.
Object Oriented Interface
public function getFGroupAppReceiverCode(); public function setFGroupAppReceiverCode($value);
Procedural Interface
edisdk_x12reader_get($res, 25 ); edisdk_x12reader_set($res, 25, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
FGroupAppSenderCode Property (EDISDK_X12Reader Class)
Code identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long.
Object Oriented Interface
public function getFGroupAppSenderCode(); public function setFGroupAppSenderCode($value);
Procedural Interface
edisdk_x12reader_get($res, 26 ); edisdk_x12reader_set($res, 26, $value );
Default Value
''
Remarks
Code identifying the sender of FunctionalGroup
This is an alphanumeric field with a value between 2 and 15 characters long.
This property is not available at design time.
Data Type
String
FGroupDate Property (EDISDK_X12Reader Class)
The date that the group of transaction sets was prepared.
Object Oriented Interface
public function getFGroupDate(); public function setFGroupDate($value);
Procedural Interface
edisdk_x12reader_get($res, 27 ); edisdk_x12reader_set($res, 27, $value );
Default Value
''
Remarks
The date that the group of transaction sets was prepared.
This is a numeric field with a value in the format YYMMDD.
This property is not available at design time.
Data Type
String
FGroupFunctionalIdentifierCode Property (EDISDK_X12Reader Class)
A code identifying the type of transaction sets included in the functional group.
Object Oriented Interface
public function getFGroupFunctionalIdentifierCode(); public function setFGroupFunctionalIdentifierCode($value);
Procedural Interface
edisdk_x12reader_get($res, 28 ); edisdk_x12reader_set($res, 28, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
FGroupGroupControlNum Property (EDISDK_X12Reader Class)
An identification number assigned by the sender to uniquely identify the group of transaction sets.
Object Oriented Interface
public function getFGroupGroupControlNum(); public function setFGroupGroupControlNum($value);
Procedural Interface
edisdk_x12reader_get($res, 29 ); edisdk_x12reader_set($res, 29, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
FGroupResponsibleAgencyCode Property (EDISDK_X12Reader Class)
A code identifying the issuer of the standard that the transaction set conforms to.
Object Oriented Interface
public function getFGroupResponsibleAgencyCode(); public function setFGroupResponsibleAgencyCode($value);
Procedural Interface
edisdk_x12reader_get($res, 30 ); edisdk_x12reader_set($res, 30, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
FGroupTime Property (EDISDK_X12Reader Class)
The time that the group of transaction sets was prepared.
Object Oriented Interface
public function getFGroupTime(); public function setFGroupTime($value);
Procedural Interface
edisdk_x12reader_get($res, 31 ); edisdk_x12reader_set($res, 31, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
FGroupVersion Property (EDISDK_X12Reader Class)
Code indicating the version of the X12 standard used to construct the transaction set.
Object Oriented Interface
public function getFGroupVersion(); public function setFGroupVersion($value);
Procedural Interface
edisdk_x12reader_get($res, 32 ); edisdk_x12reader_set($res, 32, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
FunctionalGroupCount Property (EDISDK_X12Reader Class)
The number of FunctionalGroups in the current Interchange.
Object Oriented Interface
public function getFunctionalGroupCount();
Procedural Interface
edisdk_x12reader_get($res, 33 );
Default Value
0
Remarks
This property contains the number of FunctionalGroups in the current Interchange.
This property is read-only.
Data Type
Integer
FunctionalGroupIndex Property (EDISDK_X12Reader Class)
The index of the current FunctionalGroup.
Object Oriented Interface
public function getFunctionalGroupIndex(); public function setFunctionalGroupIndex($value);
Procedural Interface
edisdk_x12reader_get($res, 34 ); edisdk_x12reader_set($res, 34, $value );
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.
Data Type
Integer
InputData Property (EDISDK_X12Reader Class)
The EDI message, specified as a string.
Object Oriented Interface
public function getInputData(); public function setInputData($value);
Procedural Interface
edisdk_x12reader_get($res, 35 ); edisdk_x12reader_set($res, 35, $value );
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.
Data Type
String
InputFile Property (EDISDK_X12Reader Class)
The file containing the EDI message.
Object Oriented Interface
public function getInputFile(); public function setInputFile($value);
Procedural Interface
edisdk_x12reader_get($res, 36 ); edisdk_x12reader_set($res, 36, $value );
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.
Data Type
String
InterchangeAckRequest Property (EDISDK_X12Reader Class)
Code indicating whether an interchange acknowledgment is requested.
Object Oriented Interface
public function getInterchangeAckRequest(); public function setInterchangeAckRequest($value);
Procedural Interface
edisdk_x12reader_get($res, 37 ); edisdk_x12reader_set($res, 37, $value );
Default Value
''
Remarks
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).
This property is not available at design time.
Data Type
String
InterchangeAuthorizationInfo Property (EDISDK_X12Reader Class)
Information used for additional identification or authorization of the interchange sender or the data in the interchange.
Object Oriented Interface
public function getInterchangeAuthorizationInfo(); public function setInterchangeAuthorizationInfo($value);
Procedural Interface
edisdk_x12reader_get($res, 38 ); edisdk_x12reader_set($res, 38, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
InterchangeAuthorizationInfoQualifier Property (EDISDK_X12Reader Class)
A code indicating the type of data supplied in Authorization Information property.
Object Oriented Interface
public function getInterchangeAuthorizationInfoQualifier(); public function setInterchangeAuthorizationInfoQualifier($value);
Procedural Interface
edisdk_x12reader_get($res, 39 ); edisdk_x12reader_set($res, 39, $value );
Default Value
''
Remarks
A code indicating the type of data supplied in Authorization Information field.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeDate Property (EDISDK_X12Reader Class)
The date that the Interchange was prepared.
Object Oriented Interface
public function getInterchangeDate(); public function setInterchangeDate($value);
Procedural Interface
edisdk_x12reader_get($res, 40 ); edisdk_x12reader_set($res, 40, $value );
Default Value
''
Remarks
The date that the Interchange was prepared.
This is a numeric field with a value of 6 digits in the format YYMMDD.
This property is not available at design time.
Data Type
String
InterchangeInterchangeControlNum Property (EDISDK_X12Reader Class)
A control number assigned by the sender to uniquely identify the interchange.
Object Oriented Interface
public function getInterchangeInterchangeControlNum(); public function setInterchangeInterchangeControlNum($value);
Procedural Interface
edisdk_x12reader_get($res, 41 ); edisdk_x12reader_set($res, 41, $value );
Default Value
''
Remarks
A control number assigned by the sender to uniquely identify the interchange.
This is a numeric field with a value of 9 digits.
This property is not available at design time.
Data Type
String
InterchangeInterchangeControlVersionNum Property (EDISDK_X12Reader Class)
A code specifying the version of the X12 standard used to construct the Interchange.
Object Oriented Interface
public function getInterchangeInterchangeControlVersionNum(); public function setInterchangeInterchangeControlVersionNum($value);
Procedural Interface
edisdk_x12reader_get($res, 42 ); edisdk_x12reader_set($res, 42, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
InterchangeReceiverID Property (EDISDK_X12Reader Class)
The identification code of the receiver of the transaction set.
Object Oriented Interface
public function getInterchangeReceiverID(); public function setInterchangeReceiverID($value);
Procedural Interface
edisdk_x12reader_get($res, 43 ); edisdk_x12reader_set($res, 43, $value );
Default Value
''
Remarks
The identification code of the receiver of the transaction set.
This is an alphanumeric field with a value of 15 characters.
This property is not available at design time.
Data Type
String
InterchangeReceiverIDQualifier Property (EDISDK_X12Reader Class)
A code that identifies the format of the receiver ID.
Object Oriented Interface
public function getInterchangeReceiverIDQualifier(); public function setInterchangeReceiverIDQualifier($value);
Procedural Interface
edisdk_x12reader_get($res, 44 ); edisdk_x12reader_set($res, 44, $value );
Default Value
''
Remarks
A code that identifies the format of the receiver ID.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeSecurityInfo Property (EDISDK_X12Reader Class)
Coded security information associated with the Interchange.
Object Oriented Interface
public function getInterchangeSecurityInfo(); public function setInterchangeSecurityInfo($value);
Procedural Interface
edisdk_x12reader_get($res, 45 ); edisdk_x12reader_set($res, 45, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
InterchangeSecurityInfoQualifier Property (EDISDK_X12Reader Class)
A code indicating the type of data in the Security Information property.
Object Oriented Interface
public function getInterchangeSecurityInfoQualifier(); public function setInterchangeSecurityInfoQualifier($value);
Procedural Interface
edisdk_x12reader_get($res, 46 ); edisdk_x12reader_set($res, 46, $value );
Default Value
''
Remarks
A code indicating the type of data in the Security Information field.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeSenderID Property (EDISDK_X12Reader Class)
The identification code of the sender of the transaction set.
Object Oriented Interface
public function getInterchangeSenderID(); public function setInterchangeSenderID($value);
Procedural Interface
edisdk_x12reader_get($res, 47 ); edisdk_x12reader_set($res, 47, $value );
Default Value
''
Remarks
The identification code of the sender of the transaction set.
This is an alphanumeric field with a value of 15 characters.
This property is not available at design time.
Data Type
String
InterchangeSenderIDQualifier Property (EDISDK_X12Reader Class)
A code that identifies the format of the sender ID.
Object Oriented Interface
public function getInterchangeSenderIDQualifier(); public function setInterchangeSenderIDQualifier($value);
Procedural Interface
edisdk_x12reader_get($res, 48 ); edisdk_x12reader_set($res, 48, $value );
Default Value
''
Remarks
A code that identifies the format of the sender ID.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeTime Property (EDISDK_X12Reader Class)
The time that the Interchange sets was prepared.
Object Oriented Interface
public function getInterchangeTime(); public function setInterchangeTime($value);
Procedural Interface
edisdk_x12reader_get($res, 49 ); edisdk_x12reader_set($res, 49, $value );
Default Value
''
Remarks
The time that the Interchange sets was prepared.
This is a numeric field with a value in the format HHMM.
This property is not available at design time.
Data Type
String
InterchangeUsageIndicator Property (EDISDK_X12Reader Class)
Code to indicate whether the interchange is a test or production.
Object Oriented Interface
public function getInterchangeUsageIndicator(); public function setInterchangeUsageIndicator($value);
Procedural Interface
edisdk_x12reader_get($res, 50 ); edisdk_x12reader_set($res, 50, $value );
Default Value
''
Remarks
Code to indicate whether the interchange is a test or production.
This is an alphanumeric field with a code value of 1 character.
This property is not available at design time.
Data Type
String
InterchangeCount Property (EDISDK_X12Reader Class)
The number of Interchanges in the document.
Object Oriented Interface
public function getInterchangeCount();
Procedural Interface
edisdk_x12reader_get($res, 51 );
Default Value
0
Remarks
This property contains the number of Interchanges in the current document.
This property is read-only.
Data Type
Integer
InterchangeIndex Property (EDISDK_X12Reader Class)
The index of the current Interchange.
Object Oriented Interface
public function getInterchangeIndex(); public function setInterchangeIndex($value);
Procedural Interface
edisdk_x12reader_get($res, 52 ); edisdk_x12reader_set($res, 52, $value );
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.
Data Type
Integer
Loop Property (EDISDK_X12Reader Class)
Specifies the loop to load segments from.
Object Oriented Interface
public function getLoop(); public function setLoop($value);
Procedural Interface
edisdk_x12reader_get($res, 53 ); edisdk_x12reader_set($res, 53, $value );
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.
Data Type
String
SegmentOptional Property (EDISDK_X12Reader Class)
Specifies whether the segment is required or optional.
Object Oriented Interface
public function getSegmentOptional();
Procedural Interface
edisdk_x12reader_get($res, 54 );
Default Value
false
Remarks
Specifies whether the segment is required or optional. If true, the element is optional.
This property is read-only and not available at design time.
Data Type
Boolean
SegmentPath Property (EDISDK_X12Reader Class)
Contains the path to the segment, including the groups that the segment is contained in.
Object Oriented Interface
public function getSegmentPath();
Procedural Interface
edisdk_x12reader_get($res, 55 );
Default Value
''
Remarks
Contains the path to the segment, including the groups that the segment is contained in.
This property is read-only and not available at design time.
Data Type
String
SegmentSchemaPath Property (EDISDK_X12Reader Class)
Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \\4[3]\\5[6]\\7[8] .
Object Oriented Interface
public function getSegmentSchemaPath();
Procedural Interface
edisdk_x12reader_get($res, 56 );
Default Value
''
Remarks
Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \4[3]\5[6]\7[8].
This property is read-only and not available at design time.
Data Type
String
SegmentTag Property (EDISDK_X12Reader Class)
The tag of the segment, such as BGM , DTM , FTX , etc.
Object Oriented Interface
public function getSegmentTag();
Procedural Interface
edisdk_x12reader_get($res, 57 );
Default Value
''
Remarks
The tag of the segment, such as BGM, DTM, FTX, etc.
This property is read-only and not available at design time.
Data Type
String
SegmentCount Property (EDISDK_X12Reader Class)
The number of segments in the current TransactionSet.
Object Oriented Interface
public function getSegmentCount();
Procedural Interface
edisdk_x12reader_get($res, 58 );
Default Value
0
Remarks
This property contains the number of elements in the current TransactionSet.
This property is read-only.
Data Type
Integer
SegmentIndex Property (EDISDK_X12Reader Class)
This property is used to specify a Segment within the current TransactionSet .
Object Oriented Interface
public function getSegmentIndex(); public function setSegmentIndex($value);
Procedural Interface
edisdk_x12reader_get($res, 59 ); edisdk_x12reader_set($res, 59, $value );
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.
Data Type
Integer
TransSetImpConventionReference Property (EDISDK_X12Reader Class)
Reference used to identify the implementation convention.
Object Oriented Interface
public function getTransSetImpConventionReference(); public function setTransSetImpConventionReference($value);
Procedural Interface
edisdk_x12reader_get($res, 60 ); edisdk_x12reader_set($res, 60, $value );
Default Value
''
Remarks
Reference used to identify the implementation convention.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
TransSetTransactionSetControlNum Property (EDISDK_X12Reader Class)
The unique transaction set control number assigned for a transaction set.
Object Oriented Interface
public function getTransSetTransactionSetControlNum(); public function setTransSetTransactionSetControlNum($value);
Procedural Interface
edisdk_x12reader_get($res, 61 ); edisdk_x12reader_set($res, 61, $value );
Default Value
''
Remarks
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.
This property is not available at design time.
Data Type
String
TransSetTransactionSetIDCode Property (EDISDK_X12Reader Class)
The identifier code for the transaction set.
Object Oriented Interface
public function getTransSetTransactionSetIDCode(); public function setTransSetTransactionSetIDCode($value);
Procedural Interface
edisdk_x12reader_get($res, 62 ); edisdk_x12reader_set($res, 62, $value );
Default Value
''
Remarks
The identifier code for the transaction set.
This is an alphanumeric field with a code value of 3 characters long.
This property is not available at design time.
Data Type
String
TransactionSetCount Property (EDISDK_X12Reader Class)
The number of TransactionSets in the current FunctionalGroup.
Object Oriented Interface
public function getTransactionSetCount();
Procedural Interface
edisdk_x12reader_get($res, 63 );
Default Value
0
Remarks
This property contains the count of TransactionSets in the current FunctionalGroup.
This property is read-only.
Data Type
Integer
TransactionSetIndex Property (EDISDK_X12Reader Class)
The current TransactionSet index.
Object Oriented Interface
public function getTransactionSetIndex(); public function setTransactionSetIndex($value);
Procedural Interface
edisdk_x12reader_get($res, 64 ); edisdk_x12reader_set($res, 64, $value );
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.
Data Type
Integer
ValidateOnParse Property (EDISDK_X12Reader Class)
When true, the class will validate any documents it parses.
Object Oriented Interface
public function getValidateOnParse(); public function setValidateOnParse($value);
Procedural Interface
edisdk_x12reader_get($res, 65 ); edisdk_x12reader_set($res, 65, $value );
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.
This property is not available at design time.
Data Type
Boolean
ValidationErrorCount Property (EDISDK_X12Reader Class)
The number of records in the ValidationError arrays.
Object Oriented Interface
public function getValidationErrorCount();
Procedural Interface
edisdk_x12reader_get($res, 66 );
Default Value
0
Remarks
This property controls the size of the following arrays:
- ValidationErrorColumn
- ValidationErrorComponentIndex
- ValidationErrorElementIndex
- ValidationErrorErrorCode
- ValidationErrorErrorMessage
- ValidationErrorErrorType
- ValidationErrorFGroupIndex
- ValidationErrorInterchangeIndex
- ValidationErrorLine
- ValidationErrorPosition
- ValidationErrorSegmentIndex
- ValidationErrorSegmentTag
- ValidationErrorTransactionSetIndex
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorColumn Property (EDISDK_X12Reader Class)
The column number where the error occurred.
Object Oriented Interface
public function getValidationErrorColumn($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 67 , $validationerrorindex);
Default Value
0
Remarks
The column number where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorComponentIndex Property (EDISDK_X12Reader Class)
This property holds the position of the class element where the error occurred.
Object Oriented Interface
public function getValidationErrorComponentIndex($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 68 , $validationerrorindex);
Default Value
1
Remarks
This property holds the position of the component element where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorElementIndex Property (EDISDK_X12Reader Class)
This property holds the position of the element where the error occurred.
Object Oriented Interface
public function getValidationErrorElementIndex($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 69 , $validationerrorindex);
Default Value
1
Remarks
This property holds the position of the element where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorErrorCode Property (EDISDK_X12Reader Class)
The ErrorCode property contains the type of error encountered.
Object Oriented Interface
public function getValidationErrorErrorCode($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 70 , $validationerrorindex);
Default Value
'0'
Remarks
The ValidationErrorErrorCode property contains the type of error encountered.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
String
ValidationErrorErrorMessage Property (EDISDK_X12Reader Class)
ErrorMessage is a textual description of the error.
Object Oriented Interface
public function getValidationErrorErrorMessage($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 71 , $validationerrorindex);
Default Value
''
Remarks
ValidationErrorErrorMessage is a textual description of the error.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
String
ValidationErrorErrorType Property (EDISDK_X12Reader Class)
Indicates the level of the document where the error was encountered.
Object Oriented Interface
public function getValidationErrorErrorType($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 72 , $validationerrorindex);
Default Value
0
Remarks
Indicates the level of the document where the error was encountered. Possible values include:
| 1 | Interchange |
| 2 | Functional group |
| 3 | Transaction set |
| 4 | Segment |
| 5 | Element |
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorFGroupIndex Property (EDISDK_X12Reader Class)
This property holds the position of the functional group where the error occurred.
Object Oriented Interface
public function getValidationErrorFGroupIndex($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 73 , $validationerrorindex);
Default Value
1
Remarks
This property holds the position of the functional group where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorInterchangeIndex Property (EDISDK_X12Reader Class)
This property holds the position of the interchange where the error occurred.
Object Oriented Interface
public function getValidationErrorInterchangeIndex($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 74 , $validationerrorindex);
Default Value
1
Remarks
This property holds the position of the interchange where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorLine Property (EDISDK_X12Reader Class)
The line number where the error occurred.
Object Oriented Interface
public function getValidationErrorLine($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 75 , $validationerrorindex);
Default Value
0
Remarks
The line number where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorPosition Property (EDISDK_X12Reader Class)
This property holds the byte position in the EDI stream where the error occurred.
Object Oriented Interface
public function getValidationErrorPosition($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 76 , $validationerrorindex);
Default Value
0
Remarks
This property holds the byte position in the EDI stream where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Long64
ValidationErrorSegmentIndex Property (EDISDK_X12Reader Class)
This property is the index of the segment where the error occurred.
Object Oriented Interface
public function getValidationErrorSegmentIndex($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 77 , $validationerrorindex);
Default Value
1
Remarks
This property is the index of the segment where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorSegmentTag Property (EDISDK_X12Reader Class)
This property specifies the tag name of the segment where the error occurred.
Object Oriented Interface
public function getValidationErrorSegmentTag($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 78 , $validationerrorindex);
Default Value
''
Remarks
This property specifies the tag name of the segment where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
String
ValidationErrorTransactionSetIndex Property (EDISDK_X12Reader Class)
This property holds the position of the message where the error occurred.
Object Oriented Interface
public function getValidationErrorTransactionSetIndex($validationerrorindex);
Procedural Interface
edisdk_x12reader_get($res, 79 , $validationerrorindex);
Default Value
1
Remarks
This property holds the position of the message where the error occurred.
The $validationerrorindex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
Config Method (EDISDK_X12Reader Class)
Sets or retrieves a configuration setting.
Object Oriented Interface
public function doConfig($configurationstring);
Procedural Interface
edisdk_x12reader_do_config($res, $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 (EDISDK_X12Reader Class)
Generates an ACK in response to the most recently parsed TransactionSet.
Object Oriented Interface
public function doGenerateAck();
Procedural Interface
edisdk_x12reader_do_generateack($res);
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 (EDISDK_X12Reader Class)
Returns the value of the element or class at the specified path.
Object Oriented Interface
public function doGetElementValue($path);
Procedural Interface
edisdk_x12reader_do_getelementvalue($res, $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 (EDISDK_X12Reader Class)
Loads schema information from a file or string data.
Object Oriented Interface
public function doLoadSchema($fileordata, $messagename);
Procedural Interface
edisdk_x12reader_do_loadschema($res, $fileordata, $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 (EDISDK_X12Reader Class)
Parse the EDI document and fire parsing events.
Object Oriented Interface
public function doParse();
Procedural Interface
edisdk_x12reader_do_parse($res);
Remarks
This method parses the input EDI document, firing the following events as it parses:
- StartInterchange
- StartFunctionalGroup
- ResolveSchema
- StartTransactionSet
- StartLoop
- Segment
- EndLoop
- EndTransactionSet
- EndFunctionalGroup
- EndInterchange
When multiple input sources are specified, only the highest-priority input will be used, in the following order:
Reset Method (EDISDK_X12Reader Class)
Sets the class to its initial state.
Object Oriented Interface
public function doReset();
Procedural Interface
edisdk_x12reader_do_reset($res);
Remarks
When called the class clears all inputs and outputs, and resets all properties to their default values.
SchemaCode Method (EDISDK_X12Reader Class)
Defines a code value within a list of codes.
Object Oriented Interface
public function doSchemaCode($schemaid, $codelistid, $value, $description);
Procedural Interface
edisdk_x12reader_do_schemacode($res, $schemaid, $codelistid, $value, $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 (EDISDK_X12Reader Class)
Defines a list of codes.
Object Oriented Interface
public function doSchemaCodeList($schemaid, $codelistid, $description);
Procedural Interface
edisdk_x12reader_do_schemacodelist($res, $schemaid, $codelistid, $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 (EDISDK_X12Reader Class)
Defines a composite element.
Object Oriented Interface
public function doSchemaComposite($schemaid, $compositeid, $description);
Procedural Interface
edisdk_x12reader_do_schemacomposite($res, $schemaid, $compositeid, $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 (EDISDK_X12Reader Class)
Defines a simple element.
Object Oriented Interface
public function doSchemaElement($schemaid, $elementid, $datatype, $minlength, $maxlength, $codeid, $description);
Procedural Interface
edisdk_x12reader_do_schemaelement($res, $schemaid, $elementid, $datatype, $minlength, $maxlength, $codeid, $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 (EDISDK_X12Reader Class)
Adds a reference to an element in a segment or composite element.
Object Oriented Interface
public function doSchemaElementRef($schemaid, $parentid, $elementid, $refid, $required, $maxcount);
Procedural Interface
edisdk_x12reader_do_schemaelementref($res, $schemaid, $parentid, $elementid, $refid, $required, $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 (EDISDK_X12Reader Class)
Ends a schema definition.
Object Oriented Interface
public function doSchemaEnd();
Procedural Interface
edisdk_x12reader_do_schemaend($res);
Remarks
Ends a schema definition when a schema is being defined manually instead of loaded from a file.
SchemaGroup Method (EDISDK_X12Reader Class)
Defines a group of segments.
Object Oriented Interface
public function doSchemaGroup($schemaid, $grouppath, $groupid, $required, $maxcount);
Procedural Interface
edisdk_x12reader_do_schemagroup($res, $schemaid, $grouppath, $groupid, $required, $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 (EDISDK_X12Reader Class)
Defines a message.
Object Oriented Interface
public function doSchemaMessage($schemaid, $messageid, $description);
Procedural Interface
edisdk_x12reader_do_schemamessage($res, $schemaid, $messageid, $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 (EDISDK_X12Reader Class)
Defines a segment.
Object Oriented Interface
public function doSchemaSegment($schemaid, $segmentid, $description);
Procedural Interface
edisdk_x12reader_do_schemasegment($res, $schemaid, $segmentid, $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 (EDISDK_X12Reader Class)
Adds a reference to a segment in a message or group.
Object Oriented Interface
public function doSchemaSegmentRef($schemaid, $segmentpath, $segmentid, $required, $maxcount);
Procedural Interface
edisdk_x12reader_do_schemasegmentref($res, $schemaid, $segmentpath, $segmentid, $required, $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 (EDISDK_X12Reader Class)
Starts a schema definition.
Object Oriented Interface
public function doSchemaStart($schemaid);
Procedural Interface
edisdk_x12reader_do_schemastart($res, $schemaid);
Remarks
Starts manually defining a schema, as an alternative to loading one from a file.
Validate Method (EDISDK_X12Reader Class)
Validate the EDI document and warn about any errors encountered.
Object Oriented Interface
public function doValidate();
Procedural Interface
edisdk_x12reader_do_validate($res);
Remarks
This method parses the input EDI document, firing the ValidateWarning event for any non-blocking errors it encounters.
EndFunctionalGroup Event (EDISDK_X12Reader Class)
Fires at the end of a functional group while parsing.
Object Oriented Interface
public function fireEndFunctionalGroup($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 1, array($this, 'fireEndFunctionalGroup'));
Parameter List
'tag'
'transactioncount'
'controlnumber'
Remarks
This event fires when the class encounters the end of a functional group while parsing a document.
EndInterchange Event (EDISDK_X12Reader Class)
Fires at the end of a interchange while parsing.
Object Oriented Interface
public function fireEndInterchange($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 2, array($this, 'fireEndInterchange'));
Parameter List
'tag'
'groupcount'
'controlnumber'
Remarks
This event fires when the class encounters the end of a interchange while parsing a document.
EndLoop Event (EDISDK_X12Reader Class)
Fires at the end of a loop while parsing.
Object Oriented Interface
public function fireEndLoop($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 3, array($this, 'fireEndLoop'));
Parameter List
'name'
'index'
Remarks
This event fires when the class encounters the end of a loop while parsing a document.
EndTransactionSet Event (EDISDK_X12Reader Class)
Fires at the end of a transaction set while parsing.
Object Oriented Interface
public function fireEndTransactionSet($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 4, array($this, 'fireEndTransactionSet'));
Parameter List
'tag'
'segmentcount'
'controlnumber'
Remarks
This event fires when the class encounters the end of a transaction set while parsing a document.
Error Event (EDISDK_X12Reader Class)
Fires when a parsing error occurs.
Object Oriented Interface
public function fireError($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 5, array($this, 'fireError'));
Parameter List
'errorcode'
'description'
Remarks
This event fires when the class encounters a parsing error while processing a document.
ResolveSchema Event (EDISDK_X12Reader Class)
Fires to request schema information for a specific transaction set.
Object Oriented Interface
public function fireResolveSchema($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 6, array($this, 'fireResolveSchema'));
Parameter List
'versionnumber'
'transactionsetidcode'
Remarks
LoadSchema can be called from within this event to load the schema information for the specified transaction set.
Segment Event (EDISDK_X12Reader Class)
Fires at the end of a Segment while parsing.
Object Oriented Interface
public function fireSegment($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 7, array($this, 'fireSegment'));
Parameter List
'tag'
'schemapath'
'optional'
'elementcount'
'schemaindex'
'segmentindex'
'maxcount'
'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 (EDISDK_X12Reader Class)
Fires at the beginning of a functional group while parsing.
Object Oriented Interface
public function fireStartFunctionalGroup($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 8, array($this, 'fireStartFunctionalGroup'));
Parameter List
'tag'
'appsendercode'
'appreceivercode'
'datetime'
'controlnumber'
Remarks
This event fires when the class encounters the start of a functional group while parsing a document.
StartInterchange Event (EDISDK_X12Reader Class)
Fires at the beginning of an interchange while parsing.
Object Oriented Interface
public function fireStartInterchange($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 9, array($this, 'fireStartInterchange'));
Parameter List
'tag'
'senderid'
'receiverid'
'datetime'
'controlnumber'
Remarks
This event fires at the beginning of an interchange while parsing a document.
StartLoop Event (EDISDK_X12Reader Class)
Fires at the beginning of a loop while parsing a transaction set.
Object Oriented Interface
public function fireStartLoop($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 10, array($this, 'fireStartLoop'));
Parameter List
'name'
'index'
'maxcount'
'path'
Remarks
This event fires when the class encounters the start of a loop while parsing a transaction set.
StartTransactionSet Event (EDISDK_X12Reader Class)
Fires at the beginning of a transaction set while parsing.
Object Oriented Interface
public function fireStartTransactionSet($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 11, array($this, 'fireStartTransactionSet'));
Parameter List
'tag'
'versionnumber'
'transactionsetidcode'
'controlnumber'
'schemaloaded'
Remarks
This event fires when the class encounters the start of a transaction set while parsing a document.
ValidateWarning Event (EDISDK_X12Reader Class)
Fires to warn about validation errors.
Object Oriented Interface
public function fireValidateWarning($param);
Procedural Interface
edisdk_x12reader_register_callback($res, 12, array($this, 'fireValidateWarning'));
Parameter List
'position'
'line'
'column'
'errorcode'
'errormessage'
'errortype'
Remarks
When the class encounters a non-blocking error while validating a document, this event fires with information about the error.
Config Settings (X12Reader Class)
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
| 0 (default) | X12 |
| 1 | XML |
Trappable Errors (X12Reader Class)
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. |