View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "AUI.java".  Description:
15   * "Composite class AUI"
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2013.  All Rights Reserved.
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  package ca.uhn.hl7v2.model.v27.datatype;
34  
35  import ca.uhn.hl7v2.model.DataTypeException;
36  import ca.uhn.hl7v2.model.Message;
37  import ca.uhn.hl7v2.model.Type;
38  import ca.uhn.hl7v2.model.AbstractComposite;
39  
40  
41  /**
42   * <p>Represents an HL7 AUI (Authorization Information) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>Authorization Number (ST)
46   * <li>Date (DT)
47   * <li>Source (ST)
48   * </ul>
49   */
50  @SuppressWarnings("unused")
51  public class AUI extends AbstractComposite {
52  
53      private Type[] data;
54  
55      /** 
56       * Creates a new AUI type
57       */
58      public AUI(Message message) {
59          super(message);
60          init();
61      }
62  
63      private void init() {
64          data = new Type[3];    
65          data[0] = new ST(getMessage());
66          data[1] = new DT(getMessage());
67          data[2] = new ST(getMessage());
68      }
69  
70  
71      /**
72       * Returns an array containing the data elements.
73       */
74      public Type[] getComponents() { 
75          return this.data; 
76      }
77  
78      /**
79       * Returns an individual data component.
80       *
81       * @param number The component number (0-indexed)
82       * @throws DataTypeException if the given element number is out of range.
83       */
84      public Type getComponent(int number) throws DataTypeException { 
85  
86          try { 
87              return this.data[number]; 
88          } catch (ArrayIndexOutOfBoundsException e) { 
89              throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
90          } 
91      } 
92  
93  
94      /**
95       * Returns Authorization Number (component 1).  This is a convenience method that saves you from 
96       * casting and handling an exception.
97       */
98      public ST getAuthorizationNumber() {
99         return getTyped(0, ST.class);
100     }
101 
102     
103     /**
104      * Returns Authorization Number (component 1).  This is a convenience method that saves you from 
105      * casting and handling an exception.
106      */
107     public ST getAui1_AuthorizationNumber() {
108        return getTyped(0, ST.class);
109     }
110 
111 
112     /**
113      * Returns Date (component 2).  This is a convenience method that saves you from 
114      * casting and handling an exception.
115      */
116     public DT getDate() {
117        return getTyped(1, DT.class);
118     }
119 
120     
121     /**
122      * Returns Date (component 2).  This is a convenience method that saves you from 
123      * casting and handling an exception.
124      */
125     public DT getAui2_Date() {
126        return getTyped(1, DT.class);
127     }
128 
129 
130     /**
131      * Returns Source (component 3).  This is a convenience method that saves you from 
132      * casting and handling an exception.
133      */
134     public ST getSource() {
135        return getTyped(2, ST.class);
136     }
137 
138     
139     /**
140      * Returns Source (component 3).  This is a convenience method that saves you from 
141      * casting and handling an exception.
142      */
143     public ST getAui3_Source() {
144        return getTyped(2, ST.class);
145     }
146 
147 
148 
149 }
150