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.
Syntax
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 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. |
| Component | The current class. |
| ComponentCount | The number of classes in the current Element. |
| ComponentIndex | The index of the current Class. |
| Delimiters | Contains the delimiters for the EDI Document. |
| Element | The current element. |
| ElementCount | The number of elements in the current Segment. |
| ElementIndex | The index of the current Element. |
| FunctionalGroup | The current FunctionalGroup. |
| 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. |
| Interchange | The current Interchange. |
| InterchangeCount | The number of Interchanges in the document. |
| InterchangeIndex | The index of the current Interchange. |
| Loop | Specifies the loop to load segments from. |
| Segment | The current segment. |
| SegmentCount | The number of segments in the current TransactionSet. |
| SegmentIndex | This property is used to specify a Segment within the current TransactionSet . |
| TransactionSet | The current TransactionSet. |
| 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. |
| ValidationErrors | Collection of validation errors for the current document. |
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 (X12Reader Class)
Specifies the type of ACK that will be generated by GenerateAck .
Syntax
ANSI (Cross Platform) int GetAckType();
int SetAckType(int iAckType); Unicode (Windows) INT GetAckType();
INT SetAckType(INT iAckType);
Possible Values
AT_997(0),
AT_999(1),
AT_TA1(2)
int edisdk_x12reader_getacktype(void* lpObj);
int edisdk_x12reader_setacktype(void* lpObj, int iAckType);
int getAckType();
int setAckType(int iAckType);
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 (X12Reader Class)
Specifies how much of the current document should be held in memory.
Syntax
ANSI (Cross Platform) int GetBuildDOM();
int SetBuildDOM(int iBuildDOM); Unicode (Windows) INT GetBuildDOM();
INT SetBuildDOM(INT iBuildDOM);
Possible Values
BD_ENTIRE_DOCUMENT(0),
BD_INTERCHANGE(1),
BD_TRAN_SET(2),
BD_NONE(3)
int edisdk_x12reader_getbuilddom(void* lpObj);
int edisdk_x12reader_setbuilddom(void* lpObj, int iBuildDOM);
int getBuildDOM();
int setBuildDOM(int iBuildDOM);
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
Component Property (X12Reader Class)
The current class.
Syntax
EDISDKEDIElement* GetComponent();
char* edisdk_x12reader_getcomponentdatatype(void* lpObj);
int edisdk_x12reader_getcomponentiscomposite(void* lpObj);
int edisdk_x12reader_getcomponentmaxlen(void* lpObj);
int edisdk_x12reader_getcomponentminlen(void* lpObj);
char* edisdk_x12reader_getcomponentschemadesc(void* lpObj);
char* edisdk_x12reader_getcomponentschemaname(void* lpObj);
char* edisdk_x12reader_getcomponentvalue(void* lpObj);
QString getComponentDataType(); bool getComponentIsComposite(); int getComponentMaxLen(); int getComponentMinLen(); QString getComponentSchemaDesc(); QString getComponentSchemaName(); QString getComponentValue();
Remarks
When the current Element is a composite element, this property contains the component specified by ComponentIndex.
This property is read-only.
Data Type
ComponentCount Property (X12Reader Class)
The number of classes in the current Element.
Syntax
ANSI (Cross Platform) int GetComponentCount(); Unicode (Windows) INT GetComponentCount();
int edisdk_x12reader_getcomponentcount(void* lpObj);
int getComponentCount();
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 (X12Reader Class)
The index of the current Class.
Syntax
ANSI (Cross Platform) int GetComponentIndex();
int SetComponentIndex(int iComponentIndex); Unicode (Windows) INT GetComponentIndex();
INT SetComponentIndex(INT iComponentIndex);
int edisdk_x12reader_getcomponentindex(void* lpObj);
int edisdk_x12reader_setcomponentindex(void* lpObj, int iComponentIndex);
int getComponentIndex();
int setComponentIndex(int iComponentIndex);
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
Delimiters Property (X12Reader Class)
Contains the delimiters for the EDI Document.
Syntax
EDISDKX12Delimiters* GetDelimiters();
char* edisdk_x12reader_getdelimitercomponent(void* lpObj);
int edisdk_x12reader_setdelimitercomponent(void* lpObj, const char* lpszDelimiterComponent);
char* edisdk_x12reader_getdelimiterelement(void* lpObj);
int edisdk_x12reader_setdelimiterelement(void* lpObj, const char* lpszDelimiterElement);
char* edisdk_x12reader_getdelimiterrepetition(void* lpObj);
int edisdk_x12reader_setdelimiterrepetition(void* lpObj, const char* lpszDelimiterRepetition);
char* edisdk_x12reader_getdelimitersegment(void* lpObj);
int edisdk_x12reader_setdelimitersegment(void* lpObj, const char* lpszDelimiterSegment);
QString getDelimiterComponent();
int setDelimiterComponent(QString qsDelimiterComponent); QString getDelimiterElement();
int setDelimiterElement(QString qsDelimiterElement); QString getDelimiterRepetition();
int setDelimiterRepetition(QString qsDelimiterRepetition); QString getDelimiterSegment();
int setDelimiterSegment(QString qsDelimiterSegment);
Remarks
This property contains the delimiters that will be used when parsing the X12 document. If the document uses delimiters other than the default, change the properties of this object to parse the document correctly.
This property is read-only and not available at design time.
Data Type
Element Property (X12Reader Class)
The current element.
Syntax
EDISDKEDIElement* GetElement();
char* edisdk_x12reader_getelementdatatype(void* lpObj);
int edisdk_x12reader_getelementiscomposite(void* lpObj);
int edisdk_x12reader_getelementmaxlen(void* lpObj);
int edisdk_x12reader_getelementminlen(void* lpObj);
char* edisdk_x12reader_getelementschemadesc(void* lpObj);
char* edisdk_x12reader_getelementschemaname(void* lpObj);
char* edisdk_x12reader_getelementvalue(void* lpObj);
QString getElementDataType(); bool getElementIsComposite(); int getElementMaxLen(); int getElementMinLen(); QString getElementSchemaDesc(); QString getElementSchemaName(); QString getElementValue();
Remarks
This property contains the element within the current Segment specified by ElementIndex.
This property is read-only.
Data Type
ElementCount Property (X12Reader Class)
The number of elements in the current Segment.
Syntax
ANSI (Cross Platform) int GetElementCount(); Unicode (Windows) INT GetElementCount();
int edisdk_x12reader_getelementcount(void* lpObj);
int getElementCount();
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 (X12Reader Class)
The index of the current Element.
Syntax
ANSI (Cross Platform) int GetElementIndex();
int SetElementIndex(int iElementIndex); Unicode (Windows) INT GetElementIndex();
INT SetElementIndex(INT iElementIndex);
int edisdk_x12reader_getelementindex(void* lpObj);
int edisdk_x12reader_setelementindex(void* lpObj, int iElementIndex);
int getElementIndex();
int setElementIndex(int iElementIndex);
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
FunctionalGroup Property (X12Reader Class)
The current FunctionalGroup.
Syntax
EDISDKX12FunctionalGroup* GetFunctionalGroup();
char* edisdk_x12reader_getfgroupappreceivercode(void* lpObj);
int edisdk_x12reader_setfgroupappreceivercode(void* lpObj, const char* lpszFGroupAppReceiverCode);
char* edisdk_x12reader_getfgroupappsendercode(void* lpObj);
int edisdk_x12reader_setfgroupappsendercode(void* lpObj, const char* lpszFGroupAppSenderCode);
char* edisdk_x12reader_getfgroupdate(void* lpObj);
int edisdk_x12reader_setfgroupdate(void* lpObj, const char* lpszFGroupDate);
char* edisdk_x12reader_getfgroupfunctionalidentifiercode(void* lpObj);
int edisdk_x12reader_setfgroupfunctionalidentifiercode(void* lpObj, const char* lpszFGroupFunctionalIdentifierCode);
char* edisdk_x12reader_getfgroupgroupcontrolnum(void* lpObj);
int edisdk_x12reader_setfgroupgroupcontrolnum(void* lpObj, const char* lpszFGroupGroupControlNum);
char* edisdk_x12reader_getfgroupresponsibleagencycode(void* lpObj);
int edisdk_x12reader_setfgroupresponsibleagencycode(void* lpObj, const char* lpszFGroupResponsibleAgencyCode);
char* edisdk_x12reader_getfgrouptime(void* lpObj);
int edisdk_x12reader_setfgrouptime(void* lpObj, const char* lpszFGroupTime);
char* edisdk_x12reader_getfgroupversion(void* lpObj);
int edisdk_x12reader_setfgroupversion(void* lpObj, const char* lpszFGroupVersion);
QString getFGroupAppReceiverCode();
int setFGroupAppReceiverCode(QString qsFGroupAppReceiverCode); QString getFGroupAppSenderCode();
int setFGroupAppSenderCode(QString qsFGroupAppSenderCode); QString getFGroupDate();
int setFGroupDate(QString qsFGroupDate); QString getFGroupFunctionalIdentifierCode();
int setFGroupFunctionalIdentifierCode(QString qsFGroupFunctionalIdentifierCode); QString getFGroupGroupControlNum();
int setFGroupGroupControlNum(QString qsFGroupGroupControlNum); QString getFGroupResponsibleAgencyCode();
int setFGroupResponsibleAgencyCode(QString qsFGroupResponsibleAgencyCode); QString getFGroupTime();
int setFGroupTime(QString qsFGroupTime); QString getFGroupVersion();
int setFGroupVersion(QString qsFGroupVersion);
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.
Data Type
FunctionalGroupCount Property (X12Reader Class)
The number of FunctionalGroups in the current Interchange.
Syntax
ANSI (Cross Platform) int GetFunctionalGroupCount(); Unicode (Windows) INT GetFunctionalGroupCount();
int edisdk_x12reader_getfunctionalgroupcount(void* lpObj);
int getFunctionalGroupCount();
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 (X12Reader Class)
The index of the current FunctionalGroup.
Syntax
ANSI (Cross Platform) int GetFunctionalGroupIndex();
int SetFunctionalGroupIndex(int iFunctionalGroupIndex); Unicode (Windows) INT GetFunctionalGroupIndex();
INT SetFunctionalGroupIndex(INT iFunctionalGroupIndex);
int edisdk_x12reader_getfunctionalgroupindex(void* lpObj);
int edisdk_x12reader_setfunctionalgroupindex(void* lpObj, int iFunctionalGroupIndex);
int getFunctionalGroupIndex();
int setFunctionalGroupIndex(int iFunctionalGroupIndex);
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 (X12Reader Class)
The EDI message, specified as a string.
Syntax
ANSI (Cross Platform) char* GetInputData();
int SetInputData(const char* lpszInputData); Unicode (Windows) LPWSTR GetInputData();
INT SetInputData(LPCWSTR lpszInputData);
char* edisdk_x12reader_getinputdata(void* lpObj);
int edisdk_x12reader_setinputdata(void* lpObj, const char* lpszInputData);
QString getInputData();
int setInputData(QString qsInputData);
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 (X12Reader Class)
The file containing the EDI message.
Syntax
ANSI (Cross Platform) char* GetInputFile();
int SetInputFile(const char* lpszInputFile); Unicode (Windows) LPWSTR GetInputFile();
INT SetInputFile(LPCWSTR lpszInputFile);
char* edisdk_x12reader_getinputfile(void* lpObj);
int edisdk_x12reader_setinputfile(void* lpObj, const char* lpszInputFile);
QString getInputFile();
int setInputFile(QString qsInputFile);
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
Interchange Property (X12Reader Class)
The current Interchange.
Syntax
EDISDKX12Interchange* GetInterchange();
char* edisdk_x12reader_getinterchangeackrequest(void* lpObj);
int edisdk_x12reader_setinterchangeackrequest(void* lpObj, const char* lpszInterchangeAckRequest);
char* edisdk_x12reader_getinterchangeauthorizationinfo(void* lpObj);
int edisdk_x12reader_setinterchangeauthorizationinfo(void* lpObj, const char* lpszInterchangeAuthorizationInfo);
char* edisdk_x12reader_getinterchangeauthorizationinfoqualifier(void* lpObj);
int edisdk_x12reader_setinterchangeauthorizationinfoqualifier(void* lpObj, const char* lpszInterchangeAuthorizationInfoQualifier);
char* edisdk_x12reader_getinterchangedate(void* lpObj);
int edisdk_x12reader_setinterchangedate(void* lpObj, const char* lpszInterchangeDate);
char* edisdk_x12reader_getinterchangeinterchangecontrolnum(void* lpObj);
int edisdk_x12reader_setinterchangeinterchangecontrolnum(void* lpObj, const char* lpszInterchangeInterchangeControlNum);
char* edisdk_x12reader_getinterchangeinterchangecontrolversionnum(void* lpObj);
int edisdk_x12reader_setinterchangeinterchangecontrolversionnum(void* lpObj, const char* lpszInterchangeInterchangeControlVersionNum);
char* edisdk_x12reader_getinterchangereceiverid(void* lpObj);
int edisdk_x12reader_setinterchangereceiverid(void* lpObj, const char* lpszInterchangeReceiverID);
char* edisdk_x12reader_getinterchangereceiveridqualifier(void* lpObj);
int edisdk_x12reader_setinterchangereceiveridqualifier(void* lpObj, const char* lpszInterchangeReceiverIDQualifier);
char* edisdk_x12reader_getinterchangesecurityinfo(void* lpObj);
int edisdk_x12reader_setinterchangesecurityinfo(void* lpObj, const char* lpszInterchangeSecurityInfo);
char* edisdk_x12reader_getinterchangesecurityinfoqualifier(void* lpObj);
int edisdk_x12reader_setinterchangesecurityinfoqualifier(void* lpObj, const char* lpszInterchangeSecurityInfoQualifier);
char* edisdk_x12reader_getinterchangesenderid(void* lpObj);
int edisdk_x12reader_setinterchangesenderid(void* lpObj, const char* lpszInterchangeSenderID);
char* edisdk_x12reader_getinterchangesenderidqualifier(void* lpObj);
int edisdk_x12reader_setinterchangesenderidqualifier(void* lpObj, const char* lpszInterchangeSenderIDQualifier);
char* edisdk_x12reader_getinterchangetime(void* lpObj);
int edisdk_x12reader_setinterchangetime(void* lpObj, const char* lpszInterchangeTime);
char* edisdk_x12reader_getinterchangeusageindicator(void* lpObj);
int edisdk_x12reader_setinterchangeusageindicator(void* lpObj, const char* lpszInterchangeUsageIndicator);
QString getInterchangeAckRequest();
int setInterchangeAckRequest(QString qsInterchangeAckRequest); QString getInterchangeAuthorizationInfo();
int setInterchangeAuthorizationInfo(QString qsInterchangeAuthorizationInfo); QString getInterchangeAuthorizationInfoQualifier();
int setInterchangeAuthorizationInfoQualifier(QString qsInterchangeAuthorizationInfoQualifier); QString getInterchangeDate();
int setInterchangeDate(QString qsInterchangeDate); QString getInterchangeInterchangeControlNum();
int setInterchangeInterchangeControlNum(QString qsInterchangeInterchangeControlNum); QString getInterchangeInterchangeControlVersionNum();
int setInterchangeInterchangeControlVersionNum(QString qsInterchangeInterchangeControlVersionNum); QString getInterchangeReceiverID();
int setInterchangeReceiverID(QString qsInterchangeReceiverID); QString getInterchangeReceiverIDQualifier();
int setInterchangeReceiverIDQualifier(QString qsInterchangeReceiverIDQualifier); QString getInterchangeSecurityInfo();
int setInterchangeSecurityInfo(QString qsInterchangeSecurityInfo); QString getInterchangeSecurityInfoQualifier();
int setInterchangeSecurityInfoQualifier(QString qsInterchangeSecurityInfoQualifier); QString getInterchangeSenderID();
int setInterchangeSenderID(QString qsInterchangeSenderID); QString getInterchangeSenderIDQualifier();
int setInterchangeSenderIDQualifier(QString qsInterchangeSenderIDQualifier); QString getInterchangeTime();
int setInterchangeTime(QString qsInterchangeTime); QString getInterchangeUsageIndicator();
int setInterchangeUsageIndicator(QString qsInterchangeUsageIndicator);
Remarks
This property contains the current Interchange within the document specified by InterchangeIndex.
This property is read-only.
Data Type
InterchangeCount Property (X12Reader Class)
The number of Interchanges in the document.
Syntax
ANSI (Cross Platform) int GetInterchangeCount(); Unicode (Windows) INT GetInterchangeCount();
int edisdk_x12reader_getinterchangecount(void* lpObj);
int getInterchangeCount();
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 (X12Reader Class)
The index of the current Interchange.
Syntax
ANSI (Cross Platform) int GetInterchangeIndex();
int SetInterchangeIndex(int iInterchangeIndex); Unicode (Windows) INT GetInterchangeIndex();
INT SetInterchangeIndex(INT iInterchangeIndex);
int edisdk_x12reader_getinterchangeindex(void* lpObj);
int edisdk_x12reader_setinterchangeindex(void* lpObj, int iInterchangeIndex);
int getInterchangeIndex();
int setInterchangeIndex(int iInterchangeIndex);
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 (X12Reader Class)
Specifies the loop to load segments from.
Syntax
ANSI (Cross Platform) char* GetLoop();
int SetLoop(const char* lpszLoop); Unicode (Windows) LPWSTR GetLoop();
INT SetLoop(LPCWSTR lpszLoop);
char* edisdk_x12reader_getloop(void* lpObj);
int edisdk_x12reader_setloop(void* lpObj, const char* lpszLoop);
QString getLoop();
int setLoop(QString qsLoop);
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
Segment Property (X12Reader Class)
The current segment.
Syntax
EDISDKEDISegment* GetSegment();
int edisdk_x12reader_getsegmentoptional(void* lpObj);
char* edisdk_x12reader_getsegmentpath(void* lpObj);
char* edisdk_x12reader_getsegmentschemapath(void* lpObj);
char* edisdk_x12reader_getsegmenttag(void* lpObj);
bool getSegmentOptional(); QString getSegmentPath(); QString getSegmentSchemaPath(); QString getSegmentTag();
Remarks
This property contains the segment within the current Message specified by SegmentIndex.
This property is read-only.
Data Type
SegmentCount Property (X12Reader Class)
The number of segments in the current TransactionSet.
Syntax
ANSI (Cross Platform) int GetSegmentCount(); Unicode (Windows) INT GetSegmentCount();
int edisdk_x12reader_getsegmentcount(void* lpObj);
int getSegmentCount();
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 (X12Reader Class)
This property is used to specify a Segment within the current TransactionSet .
Syntax
ANSI (Cross Platform) int GetSegmentIndex();
int SetSegmentIndex(int iSegmentIndex); Unicode (Windows) INT GetSegmentIndex();
INT SetSegmentIndex(INT iSegmentIndex);
int edisdk_x12reader_getsegmentindex(void* lpObj);
int edisdk_x12reader_setsegmentindex(void* lpObj, int iSegmentIndex);
int getSegmentIndex();
int setSegmentIndex(int iSegmentIndex);
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
TransactionSet Property (X12Reader Class)
The current TransactionSet.
Syntax
EDISDKX12TransactionSet* GetTransactionSet();
char* edisdk_x12reader_gettranssetimpconventionreference(void* lpObj);
int edisdk_x12reader_settranssetimpconventionreference(void* lpObj, const char* lpszTransSetImpConventionReference);
char* edisdk_x12reader_gettranssettransactionsetcontrolnum(void* lpObj);
int edisdk_x12reader_settranssettransactionsetcontrolnum(void* lpObj, const char* lpszTransSetTransactionSetControlNum);
char* edisdk_x12reader_gettranssettransactionsetidcode(void* lpObj);
int edisdk_x12reader_settranssettransactionsetidcode(void* lpObj, const char* lpszTransSetTransactionSetIDCode);
QString getTransSetImpConventionReference();
int setTransSetImpConventionReference(QString qsTransSetImpConventionReference); QString getTransSetTransactionSetControlNum();
int setTransSetTransactionSetControlNum(QString qsTransSetTransactionSetControlNum); QString getTransSetTransactionSetIDCode();
int setTransSetTransactionSetIDCode(QString qsTransSetTransactionSetIDCode);
Remarks
This property contains the TransactionSet within the current Interchange or FunctionalGroup specified by TransactionSetIndex.
This property is read-only.
Data Type
TransactionSetCount Property (X12Reader Class)
The number of TransactionSets in the current FunctionalGroup.
Syntax
ANSI (Cross Platform) int GetTransactionSetCount(); Unicode (Windows) INT GetTransactionSetCount();
int edisdk_x12reader_gettransactionsetcount(void* lpObj);
int getTransactionSetCount();
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 (X12Reader Class)
The current TransactionSet index.
Syntax
ANSI (Cross Platform) int GetTransactionSetIndex();
int SetTransactionSetIndex(int iTransactionSetIndex); Unicode (Windows) INT GetTransactionSetIndex();
INT SetTransactionSetIndex(INT iTransactionSetIndex);
int edisdk_x12reader_gettransactionsetindex(void* lpObj);
int edisdk_x12reader_settransactionsetindex(void* lpObj, int iTransactionSetIndex);
int getTransactionSetIndex();
int setTransactionSetIndex(int iTransactionSetIndex);
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 (X12Reader Class)
When true, the class will validate any documents it parses.
Syntax
ANSI (Cross Platform) int GetValidateOnParse();
int SetValidateOnParse(int bValidateOnParse); Unicode (Windows) BOOL GetValidateOnParse();
INT SetValidateOnParse(BOOL bValidateOnParse);
int edisdk_x12reader_getvalidateonparse(void* lpObj);
int edisdk_x12reader_setvalidateonparse(void* lpObj, int bValidateOnParse);
bool getValidateOnParse();
int setValidateOnParse(bool bValidateOnParse);
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
ValidationErrors Property (X12Reader Class)
Collection of validation errors for the current document.
Syntax
EDISDKList<EDISDKX12ValidationErrorDetail>* GetValidationErrors();
int edisdk_x12reader_getvalidationerrorcount(void* lpObj);
int edisdk_x12reader_getvalidationerrorcolumn(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrorcomponentindex(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrorelementindex(void* lpObj, int validationerrorindex);
char* edisdk_x12reader_getvalidationerrorerrorcode(void* lpObj, int validationerrorindex);
char* edisdk_x12reader_getvalidationerrorerrormessage(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrorerrortype(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrorfgroupindex(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrorinterchangeindex(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrorline(void* lpObj, int validationerrorindex);
int64 edisdk_x12reader_getvalidationerrorposition(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrorsegmentindex(void* lpObj, int validationerrorindex);
char* edisdk_x12reader_getvalidationerrorsegmenttag(void* lpObj, int validationerrorindex);
int edisdk_x12reader_getvalidationerrortransactionsetindex(void* lpObj, int validationerrorindex);
int getValidationErrorCount(); int getValidationErrorColumn(int iValidationErrorIndex); int getValidationErrorComponentIndex(int iValidationErrorIndex); int getValidationErrorElementIndex(int iValidationErrorIndex); QString getValidationErrorErrorCode(int iValidationErrorIndex); QString getValidationErrorErrorMessage(int iValidationErrorIndex); int getValidationErrorErrorType(int iValidationErrorIndex); int getValidationErrorFGroupIndex(int iValidationErrorIndex); int getValidationErrorInterchangeIndex(int iValidationErrorIndex); int getValidationErrorLine(int iValidationErrorIndex); qint64 getValidationErrorPosition(int iValidationErrorIndex); int getValidationErrorSegmentIndex(int iValidationErrorIndex); QString getValidationErrorSegmentTag(int iValidationErrorIndex); int getValidationErrorTransactionSetIndex(int iValidationErrorIndex);
Remarks
After calling Validate this property contains details of any validation errors. Validation errors are also accessible through the ValidateWarning event as the document is validated.
This property is read-only and not available at design time.
Data Type
EDISDKX12ValidationErrorDetail
Config Method (X12Reader Class)
Sets or retrieves a configuration setting.
Syntax
ANSI (Cross Platform) char* Config(const char* lpszConfigurationString); Unicode (Windows) LPWSTR Config(LPCWSTR lpszConfigurationString);
char* edisdk_x12reader_config(void* lpObj, const char* lpszConfigurationString);
QString config(const QString& qsConfigurationString);
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.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
GenerateAck Method (X12Reader Class)
Generates an ACK in response to the most recently parsed TransactionSet.
Syntax
ANSI (Cross Platform) char* GenerateAck(); Unicode (Windows) LPWSTR GenerateAck();
char* edisdk_x12reader_generateack(void* lpObj);
QString 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.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
GetElementValue Method (X12Reader Class)
Returns the value of the element or class at the specified path.
Syntax
ANSI (Cross Platform) char* GetElementValue(const char* lpszPath); Unicode (Windows) LPWSTR GetElementValue(LPCWSTR lpszPath);
char* edisdk_x12reader_getelementvalue(void* lpObj, const char* lpszPath);
QString getElementValue(const QString& qsPath);
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");
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
LoadSchema Method (X12Reader Class)
Loads schema information from a file or string data.
Syntax
ANSI (Cross Platform) int LoadSchema(const char* lpszfileOrData, const char* lpszmessagename); Unicode (Windows) INT LoadSchema(LPCWSTR lpszfileOrData, LPCWSTR lpszmessagename);
int edisdk_x12reader_loadschema(void* lpObj, const char* lpszfileOrData, const char* lpszmessagename);
int loadSchema(const QString& qsfileOrData, const QString& qsmessagename);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Parse Method (X12Reader Class)
Parse the EDI document and fire parsing events.
Syntax
ANSI (Cross Platform) int Parse(); Unicode (Windows) INT Parse();
int edisdk_x12reader_parse(void* lpObj);
int parse();
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:
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Reset Method (X12Reader Class)
Sets the class to its initial state.
Syntax
ANSI (Cross Platform) int Reset(); Unicode (Windows) INT Reset();
int edisdk_x12reader_reset(void* lpObj);
int reset();
Remarks
When called the class clears all inputs and outputs, and resets all properties to their default values.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaCode Method (X12Reader Class)
Defines a code value within a list of codes.
Syntax
ANSI (Cross Platform) int SchemaCode(const char* lpszSchemaId, const char* lpszCodeListId, const char* lpszValue, const char* lpszDescription); Unicode (Windows) INT SchemaCode(LPCWSTR lpszSchemaId, LPCWSTR lpszCodeListId, LPCWSTR lpszValue, LPCWSTR lpszDescription);
int edisdk_x12reader_schemacode(void* lpObj, const char* lpszSchemaId, const char* lpszCodeListId, const char* lpszValue, const char* lpszDescription);
int schemaCode(const QString& qsSchemaId, const QString& qsCodeListId, const QString& qsValue, const QString& qsDescription);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaCodeList Method (X12Reader Class)
Defines a list of codes.
Syntax
ANSI (Cross Platform) int SchemaCodeList(const char* lpszSchemaId, const char* lpszCodeListId, const char* lpszDescription); Unicode (Windows) INT SchemaCodeList(LPCWSTR lpszSchemaId, LPCWSTR lpszCodeListId, LPCWSTR lpszDescription);
int edisdk_x12reader_schemacodelist(void* lpObj, const char* lpszSchemaId, const char* lpszCodeListId, const char* lpszDescription);
int schemaCodeList(const QString& qsSchemaId, const QString& qsCodeListId, const QString& qsDescription);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaComposite Method (X12Reader Class)
Defines a composite element.
Syntax
ANSI (Cross Platform) int SchemaComposite(const char* lpszSchemaId, const char* lpszCompositeId, const char* lpszDescription); Unicode (Windows) INT SchemaComposite(LPCWSTR lpszSchemaId, LPCWSTR lpszCompositeId, LPCWSTR lpszDescription);
int edisdk_x12reader_schemacomposite(void* lpObj, const char* lpszSchemaId, const char* lpszCompositeId, const char* lpszDescription);
int schemaComposite(const QString& qsSchemaId, const QString& qsCompositeId, const QString& qsDescription);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaElement Method (X12Reader Class)
Defines a simple element.
Syntax
ANSI (Cross Platform) int SchemaElement(const char* lpszSchemaId, const char* lpszElementId, const char* lpszDataType, int iMinLength, int iMaxLength, const char* lpszCodeId, const char* lpszDescription); Unicode (Windows) INT SchemaElement(LPCWSTR lpszSchemaId, LPCWSTR lpszElementId, LPCWSTR lpszDataType, INT iMinLength, INT iMaxLength, LPCWSTR lpszCodeId, LPCWSTR lpszDescription);
int edisdk_x12reader_schemaelement(void* lpObj, const char* lpszSchemaId, const char* lpszElementId, const char* lpszDataType, int iMinLength, int iMaxLength, const char* lpszCodeId, const char* lpszDescription);
int schemaElement(const QString& qsSchemaId, const QString& qsElementId, const QString& qsDataType, int iMinLength, int iMaxLength, const QString& qsCodeId, const QString& qsDescription);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaElementRef Method (X12Reader Class)
Adds a reference to an element in a segment or composite element.
Syntax
ANSI (Cross Platform) int SchemaElementRef(const char* lpszSchemaId, const char* lpszParentId, const char* lpszElementId, const char* lpszRefId, int bRequired, int iMaxCount); Unicode (Windows) INT SchemaElementRef(LPCWSTR lpszSchemaId, LPCWSTR lpszParentId, LPCWSTR lpszElementId, LPCWSTR lpszRefId, BOOL bRequired, INT iMaxCount);
int edisdk_x12reader_schemaelementref(void* lpObj, const char* lpszSchemaId, const char* lpszParentId, const char* lpszElementId, const char* lpszRefId, int bRequired, int iMaxCount);
int schemaElementRef(const QString& qsSchemaId, const QString& qsParentId, const QString& qsElementId, const QString& qsRefId, bool bRequired, int iMaxCount);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaEnd Method (X12Reader Class)
Ends a schema definition.
Syntax
ANSI (Cross Platform) int SchemaEnd(); Unicode (Windows) INT SchemaEnd();
int edisdk_x12reader_schemaend(void* lpObj);
int schemaEnd();
Remarks
Ends a schema definition when a schema is being defined manually instead of loaded from a file.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaGroup Method (X12Reader Class)
Defines a group of segments.
Syntax
ANSI (Cross Platform) int SchemaGroup(const char* lpszSchemaId, const char* lpszGroupPath, const char* lpszGroupId, int bRequired, int iMaxCount); Unicode (Windows) INT SchemaGroup(LPCWSTR lpszSchemaId, LPCWSTR lpszGroupPath, LPCWSTR lpszGroupId, BOOL bRequired, INT iMaxCount);
int edisdk_x12reader_schemagroup(void* lpObj, const char* lpszSchemaId, const char* lpszGroupPath, const char* lpszGroupId, int bRequired, int iMaxCount);
int schemaGroup(const QString& qsSchemaId, const QString& qsGroupPath, const QString& qsGroupId, bool bRequired, int iMaxCount);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaMessage Method (X12Reader Class)
Defines a message.
Syntax
ANSI (Cross Platform) int SchemaMessage(const char* lpszSchemaId, const char* lpszMessageId, const char* lpszDescription); Unicode (Windows) INT SchemaMessage(LPCWSTR lpszSchemaId, LPCWSTR lpszMessageId, LPCWSTR lpszDescription);
int edisdk_x12reader_schemamessage(void* lpObj, const char* lpszSchemaId, const char* lpszMessageId, const char* lpszDescription);
int schemaMessage(const QString& qsSchemaId, const QString& qsMessageId, const QString& qsDescription);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaSegment Method (X12Reader Class)
Defines a segment.
Syntax
ANSI (Cross Platform) int SchemaSegment(const char* lpszSchemaId, const char* lpszSegmentId, const char* lpszDescription); Unicode (Windows) INT SchemaSegment(LPCWSTR lpszSchemaId, LPCWSTR lpszSegmentId, LPCWSTR lpszDescription);
int edisdk_x12reader_schemasegment(void* lpObj, const char* lpszSchemaId, const char* lpszSegmentId, const char* lpszDescription);
int schemaSegment(const QString& qsSchemaId, const QString& qsSegmentId, const QString& qsDescription);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaSegmentRef Method (X12Reader Class)
Adds a reference to a segment in a message or group.
Syntax
ANSI (Cross Platform) int SchemaSegmentRef(const char* lpszSchemaId, const char* lpszSegmentPath, const char* lpszSegmentId, int bRequired, int iMaxCount); Unicode (Windows) INT SchemaSegmentRef(LPCWSTR lpszSchemaId, LPCWSTR lpszSegmentPath, LPCWSTR lpszSegmentId, BOOL bRequired, INT iMaxCount);
int edisdk_x12reader_schemasegmentref(void* lpObj, const char* lpszSchemaId, const char* lpszSegmentPath, const char* lpszSegmentId, int bRequired, int iMaxCount);
int schemaSegmentRef(const QString& qsSchemaId, const QString& qsSegmentPath, const QString& qsSegmentId, bool bRequired, int iMaxCount);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SchemaStart Method (X12Reader Class)
Starts a schema definition.
Syntax
ANSI (Cross Platform) int SchemaStart(const char* lpszSchemaId); Unicode (Windows) INT SchemaStart(LPCWSTR lpszSchemaId);
int edisdk_x12reader_schemastart(void* lpObj, const char* lpszSchemaId);
int schemaStart(const QString& qsSchemaId);
Remarks
Starts manually defining a schema, as an alternative to loading one from a file.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Validate Method (X12Reader Class)
Validate the EDI document and warn about any errors encountered.
Syntax
ANSI (Cross Platform) int Validate(); Unicode (Windows) INT Validate();
int edisdk_x12reader_validate(void* lpObj);
int validate();
Remarks
This method parses the input EDI document, firing the ValidateWarning event for any non-blocking errors it encounters.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
EndFunctionalGroup Event (X12Reader Class)
Fires at the end of a functional group while parsing.
Syntax
ANSI (Cross Platform) virtual int FireEndFunctionalGroup(X12ReaderEndFunctionalGroupEventParams *e);
typedef struct {
const char *Tag;
int TransactionCount;
const char *ControlNumber; int reserved; } X12ReaderEndFunctionalGroupEventParams;
Unicode (Windows) virtual INT FireEndFunctionalGroup(X12ReaderEndFunctionalGroupEventParams *e);
typedef struct {
LPCWSTR Tag;
INT TransactionCount;
LPCWSTR ControlNumber; INT reserved; } X12ReaderEndFunctionalGroupEventParams;
#define EID_X12READER_ENDFUNCTIONALGROUP 1 virtual INT EDISDK_CALL FireEndFunctionalGroup(LPSTR &lpszTag, INT &iTransactionCount, LPSTR &lpszControlNumber);
class X12ReaderEndFunctionalGroupEventParams {
public:
const QString &tag();
int transactionCount();
const QString &controlNumber();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireEndFunctionalGroup(X12ReaderEndFunctionalGroupEventParams *e) {...}
// Or, connect one or more slots to this signal.
void endFunctionalGroup(X12ReaderEndFunctionalGroupEventParams *e);
Remarks
This event fires when the class encounters the end of a functional group while parsing a document.
EndInterchange Event (X12Reader Class)
Fires at the end of a interchange while parsing.
Syntax
ANSI (Cross Platform) virtual int FireEndInterchange(X12ReaderEndInterchangeEventParams *e);
typedef struct {
const char *Tag;
int GroupCount;
const char *ControlNumber; int reserved; } X12ReaderEndInterchangeEventParams;
Unicode (Windows) virtual INT FireEndInterchange(X12ReaderEndInterchangeEventParams *e);
typedef struct {
LPCWSTR Tag;
INT GroupCount;
LPCWSTR ControlNumber; INT reserved; } X12ReaderEndInterchangeEventParams;
#define EID_X12READER_ENDINTERCHANGE 2 virtual INT EDISDK_CALL FireEndInterchange(LPSTR &lpszTag, INT &iGroupCount, LPSTR &lpszControlNumber);
class X12ReaderEndInterchangeEventParams {
public:
const QString &tag();
int groupCount();
const QString &controlNumber();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireEndInterchange(X12ReaderEndInterchangeEventParams *e) {...}
// Or, connect one or more slots to this signal.
void endInterchange(X12ReaderEndInterchangeEventParams *e);
Remarks
This event fires when the class encounters the end of a interchange while parsing a document.
EndLoop Event (X12Reader Class)
Fires at the end of a loop while parsing.
Syntax
ANSI (Cross Platform) virtual int FireEndLoop(X12ReaderEndLoopEventParams *e);
typedef struct {
const char *Name;
int Index; int reserved; } X12ReaderEndLoopEventParams;
Unicode (Windows) virtual INT FireEndLoop(X12ReaderEndLoopEventParams *e);
typedef struct {
LPCWSTR Name;
INT Index; INT reserved; } X12ReaderEndLoopEventParams;
#define EID_X12READER_ENDLOOP 3 virtual INT EDISDK_CALL FireEndLoop(LPSTR &lpszName, INT &iIndex);
class X12ReaderEndLoopEventParams {
public:
const QString &name();
int index();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireEndLoop(X12ReaderEndLoopEventParams *e) {...}
// Or, connect one or more slots to this signal.
void endLoop(X12ReaderEndLoopEventParams *e);
Remarks
This event fires when the class encounters the end of a loop while parsing a document.
EndTransactionSet Event (X12Reader Class)
Fires at the end of a transaction set while parsing.
Syntax
ANSI (Cross Platform) virtual int FireEndTransactionSet(X12ReaderEndTransactionSetEventParams *e);
typedef struct {
const char *Tag;
int SegmentCount;
const char *ControlNumber; int reserved; } X12ReaderEndTransactionSetEventParams;
Unicode (Windows) virtual INT FireEndTransactionSet(X12ReaderEndTransactionSetEventParams *e);
typedef struct {
LPCWSTR Tag;
INT SegmentCount;
LPCWSTR ControlNumber; INT reserved; } X12ReaderEndTransactionSetEventParams;
#define EID_X12READER_ENDTRANSACTIONSET 4 virtual INT EDISDK_CALL FireEndTransactionSet(LPSTR &lpszTag, INT &iSegmentCount, LPSTR &lpszControlNumber);
class X12ReaderEndTransactionSetEventParams {
public:
const QString &tag();
int segmentCount();
const QString &controlNumber();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireEndTransactionSet(X12ReaderEndTransactionSetEventParams *e) {...}
// Or, connect one or more slots to this signal.
void endTransactionSet(X12ReaderEndTransactionSetEventParams *e);
Remarks
This event fires when the class encounters the end of a transaction set while parsing a document.
Error Event (X12Reader Class)
Fires when a parsing error occurs.
Syntax
ANSI (Cross Platform) virtual int FireError(X12ReaderErrorEventParams *e);
typedef struct {
int ErrorCode;
const char *Description; int reserved; } X12ReaderErrorEventParams;
Unicode (Windows) virtual INT FireError(X12ReaderErrorEventParams *e);
typedef struct {
INT ErrorCode;
LPCWSTR Description; INT reserved; } X12ReaderErrorEventParams;
#define EID_X12READER_ERROR 5 virtual INT EDISDK_CALL FireError(INT &iErrorCode, LPSTR &lpszDescription);
class X12ReaderErrorEventParams {
public:
int errorCode();
const QString &description();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireError(X12ReaderErrorEventParams *e) {...}
// Or, connect one or more slots to this signal.
void error(X12ReaderErrorEventParams *e);
Remarks
This event fires when the class encounters a parsing error while processing a document.
ResolveSchema Event (X12Reader Class)
Fires to request schema information for a specific transaction set.
Syntax
ANSI (Cross Platform) virtual int FireResolveSchema(X12ReaderResolveSchemaEventParams *e);
typedef struct {
const char *VersionNumber;
const char *TransactionSetIDCode; int reserved; } X12ReaderResolveSchemaEventParams;
Unicode (Windows) virtual INT FireResolveSchema(X12ReaderResolveSchemaEventParams *e);
typedef struct {
LPCWSTR VersionNumber;
LPCWSTR TransactionSetIDCode; INT reserved; } X12ReaderResolveSchemaEventParams;
#define EID_X12READER_RESOLVESCHEMA 6 virtual INT EDISDK_CALL FireResolveSchema(LPSTR &lpszVersionNumber, LPSTR &lpszTransactionSetIDCode);
class X12ReaderResolveSchemaEventParams {
public:
const QString &versionNumber();
const QString &transactionSetIDCode();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireResolveSchema(X12ReaderResolveSchemaEventParams *e) {...}
// Or, connect one or more slots to this signal.
void resolveSchema(X12ReaderResolveSchemaEventParams *e);
Remarks
LoadSchema can be called from within this event to load the schema information for the specified transaction set.
Segment Event (X12Reader Class)
Fires at the end of a Segment while parsing.
Syntax
ANSI (Cross Platform) virtual int FireSegment(X12ReaderSegmentEventParams *e);
typedef struct {
const char *Tag;
const char *SchemaPath;
int Optional;
int ElementCount;
int SchemaIndex;
int SegmentIndex;
int MaxCount;
const char *Path; int reserved; } X12ReaderSegmentEventParams;
Unicode (Windows) virtual INT FireSegment(X12ReaderSegmentEventParams *e);
typedef struct {
LPCWSTR Tag;
LPCWSTR SchemaPath;
BOOL Optional;
INT ElementCount;
INT SchemaIndex;
INT SegmentIndex;
INT MaxCount;
LPCWSTR Path; INT reserved; } X12ReaderSegmentEventParams;
#define EID_X12READER_SEGMENT 7 virtual INT EDISDK_CALL FireSegment(LPSTR &lpszTag, LPSTR &lpszSchemaPath, BOOL &bOptional, INT &iElementCount, INT &iSchemaIndex, INT &iSegmentIndex, INT &iMaxCount, LPSTR &lpszPath);
class X12ReaderSegmentEventParams {
public:
const QString &tag();
const QString &schemaPath();
bool optional();
int elementCount();
int schemaIndex();
int segmentIndex();
int maxCount();
const QString &path();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireSegment(X12ReaderSegmentEventParams *e) {...}
// Or, connect one or more slots to this signal.
void segment(X12ReaderSegmentEventParams *e);
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 Class)
Fires at the beginning of a functional group while parsing.
Syntax
ANSI (Cross Platform) virtual int FireStartFunctionalGroup(X12ReaderStartFunctionalGroupEventParams *e);
typedef struct {
const char *Tag;
const char *AppSenderCode;
const char *AppReceiverCode;
const char *DateTime;
const char *ControlNumber; int reserved; } X12ReaderStartFunctionalGroupEventParams;
Unicode (Windows) virtual INT FireStartFunctionalGroup(X12ReaderStartFunctionalGroupEventParams *e);
typedef struct {
LPCWSTR Tag;
LPCWSTR AppSenderCode;
LPCWSTR AppReceiverCode;
LPCWSTR DateTime;
LPCWSTR ControlNumber; INT reserved; } X12ReaderStartFunctionalGroupEventParams;
#define EID_X12READER_STARTFUNCTIONALGROUP 8 virtual INT EDISDK_CALL FireStartFunctionalGroup(LPSTR &lpszTag, LPSTR &lpszAppSenderCode, LPSTR &lpszAppReceiverCode, LPSTR &lpszDateTime, LPSTR &lpszControlNumber);
class X12ReaderStartFunctionalGroupEventParams {
public:
const QString &tag();
const QString &appSenderCode();
const QString &appReceiverCode();
const QString &dateTime();
const QString &controlNumber();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireStartFunctionalGroup(X12ReaderStartFunctionalGroupEventParams *e) {...}
// Or, connect one or more slots to this signal.
void startFunctionalGroup(X12ReaderStartFunctionalGroupEventParams *e);
Remarks
This event fires when the class encounters the start of a functional group while parsing a document.
StartInterchange Event (X12Reader Class)
Fires at the beginning of an interchange while parsing.
Syntax
ANSI (Cross Platform) virtual int FireStartInterchange(X12ReaderStartInterchangeEventParams *e);
typedef struct {
const char *Tag;
const char *SenderID;
const char *ReceiverID;
const char *DateTime;
const char *ControlNumber; int reserved; } X12ReaderStartInterchangeEventParams;
Unicode (Windows) virtual INT FireStartInterchange(X12ReaderStartInterchangeEventParams *e);
typedef struct {
LPCWSTR Tag;
LPCWSTR SenderID;
LPCWSTR ReceiverID;
LPCWSTR DateTime;
LPCWSTR ControlNumber; INT reserved; } X12ReaderStartInterchangeEventParams;
#define EID_X12READER_STARTINTERCHANGE 9 virtual INT EDISDK_CALL FireStartInterchange(LPSTR &lpszTag, LPSTR &lpszSenderID, LPSTR &lpszReceiverID, LPSTR &lpszDateTime, LPSTR &lpszControlNumber);
class X12ReaderStartInterchangeEventParams {
public:
const QString &tag();
const QString &senderID();
const QString &receiverID();
const QString &dateTime();
const QString &controlNumber();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireStartInterchange(X12ReaderStartInterchangeEventParams *e) {...}
// Or, connect one or more slots to this signal.
void startInterchange(X12ReaderStartInterchangeEventParams *e);
Remarks
This event fires at the beginning of an interchange while parsing a document.
StartLoop Event (X12Reader Class)
Fires at the beginning of a loop while parsing a transaction set.
Syntax
ANSI (Cross Platform) virtual int FireStartLoop(X12ReaderStartLoopEventParams *e);
typedef struct {
const char *Name;
int Index;
int MaxCount;
const char *Path; int reserved; } X12ReaderStartLoopEventParams;
Unicode (Windows) virtual INT FireStartLoop(X12ReaderStartLoopEventParams *e);
typedef struct {
LPCWSTR Name;
INT Index;
INT MaxCount;
LPCWSTR Path; INT reserved; } X12ReaderStartLoopEventParams;
#define EID_X12READER_STARTLOOP 10 virtual INT EDISDK_CALL FireStartLoop(LPSTR &lpszName, INT &iIndex, INT &iMaxCount, LPSTR &lpszPath);
class X12ReaderStartLoopEventParams {
public:
const QString &name();
int index();
int maxCount();
const QString &path();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireStartLoop(X12ReaderStartLoopEventParams *e) {...}
// Or, connect one or more slots to this signal.
void startLoop(X12ReaderStartLoopEventParams *e);
Remarks
This event fires when the class encounters the start of a loop while parsing a transaction set.
StartTransactionSet Event (X12Reader Class)
Fires at the beginning of a transaction set while parsing.
Syntax
ANSI (Cross Platform) virtual int FireStartTransactionSet(X12ReaderStartTransactionSetEventParams *e);
typedef struct {
const char *Tag;
const char *VersionNumber;
const char *TransactionSetIDCode;
const char *ControlNumber;
int SchemaLoaded; int reserved; } X12ReaderStartTransactionSetEventParams;
Unicode (Windows) virtual INT FireStartTransactionSet(X12ReaderStartTransactionSetEventParams *e);
typedef struct {
LPCWSTR Tag;
LPCWSTR VersionNumber;
LPCWSTR TransactionSetIDCode;
LPCWSTR ControlNumber;
BOOL SchemaLoaded; INT reserved; } X12ReaderStartTransactionSetEventParams;
#define EID_X12READER_STARTTRANSACTIONSET 11 virtual INT EDISDK_CALL FireStartTransactionSet(LPSTR &lpszTag, LPSTR &lpszVersionNumber, LPSTR &lpszTransactionSetIDCode, LPSTR &lpszControlNumber, BOOL &bSchemaLoaded);
class X12ReaderStartTransactionSetEventParams {
public:
const QString &tag();
const QString &versionNumber();
const QString &transactionSetIDCode();
const QString &controlNumber();
bool schemaLoaded();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireStartTransactionSet(X12ReaderStartTransactionSetEventParams *e) {...}
// Or, connect one or more slots to this signal.
void startTransactionSet(X12ReaderStartTransactionSetEventParams *e);
Remarks
This event fires when the class encounters the start of a transaction set while parsing a document.
ValidateWarning Event (X12Reader Class)
Fires to warn about validation errors.
Syntax
ANSI (Cross Platform) virtual int FireValidateWarning(X12ReaderValidateWarningEventParams *e);
typedef struct {
int64 Position;
int Line;
int Column;
const char *ErrorCode;
const char *ErrorMessage;
int ErrorType; int reserved; } X12ReaderValidateWarningEventParams;
Unicode (Windows) virtual INT FireValidateWarning(X12ReaderValidateWarningEventParams *e);
typedef struct {
LONG64 Position;
INT Line;
INT Column;
LPCWSTR ErrorCode;
LPCWSTR ErrorMessage;
INT ErrorType; INT reserved; } X12ReaderValidateWarningEventParams;
#define EID_X12READER_VALIDATEWARNING 12 virtual INT EDISDK_CALL FireValidateWarning(LONG64 &lPosition, INT &iLine, INT &iColumn, LPSTR &lpszErrorCode, LPSTR &lpszErrorMessage, INT &iErrorType);
class X12ReaderValidateWarningEventParams {
public:
qint64 position();
int line();
int column();
const QString &errorCode();
const QString &errorMessage();
int errorType();
int eventRetVal();
void setEventRetVal(int iRetVal);
};
// To handle, subclass X12Reader and override this emitter function.
virtual int fireValidateWarning(X12ReaderValidateWarningEventParams *e) {...}
// Or, connect one or more slots to this signal.
void validateWarning(X12ReaderValidateWarningEventParams *e);
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.
Syntax
EDISDKEDIElement (declared in edisdk.h)
Remarks
This represents an element appearing in an EDI document.
Fields
DataType
char* (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
int (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
int (read-only)
Default Value: 0
For a simple element, this specifies the maximum length of the element according to the schema.
MinLen
int (read-only)
Default Value: 0
For a simple element, this specifies the minimum length of the element according to the schema.
SchemaDesc
char* (read-only)
Default Value: ""
The description of the element as specified in the schema.
SchemaName
char* (read-only)
Default Value: ""
The name of the element as specified in the schema.
Value
char* (read-only)
Default Value: ""
If the element is a simple element, this field contains its value.
Constructors
EDIElement()
EDISegment Type
A segment of an EDI document.
Syntax
EDISDKEDISegment (declared in edisdk.h)
Remarks
This represents a segment appearing in an EDI document.
Fields
Optional
int (read-only)
Default Value: FALSE
Specifies whether the segment is required or optional. If true, the element is optional.
Path
char* (read-only)
Default Value: ""
Contains the path to the segment, including the groups that the segment is contained in.
SchemaPath
char* (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
char* (read-only)
Default Value: ""
The tag of the segment, such as BGM, DTM, FTX, etc.
Constructors
EDISegment()
X12Delimiters Type
The delimiters used in the X12 document.
Syntax
EDISDKX12Delimiters (declared in edisdk.h)
Remarks
This type contains fields specifying the various delimiters used within the X12 document.
Fields
Component
char*
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
char*
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
char*
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
char*
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
X12Delimiters()
X12FunctionalGroup Type
A functional group of messages.
Syntax
EDISDKX12FunctionalGroup (declared in edisdk.h)
Remarks
This type represents a functional group of messages, with fields describing the values from the GS segment.
- AppReceiverCode
- AppSenderCode
- Date
- FunctionalIdentifierCode
- GroupControlNum
- ResponsibleAgencyCode
- Time
- Version
Fields
AppReceiverCode
char*
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
char*
Default Value: ""
Code identifying the sender of FunctionalGroup
This is an alphanumeric field with a value between 2 and 15 characters long.
Date
char*
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
char*
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
char*
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
char*
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
char*
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
char*
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
X12FunctionalGroup()
X12Interchange Type
An interchange containing functional groups and transaction sets.
Syntax
EDISDKX12Interchange (declared in edisdk.h)
Remarks
This type represents an X12 interchange, with fields describing the values from the ISA segment.
- AckRequest
- AuthorizationInfo
- AuthorizationInfoQualifier
- Date
- InterchangeControlNum
- InterchangeControlVersionNum
- ReceiverID
- ReceiverIDQualifier
- SecurityInfo
- SecurityInfoQualifier
- SenderID
- SenderIDQualifier
- Time
- UsageIndicator
Fields
AckRequest
char*
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
char*
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
char*
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
char*
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
char*
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
char*
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
char*
Default Value: ""
The identification code of the receiver of the transaction set.
This is an alphanumeric field with a value of 15 characters.
ReceiverIDQualifier
char*
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
char*
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
char*
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
char*
Default Value: ""
The identification code of the sender of the transaction set.
This is an alphanumeric field with a value of 15 characters.
SenderIDQualifier
char*
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
char*
Default Value: ""
The time that the Interchange sets was prepared.
This is a numeric field with a value in the format HHMM.
UsageIndicator
char*
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
X12Interchange()
X12TransactionSet Type
An X12 transaction set.
Syntax
EDISDKX12TransactionSet (declared in edisdk.h)
Remarks
This type represents an X12 transaction set, with fields describing the values from the ST segment.
Fields
ImpConventionReference
char*
Default Value: ""
Reference used to identify the implementation convention.
This is an alphanumeric field with a value up to 35 characters long.
TransactionSetControlNum
char*
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
char*
Default Value: ""
The identifier code for the transaction set.
This is an alphanumeric field with a code value of 3 characters long.
Constructors
X12TransactionSet()
X12ValidationErrorDetail Type
Contains the details of a validation error.
Syntax
EDISDKX12ValidationErrorDetail (declared in edisdk.h)
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.
- Column
- ComponentIndex
- ElementIndex
- ErrorCode
- ErrorMessage
- ErrorType
- FGroupIndex
- InterchangeIndex
- Line
- Position
- SegmentIndex
- SegmentTag
- TransactionSetIndex
Fields
Column
int (read-only)
Default Value: 0
The column number where the error occurred.
ComponentIndex
int (read-only)
Default Value: 1
This field holds the position of the component element where the error occurred.
ElementIndex
int (read-only)
Default Value: 1
This field holds the position of the element where the error occurred.
ErrorCode
char* (read-only)
Default Value: "0"
The ErrorCode field contains the type of error encountered.
ErrorMessage
char* (read-only)
Default Value: ""
ErrorMessage is a textual description of the error.
ErrorType
int (read-only)
Default Value: 0
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 |
FGroupIndex
int (read-only)
Default Value: 1
This field holds the position of the functional group where the error occurred.
InterchangeIndex
int (read-only)
Default Value: 1
This field holds the position of the interchange where the error occurred.
Line
int (read-only)
Default Value: 0
The line number where the error occurred.
Position
int64 (read-only)
Default Value: 0
This field holds the byte position in the EDI stream where the error occurred.
SegmentIndex
int (read-only)
Default Value: 1
This field is the index of the segment where the error occurred.
SegmentTag
char* (read-only)
Default Value: ""
This field specifies the tag name of the segment where the error occurred.
TransactionSetIndex
int (read-only)
Default Value: 1
This field holds the position of the message where the error occurred.
EDISDKList Type
Syntax
EDISDKList<T> (declared in edisdk.h)
Remarks
EDISDKList is a generic class that is used to hold a collection of objects of type T, where T is one of the custom types supported by the X12Reader class.
Methods | |
| GetCount |
This method returns the current size of the collection.
int GetCount() {}
|
| SetCount |
This method sets the size of the collection. This method returns 0 if setting the size was successful; or -1 if the collection is ReadOnly. When adding additional objects to a collection call this method to specify the new size. Increasing the size of the collection preserves existing objects in the collection.
int SetCount(int count) {}
|
| Get |
This method gets the item at the specified position. The index parameter specifies the index of the item in the collection. This method returns NULL if an invalid index is specified.
T* Get(int index) {}
|
| Set |
This method sets the item at the specified position. The index parameter specifies the index of the item in the collection that is being set. This method returns -1 if an invalid index is specified. Note: Objects created using the new operator must be freed using the delete operator; they will not be automatically freed by the class.
T* Set(int index, T* value) {}
|
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)
Error Handling (C++)
Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
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. |