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 "XON.java".  Description:
15   * "Composite class XON"
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 XON (Extended Composite Name and Identification Number for Organizations) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>Organization Name (ST)
46   * <li>Organization Name Type Code (CWE)
47   * <li>ID Number (NULLDT)
48   * <li>Identifier Check Digit (NM)
49   * <li>Check Digit Scheme (ID)
50   * <li>Assigning Authority (HD)
51   * <li>Identifier Type Code (ID)
52   * <li>Assigning Facility (HD)
53   * <li>Name Representation Code (ID)
54   * <li>Organization Identifier (ST)
55   * </ul>
56   */
57  @SuppressWarnings("unused")
58  public class XON extends AbstractComposite {
59  
60      private Type[] data;
61  
62      /** 
63       * Creates a new XON type
64       */
65      public XON(Message message) {
66          super(message);
67          init();
68      }
69  
70      private void init() {
71          data = new Type[10];    
72          data[0] = new ST(getMessage());
73          data[1] = new CWE(getMessage());
74          data[2] = new NULLDT(getMessage());
75          data[3] = new NM(getMessage());
76          data[4] = new ID(getMessage(), 61);
77          data[5] = new HD(getMessage());
78          data[6] = new ID(getMessage(), 203);
79          data[7] = new HD(getMessage());
80          data[8] = new ID(getMessage(), 465);
81          data[9] = new ST(getMessage());
82      }
83  
84  
85      /**
86       * Returns an array containing the data elements.
87       */
88      public Type[] getComponents() { 
89          return this.data; 
90      }
91  
92      /**
93       * Returns an individual data component.
94       *
95       * @param number The component number (0-indexed)
96       * @throws DataTypeException if the given element number is out of range.
97       */
98      public Type getComponent(int number) throws DataTypeException { 
99  
100         try { 
101             return this.data[number]; 
102         } catch (ArrayIndexOutOfBoundsException e) { 
103             throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
104         } 
105     } 
106 
107 
108     /**
109      * Returns Organization Name (component 1).  This is a convenience method that saves you from 
110      * casting and handling an exception.
111      */
112     public ST getOrganizationName() {
113        return getTyped(0, ST.class);
114     }
115 
116     
117     /**
118      * Returns Organization Name (component 1).  This is a convenience method that saves you from 
119      * casting and handling an exception.
120      */
121     public ST getXon1_OrganizationName() {
122        return getTyped(0, ST.class);
123     }
124 
125 
126     /**
127      * Returns Organization Name Type Code (component 2).  This is a convenience method that saves you from 
128      * casting and handling an exception.
129      */
130     public CWE getOrganizationNameTypeCode() {
131        return getTyped(1, CWE.class);
132     }
133 
134     
135     /**
136      * Returns Organization Name Type Code (component 2).  This is a convenience method that saves you from 
137      * casting and handling an exception.
138      */
139     public CWE getXon2_OrganizationNameTypeCode() {
140        return getTyped(1, CWE.class);
141     }
142 
143 
144     /**
145      * Returns ID Number (component 3).  This is a convenience method that saves you from 
146      * casting and handling an exception.
147      */
148     public NULLDT getIDNumber() {
149        return getTyped(2, NULLDT.class);
150     }
151 
152     
153     /**
154      * Returns ID Number (component 3).  This is a convenience method that saves you from 
155      * casting and handling an exception.
156      */
157     public NULLDT getXon3_IDNumber() {
158        return getTyped(2, NULLDT.class);
159     }
160 
161 
162     /**
163      * Returns Identifier Check Digit (component 4).  This is a convenience method that saves you from 
164      * casting and handling an exception.
165      */
166     public NM getIdentifierCheckDigit() {
167        return getTyped(3, NM.class);
168     }
169 
170     
171     /**
172      * Returns Identifier Check Digit (component 4).  This is a convenience method that saves you from 
173      * casting and handling an exception.
174      */
175     public NM getXon4_IdentifierCheckDigit() {
176        return getTyped(3, NM.class);
177     }
178 
179 
180     /**
181      * Returns Check Digit Scheme (component 5).  This is a convenience method that saves you from 
182      * casting and handling an exception.
183      */
184     public ID getCheckDigitScheme() {
185        return getTyped(4, ID.class);
186     }
187 
188     
189     /**
190      * Returns Check Digit Scheme (component 5).  This is a convenience method that saves you from 
191      * casting and handling an exception.
192      */
193     public ID getXon5_CheckDigitScheme() {
194        return getTyped(4, ID.class);
195     }
196 
197 
198     /**
199      * Returns Assigning Authority (component 6).  This is a convenience method that saves you from 
200      * casting and handling an exception.
201      */
202     public HD getAssigningAuthority() {
203        return getTyped(5, HD.class);
204     }
205 
206     
207     /**
208      * Returns Assigning Authority (component 6).  This is a convenience method that saves you from 
209      * casting and handling an exception.
210      */
211     public HD getXon6_AssigningAuthority() {
212        return getTyped(5, HD.class);
213     }
214 
215 
216     /**
217      * Returns Identifier Type Code (component 7).  This is a convenience method that saves you from 
218      * casting and handling an exception.
219      */
220     public ID getIdentifierTypeCode() {
221        return getTyped(6, ID.class);
222     }
223 
224     
225     /**
226      * Returns Identifier Type Code (component 7).  This is a convenience method that saves you from 
227      * casting and handling an exception.
228      */
229     public ID getXon7_IdentifierTypeCode() {
230        return getTyped(6, ID.class);
231     }
232 
233 
234     /**
235      * Returns Assigning Facility (component 8).  This is a convenience method that saves you from 
236      * casting and handling an exception.
237      */
238     public HD getAssigningFacility() {
239        return getTyped(7, HD.class);
240     }
241 
242     
243     /**
244      * Returns Assigning Facility (component 8).  This is a convenience method that saves you from 
245      * casting and handling an exception.
246      */
247     public HD getXon8_AssigningFacility() {
248        return getTyped(7, HD.class);
249     }
250 
251 
252     /**
253      * Returns Name Representation Code (component 9).  This is a convenience method that saves you from 
254      * casting and handling an exception.
255      */
256     public ID getNameRepresentationCode() {
257        return getTyped(8, ID.class);
258     }
259 
260     
261     /**
262      * Returns Name Representation Code (component 9).  This is a convenience method that saves you from 
263      * casting and handling an exception.
264      */
265     public ID getXon9_NameRepresentationCode() {
266        return getTyped(8, ID.class);
267     }
268 
269 
270     /**
271      * Returns Organization Identifier (component 10).  This is a convenience method that saves you from 
272      * casting and handling an exception.
273      */
274     public ST getOrganizationIdentifier() {
275        return getTyped(9, ST.class);
276     }
277 
278     
279     /**
280      * Returns Organization Identifier (component 10).  This is a convenience method that saves you from 
281      * casting and handling an exception.
282      */
283     public ST getXon10_OrganizationIdentifier() {
284        return getTyped(9, ST.class);
285     }
286 
287 
288 
289 }
290