Warning Event

Fires whenever a validation warning is encountered.

Syntax

class X12ReaderWarningEventParams {
public:
  int WarnCode();
  const QString &Message();
  int SegmentNumber();
  const QString &SegmentTag();
  const QString &TechnicalErrorCode();
  const QString &SegmentErrorCode();
  const QString &ElementErrorCode();
  int ElementPosition();
  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Warning(X12ReaderWarningEventParams *e);
// Or, subclass X12Reader and override this emitter function. virtual int FireWarning(X12ReaderWarningEventParams *e) {...}

Remarks

The Warning event will fire during parsing of a segment of an EDI document. The WarnCode parameter contains the type of warning encountered. Message is a textual description of the problem. SegmentNumber is the index of the segment where the problem was found.

SegmentTag holds the tag name of the segment. SegmentErrorCode holds the error code that may be used in the IK304 field of a 999. ElementErrorCode holds the error code that may be used in the IK403 field of a 999. ElementPosition is the position of the element where the error occurred.

It's very important to note that segment validation happens right in the middle of the parsing process. Because of this, the Warning event will usually fire long before the validated segment becomes the current segment for the parser state. This means you cannot access the parser properties to examine the current segment in relation with the Warning event when the event fires.

Possible WarnCode values are:

0 The component is not required but is present.
1 Invalid segment count.
2 Invalid transaction count.
3 Invalid group count.
4 Invalid interchange control number.
5 Invalid group control number.
6 Invalid transaction control number.
10 A required data element is missing.
11 Invalid field length.
12 Invalid field value.
13 A required component is missing.
14 The data element is not defined but is present.
30 Required segment is missing.
31 Required loop is missing.
32 Occurrences exceeds the schema defined limit.
33 Occurrences is less than the schema defined minimum.
40 Paired rule validation failed, the pair of elements must be present.
41 At least one of element is required, see message for list of elements.
42 Exclusion validation failed, only one of the elements can be present.
43 Conditional rule validation failed.
44 List conditional rule validation failed.
45 First, then non validation failed.
46 Only one or none of the elements can be present.

TechnicalErrorCode holds a technical error code that helps identify structural issues with the document. For instance when parsing an X12 document this will hold values that may be used for TA1 error codes. When parsing X12 documents the following codes are applicable:

001The Interchange Control Numbers in the header ISA 13 and trailer IEA02 do not match.
022The ISA segment is missing elements (invalid control structure).
014Invalid interchange date value (non-numeric characters or wrong length).
015Invalid interchange time value (non-numeric characters or wrong length).

 
 
Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks X12 2020 Qt Edition - Version 20.0 [Build 7721]