<?xml version="1.0"?>
<!-- 
######################################################################
# Copyright (c) 2001-2005 Kalamazoo Community Mental Health Services,
#   John Holland <jholland@kazoocmh.org> <john@zoner.org>
# All rights reserved.
#
# This software is licensed as described in the file LICENSE.txt, which
# you should have received as part of this distribution.
#
######################################################################

#    $Id: x12.control.00401.xml,v 1.11 2005/05/26 21:05:28 johnholland Exp $
-->
<map>
  <subcommittee>X12N</subcommittee>
  <version>00401</version>
  <loop xid="ISA_LOOP" type="explicit">
    <name>Interchange Control Header</name>
    <usage>R</usage>
    <pos>001</pos>
    <repeat>&gt;1</repeat>
    <segment xid="ISA">
      <name>Interchange Control Header</name>
      <end_tag>IEA</end_tag>
      <usage>R</usage>
      <pos>010</pos>
      <element xid="ISA01">
        <data_ele>I01</data_ele>
        <name>Authorization Information Qualifier</name>
        <usage>R</usage>
        <seq>01</seq>
        <data_type>ID</data_type>
        <min_len>2</min_len>
        <max_len>2</max_len>
        <valid_codes>
          <code>00</code>
          <code>03</code>
        </valid_codes>
      </element>
      <element xid="ISA02">
        <data_ele>I02</data_ele>
        <name>Authorization Information</name>
        <usage>R</usage>
        <seq>02</seq>
        <data_type>AN</data_type>
        <min_len>10</min_len>
        <max_len>10</max_len>
      </element>
      <element xid="ISA03">
        <data_ele>I03</data_ele>
        <name>Security Information Qualifier</name>
        <usage>R</usage>
        <seq>03</seq>
        <data_type>ID</data_type>
        <min_len>2</min_len>
        <max_len>2</max_len>
        <valid_codes>
          <code>00</code>
          <code>01</code>
        </valid_codes>
      </element>
      <element xid="ISA04">
        <data_ele>I04</data_ele>
        <name>Security Information</name>
        <usage>R</usage>
        <seq>04</seq>
        <data_type>AN</data_type>
        <min_len>10</min_len>
        <max_len>10</max_len>
      </element>
      <element xid="ISA05">
        <data_ele>I05</data_ele>
        <name>Interchange ID Qualifier</name>
        <usage>R</usage>
        <seq>05</seq>
        <data_type>ID</data_type>
        <min_len>2</min_len>
        <max_len>2</max_len>
        <valid_codes>
          <code>01</code>
          <code>14</code>
          <code>20</code>
          <code>27</code>
          <code>28</code>
          <code>29</code>
          <code>30</code>
          <code>33</code>
          <code>ZZ</code>
        </valid_codes>
      </element>
      <element xid="ISA06">
        <data_ele>I06</data_ele>
        <name>Interchange Sender ID</name>
        <usage>R</usage>
        <seq>06</seq>
        <data_type>AN</data_type>
        <min_len>15</min_len>
        <max_len>15</max_len>
      </element>
      <element xid="ISA07">
        <data_ele>I05</data_ele>
        <name>Interchange ID Qualifier</name>
        <usage>R</usage>
        <seq>07</seq>
        <data_type>ID</data_type>
        <min_len>2</min_len>
        <max_len>2</max_len>
        <valid_codes>
          <code>01</code>
          <code>14</code>
          <code>20</code>
          <code>27</code>
          <code>28</code>
          <code>29</code>
          <code>30</code>
          <code>33</code>
          <code>ZZ</code>
        </valid_codes>
      </element>
      <element xid="ISA08">
        <data_ele>I07</data_ele>
        <name>Interchange Receiver ID</name>
        <usage>R</usage>
        <seq>08</seq>
        <data_type>AN</data_type>
        <min_len>15</min_len>
        <max_len>15</max_len>
      </element>
      <element xid="ISA09">
        <data_ele>I08</data_ele>
        <name>Interchange Date</name>
        <usage>R</usage>
        <seq>09</seq>
        <data_type>DT</data_type>
        <min_len>6</min_len>
        <max_len>6</max_len>
        <format>D6</format>
      </element>
      <element xid="ISA10">
        <data_ele>I09</data_ele>
        <name>Interchange Time</name>
        <usage>R</usage>
        <seq>10</seq>
        <data_type>TM</data_type>
        <min_len>4</min_len>
        <max_len>4</max_len>
        <format>TM</format>
      </element>
      <element xid="ISA11">
        <data_ele>I10</data_ele>
        <name>Interchange Control Standards Identifier</name>
        <usage>R</usage>
        <seq>11</seq>
        <data_type>ID</data_type>
        <min_len>1</min_len>
        <max_len>1</max_len>
        <valid_codes>
          <code>U</code>
        </valid_codes>
      </element>
      <element xid="ISA12">
        <data_ele>I11</data_ele>
        <name>Interchange Control Version Number</name>
        <usage>R</usage>
        <seq>12</seq>
        <data_type>ID</data_type>
        <min_len>5</min_len>
        <max_len>5</max_len>
        <valid_codes>
          <code>00401</code>
        </valid_codes>
      </element>
      <element xid="ISA13">
        <data_ele>I12</data_ele>
        <name>Interchange Control Number</name>
        <usage>R</usage>
        <seq>13</seq>
        <data_type>N0</data_type>
        <min_len>9</min_len>
        <max_len>9</max_len>
      </element>
      <element xid="ISA14">
        <data_ele>I13</data_ele>
        <name>Acknowledgment Requested</name>
        <usage>R</usage>
        <seq>14</seq>
        <data_type>ID</data_type>
        <min_len>1</min_len>
        <max_len>1</max_len>
        <valid_codes>
          <code>0</code>
          <code>1</code>
        </valid_codes>
      </element>
      <element xid="ISA15">
        <data_ele>I14</data_ele>
        <name>Usage Indicator</name>
        <usage>R</usage>
        <seq>15</seq>
        <data_type>ID</data_type>
        <min_len>1</min_len>
        <max_len>1</max_len>
        <valid_codes>
          <code>P</code>
          <code>T</code>
        </valid_codes>
      </element>
      <element xid="ISA16">
        <data_ele>I15</data_ele>
        <name>Component Element Separator</name>
        <usage>R</usage>
        <seq>16</seq>
        <data_type>AN</data_type>
        <min_len>1</min_len>
        <max_len>1</max_len>
      </element>
    </segment>
<!--End of ISA segment-->
    <loop xid="GS_LOOP" type="explicit">
      <name>Functional Group Header</name>
      <usage>R</usage>
      <pos>020</pos>
      <repeat>&gt;1</repeat>
      <segment xid="GS">
        <name>Functional Group Header</name>
        <end_tag>GE</end_tag>
        <usage>R</usage>
        <pos>010</pos>
        <element xid="GS01">
          <data_ele>479</data_ele>
          <name>Functional Identifier Code</name>
          <usage>R</usage>
          <seq>01</seq>
          <data_type>ID</data_type>
          <min_len>2</min_len>
          <max_len>2</max_len>
          <valid_codes>
            <code>HN</code>
            <code>HR</code>
            <code>HS</code>
            <code>HB</code>
            <code>HI</code>
            <code>RA</code>
            <code>BE</code>
            <code>HP</code>
            <code>HC</code>
            <code>FA</code>
          </valid_codes>
        </element>
        <element xid="GS02">
          <data_ele>142</data_ele>
          <name>Application Sender's Code</name>
          <usage>R</usage>
          <seq>02</seq>
          <data_type>AN</data_type>
          <min_len>2</min_len>
          <max_len>15</max_len>
        </element>
        <element xid="GS03">
          <data_ele>124</data_ele>
          <name>Application Receiver's Code</name>
          <usage>R</usage>
          <seq>03</seq>
          <data_type>AN</data_type>
          <min_len>2</min_len>
          <max_len>15</max_len>
        </element>
        <element xid="GS04">
          <data_ele>373</data_ele>
          <name>Date</name>
          <usage>R</usage>
          <seq>04</seq>
          <data_type>DT</data_type>
          <min_len>8</min_len>
          <max_len>8</max_len>
          <format>D8</format>
        </element>
        <element xid="GS05">
          <data_ele>337</data_ele>
          <name>Time</name>
          <usage>R</usage>
          <seq>05</seq>
          <data_type>TM</data_type>
          <min_len>4</min_len>
          <max_len>8</max_len>
        </element>
        <element xid="GS06">
          <data_ele>28</data_ele>
          <name>Group Control Number</name>
          <usage>R</usage>
          <seq>06</seq>
          <data_type>N0</data_type>
          <min_len>1</min_len>
          <max_len>9</max_len>
        </element>
        <element xid="GS07">
          <data_ele>455</data_ele>
          <name>Responsible Agency Code</name>
          <usage>R</usage>
          <seq>07</seq>
          <data_type>ID</data_type>
          <min_len>1</min_len>
          <max_len>2</max_len>
          <valid_codes>
            <code>X</code>
          </valid_codes>
        </element>
        <element xid="GS08">
          <data_ele>480</data_ele>
          <name>Version / Release / Industry Identifier Code</name>
          <usage>R</usage>
          <seq>08</seq>
          <data_type>AN</data_type>
          <min_len>1</min_len>
          <max_len>12</max_len>
          <valid_codes>
            <code>004010</code>
            <code>004010X070</code>
            <code>004010X093</code>
            <code>004010X092</code>
            <code>004010X094</code>
            <code>004010X061</code>
            <code>004010X095</code>
            <code>004010X091</code>
            <code>004010X096</code>
            <code>004010X097</code>
            <code>004010X098</code>
            <code>004010X093A1</code>
            <code>004010X092A1</code>
            <code>004010X094A1</code>
            <code>004010X061A1</code>
            <code>004010X095A1</code>
            <code>004010X091A1</code>
            <code>004010X096A1</code>
            <code>004010X097A1</code>
            <code>004010X098A1</code>
          </valid_codes>
        </element>
      </segment>
<!--End of GS segment-->
      <segment xid="GE">
        <name>Functional Group Trailer</name>
        <usage>R</usage>
        <pos>030</pos>
        <element xid="GE01">
          <data_ele>97</data_ele>
          <name>Number of Transaction Sets Included</name>
          <usage>R</usage>
          <seq>01</seq>
          <data_type>N0</data_type>
          <min_len>1</min_len>
          <max_len>6</max_len>
        </element>
        <element xid="GE02">
          <data_ele>28</data_ele>
          <name>Group Control Number</name>
          <usage>R</usage>
          <seq>02</seq>
          <data_type>N0</data_type>
          <min_len>1</min_len>
          <max_len>9</max_len>
        </element>
      </segment>
<!--End of GE segment-->
    </loop>
<!--End of GS loop-->
    <segment xid="TA1">
      <name>Interchange Achnowledgement</name>
      <usage>S</usage>
      <pos>020</pos>
      <element xid="TA101">
        <data_ele>I12</data_ele>
        <name>Interchange Control Number</name>
        <usage>R</usage>
        <seq>01</seq>
        <data_type>N0</data_type>
        <min_len>9</min_len>
        <max_len>9</max_len>
      </element>
      <element xid="TA102">
        <data_ele>I08</data_ele>
        <name>Interchange Date</name>
        <usage>R</usage>
        <seq>02</seq>
        <data_type>DT</data_type>
        <min_len>6</min_len>
        <max_len>6</max_len>
      </element>
      <element xid="TA103">
        <data_ele>I09</data_ele>
        <name>Interchange Time</name>
        <usage>R</usage>
        <seq>03</seq>
        <data_type>TM</data_type>
        <min_len>4</min_len>
        <max_len>4</max_len>
      </element>
      <element xid="TA104">
        <data_ele>I17</data_ele>
        <name>Interchange Achnowledgement Code</name>
        <usage>R</usage>
        <seq>04</seq>
        <data_type>ID</data_type>
        <min_len>1</min_len>
        <max_len>1</max_len>
        <valid_codes>
          <code>A</code>
          <code>E</code>
          <code>R</code>
        </valid_codes>
      </element>
      <element xid="TA105">
        <data_ele>I18</data_ele>
        <name>Interchange Note Code</name>
        <usage>R</usage>
        <seq>05</seq>
        <data_type>ID</data_type>
        <min_len>3</min_len>
        <max_len>3</max_len>
        <valid_codes>
          <code>000</code>
          <code>001</code>
          <code>002</code>
          <code>003</code>
          <code>004</code>
          <code>005</code>
          <code>006</code>
          <code>007</code>
          <code>008</code>
          <code>009</code>
          <code>010</code>
          <code>011</code>
          <code>012</code>
          <code>013</code>
          <code>014</code>
          <code>015</code>
          <code>016</code>
          <code>017</code>
          <code>018</code>
          <code>019</code>
          <code>020</code>
          <code>021</code>
          <code>022</code>
          <code>023</code>
          <code>024</code>
          <code>025</code>
          <code>026</code>
          <code>027</code>
          <code>028</code>
          <code>029</code>
          <code>030</code>
          <code>031</code>
        </valid_codes>
      </element>
    </segment>
<!--End of TA1 segment-->
    <segment xid="IEA">
      <name>Interchange Control Trailer</name>
      <usage>R</usage>
      <pos>030</pos>
      <element xid="IEA01">
        <data_ele>I16</data_ele>
        <name>Number of Included Functional Groups</name>
        <usage>R</usage>
        <seq>01</seq>
        <data_type>N0</data_type>
        <min_len>1</min_len>
        <max_len>5</max_len>
      </element>
      <element xid="IEA02">
        <data_ele>I12</data_ele>
        <name>Interchange Control Number</name>
        <usage>R</usage>
        <seq>02</seq>
        <data_type>N0</data_type>
        <min_len>9</min_len>
        <max_len>9</max_len>
      </element>
    </segment>
<!--End of IEA segment-->
  </loop>
<!--End of ISA loop-->
</map>
