EDI Analysis Report
The EDI analysis report is an XML document that is generated automatically by the Analyze method. It contains complete information about the transmission, including information about
The remainder of this section describes the structure of the analysis report and provides details about the format and content of each section in the report. It is organized as follows:
Document Root
The document root of the EDI analysis report is called AnalyzeReport. It has a single attribute that indicates the EDI dialect of the input document. For example:
The AnalyzeRoot element contains two subelements – the Interchanges element and the Response element.
Interchanges Element
An interchange is an envelope for a set of EDI messages. The AnalyzeReport element contains a sequence of Interchange elements in which errors have been found. Interchange elements are grouped by a single Interchanges element. For example:
<Interchanges> <Interchange sequence="1" implicit="false" firstSegment="1" lastSegment="11" errors="false" warnings="true">Each Interchange element defines the following attributes:
- sequence – the ordinal position in the input document
- implicit – indicates if the interchange was missing, and, therefore, inferred
- firstSegment, lastSegment – the segment range for this interchange
- errors – whether or not errors were found in the interchange
- warnings – whether or not warnings were found in the interchange
Note that both errors and warnings are recorded using the Error element; a severity attribute indicates the type of error – W for warning, E for error. See Errors for more information about the Error element.
Segments
Each Interchange element contains a Segments element, which includes header and trailer Segment elements, as well as a Segment element for any segment containing errors.
Each Segment element defines the following attributes:
SegmentData
Each Segment element contains a SegmentData subelement. The specific contents of the SegmentData subelement varies based on the dialect of the EDI source being converted to XML. For an X12 EDI document, for example, the SegmentData sublement would contain an ISA element, with ISA01, ISA02, subelements, as shown here:
<SegmentData> <IEA> <IEA01><!--I16: Number of Included Functional-->1</IEA01> <IEA02><!--I12: Interchange Control Number-->32123</IEA02> </IEA> </SegmentData>Errors
Each Segment element can also contain an Errors subelement. The Errors subelement contains one or more Error subelements. For example:
<Errors> <Error severity="E"> <ErrorCode>DDEE0008</ErrorCode> <NativeErrorCode>7</NativeErrorCode> <NativeErrorTable>723</NativeErrorTable> <SegmentName>BGN</SegmentName> <SegmentNumber>4</SegmentNumber> <Value>99</Value> <InvalidCharacter/> <Element>1</Element> <Repeat>1</Repeat> <SubElement/> <TriElement/> <Offset>4</Offset> <ElementName>353 (s)</ElementName> <Dialect>X12</Dialect> <SyntaxVersion>00403</SyntaxVersion> <MessageVersion>00403</MessageVersion> <CodeListVersion>004030</CodeListVersion> <SystemVersion/> <HeaderVersion/> <ControllingAgency>004030</ControllingAgency> <ErrorText>[DDEE0008] ERROR Value 99 not in codelist 353. Dialect: X12 Version: syntax=00403/004030;codelist=004030/;message= 00403/004030;agency=004030 Message: 831 Segment: BGN (segment 4) Position: BGN01 Element: 353 (s) Transaction Set Purpose Code Value: "99" Native error: 7, in table: 723 The value for an element in the data stream cannot be found in the codelist associated with the element. Turning off codelist validation with "tbl=no" will eliminate the error.</ErrorText> </Error> </Errors>The Error element defines a single attribute:
Each Error element can contain the following subelements. Note that if the element is empty, it is omitted from the report.
- ErrorCode – the vendor code
- NativeErrorCode – internal use only
- NativeErrorTable – internal use only
- SegmentName – the name of the segment in which the error occurred
- SegmentNumber – the absolute ordinal position of the segment relative to the entire EDI transmission
- Value – the field value that triggered the error
- InvalidCharacter – the invalid character that triggered the error
- Element – the absolute ordinal position of the message element where the error occurred
- Repeat – the iteration number in a loop where the error occurred
- Subelement – the particle where the error occurred; appears for HL7 conversions only
- TriElement – the particle where the error occurred; appears for HL7 conversions only
- Offset – the offset in characters from the start of the segment
- ElementName – the name of the message element where the error occurred
- Dialect – the EDI dialect name
- SyntaxVersion – the EDI syntax version
- MessageVersion – the EDI message version
- CodeListVersion – the EDI codelist version
- SystemVersion – the EDI system version
- HeaderVersion – the EDI message header version
- ControllingAgency – the agency controlling the EDI specification
- ErrorText – the complete error message
Groups
Each Interchange element also contains a Groups subelement, itself containing one or more Group elements. Each Group element defines the following attributes:
- sequence – the ordinal position within the interchange
- implicit – indicates there was no group start segment, and, therefore, it was inferred
- firstSegment, lastSegment – the segment range for this group
- errors – whether or not errors were found in the group
- warnings – whether or not warnings were found in the group
Segments
Each Group element contains a Segments element. See Segments for a description.
Messages
Each Group element contains a Messages element, itself containing one or more Message elements. Each Message element defines the following attributes:
- sequence – the ordinal position in the input document
- implicit – indicates if the message was missing, and, therefore, inferred
- firstSegment, lastSegment – the segment range for this message
- errors – whether or not errors were found in the message
- warnings – whether or not warnings were found in the message
Response Element
For EDI dialects for which transmission responses are supported (ATIS, EDIFACT, HIPAA, and X12), the Analyze method generates a Response element in the EDI analysis report. The Response element contains Receipt and Acknowledgement subelements :
The Receipt and Acknowledgement elements each contain a complete EDI message in XML format:
- Receipt element messages indicate only that the transmission from the EDI sender was received; they contain no information about the content of the transmission.
- Acknowledgement element messages contain information for each interchange, group, and message that was received, including whether it was accepted without errors, rejected, or partially accepted.
Receipt and Acknowledgement elements can be easily manipulated using .NET and then serialized to EDI for consumption by the EDI sender.
For EDI dialects for which transmission responses are not supported, the analysis report contains an empty Response element.
See Managing Transmission Responses for more information on this topic.