/* This file is part of the X12Parser library that provides tools to manipulate X12 messages using Ruby native syntax. http://x12parser.rubyforge.org Copyright (C) 2008 APP Design, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $Id: 997.d12 59 2009-03-19 22:32:13Z ikk $ */ /* Code indicating the relative position of a simple data element, or the relative position of a composite data structure combined with the relative position of the component data element within the composite data structure, in error; the count starts with 1 for the simple data element or composite data structure immediately following the segment ID */ composite C030 { ElementPositionInSegment I R 1-2 /* This is used to indicate the relative position of a simple data element, or the relative position of a composite data structure with the relative position of the component within the composite data structure, in error; in the data segment the count starts with 1 for the simple data element or composite data structure immediately following the segment ID */ ComponentDataElementPositionInComposite I O 1-2 /* To identify the component data element position within the composite that is in error */ } # C030 /* To start acknowledgment of a functional group */ segment AK1 { FunctionalIdentifierCode S R 2-2 Tbl479 /* Code identifying a group of application related transaction sets */ GroupControlNumber I R 1-9 /* Assigned number originated and maintained by the sender */ } # AK1 /* To start acknowledgment of a single transaction set */ segment AK2 { TransactionSetIdentifierCode S R 3-3 Tbl143 /* Code uniquely identifying a Transaction Set */ TransactionSetControlNumber S R 4-9 /* Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set */ } # AK2 /* To report errors in a data segment and identify the location of the data segment */ segment AK3 { SegmentIdCode S R 2-3 /* Code defining the segment ID of the data segment in error (See Appendix A - Number 77) */ SegmentPositionInTransactionSet I R 1-6 /* The numerical count position of this data segment from the start of the transaction set: the transaction set header is count position 1 */ LoopIdentifierCode S O 1-6 /* The loop ID number given on the transaction set diagram is the value for this data element in segments LS and LE */ SegmentSyntaxErrorCode S O 1-3 Tbl720 /* Code indicating error found based on the syntax editing of a segment */ } # AK3 /* To report errors in a data element or composite data structure and identify the location of the data element */ segment AK4 { PositionInSegment C030 R 0-0 /* Code indicating the relative position of a simple data element, or the relative position of a composite data structure combined with the relative position of the component data element within the composite data structure, in error; the count starts with 1 for the simple data element or composite data structure immediately following the segment ID */ DataElementReferenceNumber I O 1-4 /* Reference number used to locate the data element in the Data Element Dictionary */ DataElementSyntaxErrorCode S R 1-3 Tbl723 /* Code indicating the error found after syntax edits of a data element */ CopyOfBadDataElement S O 1-99 /* This is a copy of the data element in error */ } # AK4 /* To acknowledge acceptance or rejection and report errors in a transaction set */ segment AK5 { TransactionSetAcknowledgmentCode S R 1-1 Tbl717 /* Code indicating accept or reject condition based on the syntax editing of the transaction set */ TransactionSetSyntaxErrorCode1 S O 1-3 Tbl718 /* Code indicating error found based on the syntax editing of a transaction set */ TransactionSetSyntaxErrorCode2 S O 1-3 Tbl718 /* Code indicating error found based on the syntax editing of a transaction set */ TransactionSetSyntaxErrorCode3 S O 1-3 Tbl718 /* Code indicating error found based on the syntax editing of a transaction set */ TransactionSetSyntaxErrorCode4 S O 1-3 Tbl718 /* Code indicating error found based on the syntax editing of a transaction set */ TransactionSetSyntaxErrorCode5 S O 1-3 Tbl718 /* Code indicating error found based on the syntax editing of a transaction set */ } # AK5 /* To acknowledge acceptance or rejection of a functional group and report the number of included transaction sets from the original trailer, the accepted sets, and the received sets in this functional group */ segment AK9 { FunctionalGroupAcknowledgeCode S R 1-1 Tbl715 /* Code indicating accept or reject condition based on the syntax editing of the functional group */ NumberOfTransactionSetsIncluded I R 1-6 /* Total number of transaction sets included in the functional group or interchange (transmission) group terminated by the trailer containing this data element */ NumberOfReceivedTransactionSets I R 1-6 /* Number of Transaction Sets received */ NumberOfAcceptedTransactionSets I R 1-6 /* Number of accepted Transaction Sets in a Functional Group */ FunctionalGroupSyntaxErrorCode1 S O 1-3 Tbl716 /* Code indicating error found based on the syntax editing of the functional group header and/or trailer */ FunctionalGroupSyntaxErrorCode2 S O 1-3 Tbl716 /* Code indicating error found based on the syntax editing of the functional group header and/or trailer */ FunctionalGroupSyntaxErrorCode3 S O 1-3 Tbl716 /* Code indicating error found based on the syntax editing of the functional group header and/or trailer */ FunctionalGroupSyntaxErrorCode4 S O 1-3 Tbl716 /* Code indicating error found based on the syntax editing of the functional group header and/or trailer */ FunctionalGroupSyntaxErrorCode5 S O 1-3 Tbl716 /* Code indicating error found based on the syntax editing of the functional group header and/or trailer */ } # AK9 /* This Draft Standard for Trial Use contains the format and establishes the data contents of the Functional Acknowledgment Transaction Set (997) for use within the context of an Electronic Data Interchange (EDI) environment. The transaction set can be used to define the control structures for a set of acknowledgments to indicate the results of the syntactical analysis of the electronically encoded documents. The encoded documents are the transaction sets, which are grouped in functional groups, used in defining transactions for business data interchange. This standard does not cover the semantic meaning of the information encoded in the transaction sets. */ loop 997 1:1 { segment ST 1:1 { TransactionSetIdentifierCode "997" R 3-3 /* Code uniquely identifying a Transaction Set */ TransactionSetControlNumber S R 4-9 /* Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set */ } # ST segment AK1 1:1 loop L1000 0:999999 { segment AK2 0:1 loop L1010 0:999999 { segment AK3 0:1 segment AK4 0:99 } # L1010 segment AK5 1:1 } # L1000 segment AK9 1:1 segment SE 1:1 } # 997