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 "XTN.java".  Description:
15   * "Composite class XTN"
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 XTN (Extended Telecommunication Number) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>Telephone Number (NULLDT)
46   * <li>Telecommunication Use Code (ID)
47   * <li>Telecommunication Equipment Type (ID)
48   * <li>Communication Address (ST)
49   * <li>Country Code (SNM)
50   * <li>Area/City Code (SNM)
51   * <li>Local Number (SNM)
52   * <li>Extension (SNM)
53   * <li>Any Text (ST)
54   * <li>Extension Prefix (ST)
55   * <li>Speed Dial Code (ST)
56   * <li>Unformatted Telephone number (ST)
57   * <li>Effective Start Date (DTM)
58   * <li>Expiration Date (DTM)
59   * <li>Expiration Reason (CWE)
60   * <li>Protection Code (CWE)
61   * <li>Shared Telecommunication Identifier (EI)
62   * <li>Preference Order (NM)
63   * </ul>
64   */
65  @SuppressWarnings("unused")
66  public class XTN extends AbstractComposite {
67  
68      private Type[] data;
69  
70      /** 
71       * Creates a new XTN type
72       */
73      public XTN(Message message) {
74          super(message);
75          init();
76      }
77  
78      private void init() {
79          data = new Type[18];    
80          data[0] = new NULLDT(getMessage());
81          data[1] = new ID(getMessage(), 201);
82          data[2] = new ID(getMessage(), 202);
83          data[3] = new ST(getMessage());
84          data[4] = new SNM(getMessage());
85          data[5] = new SNM(getMessage());
86          data[6] = new SNM(getMessage());
87          data[7] = new SNM(getMessage());
88          data[8] = new ST(getMessage());
89          data[9] = new ST(getMessage());
90          data[10] = new ST(getMessage());
91          data[11] = new ST(getMessage());
92          data[12] = new DTM(getMessage());
93          data[13] = new DTM(getMessage());
94          data[14] = new CWE(getMessage());
95          data[15] = new CWE(getMessage());
96          data[16] = new EI(getMessage());
97          data[17] = new NM(getMessage());
98      }
99  
100 
101     /**
102      * Returns an array containing the data elements.
103      */
104     public Type[] getComponents() { 
105         return this.data; 
106     }
107 
108     /**
109      * Returns an individual data component.
110      *
111      * @param number The component number (0-indexed)
112      * @throws DataTypeException if the given element number is out of range.
113      */
114     public Type getComponent(int number) throws DataTypeException { 
115 
116         try { 
117             return this.data[number]; 
118         } catch (ArrayIndexOutOfBoundsException e) { 
119             throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
120         } 
121     } 
122 
123 
124     /**
125      * Returns Telephone Number (component 1).  This is a convenience method that saves you from 
126      * casting and handling an exception.
127      */
128     public NULLDT getTelephoneNumber() {
129        return getTyped(0, NULLDT.class);
130     }
131 
132     
133     /**
134      * Returns Telephone Number (component 1).  This is a convenience method that saves you from 
135      * casting and handling an exception.
136      */
137     public NULLDT getXtn1_TelephoneNumber() {
138        return getTyped(0, NULLDT.class);
139     }
140 
141 
142     /**
143      * Returns Telecommunication Use Code (component 2).  This is a convenience method that saves you from 
144      * casting and handling an exception.
145      */
146     public ID getTelecommunicationUseCode() {
147        return getTyped(1, ID.class);
148     }
149 
150     
151     /**
152      * Returns Telecommunication Use Code (component 2).  This is a convenience method that saves you from 
153      * casting and handling an exception.
154      */
155     public ID getXtn2_TelecommunicationUseCode() {
156        return getTyped(1, ID.class);
157     }
158 
159 
160     /**
161      * Returns Telecommunication Equipment Type (component 3).  This is a convenience method that saves you from 
162      * casting and handling an exception.
163      */
164     public ID getTelecommunicationEquipmentType() {
165        return getTyped(2, ID.class);
166     }
167 
168     
169     /**
170      * Returns Telecommunication Equipment Type (component 3).  This is a convenience method that saves you from 
171      * casting and handling an exception.
172      */
173     public ID getXtn3_TelecommunicationEquipmentType() {
174        return getTyped(2, ID.class);
175     }
176 
177 
178     /**
179      * Returns Communication Address (component 4).  This is a convenience method that saves you from 
180      * casting and handling an exception.
181      */
182     public ST getCommunicationAddress() {
183        return getTyped(3, ST.class);
184     }
185 
186     
187     /**
188      * Returns Communication Address (component 4).  This is a convenience method that saves you from 
189      * casting and handling an exception.
190      */
191     public ST getXtn4_CommunicationAddress() {
192        return getTyped(3, ST.class);
193     }
194 
195 
196     /**
197      * Returns Country Code (component 5).  This is a convenience method that saves you from 
198      * casting and handling an exception.
199      */
200     public SNM getCountryCode() {
201        return getTyped(4, SNM.class);
202     }
203 
204     
205     /**
206      * Returns Country Code (component 5).  This is a convenience method that saves you from 
207      * casting and handling an exception.
208      */
209     public SNM getXtn5_CountryCode() {
210        return getTyped(4, SNM.class);
211     }
212 
213 
214     /**
215      * Returns Area/City Code (component 6).  This is a convenience method that saves you from 
216      * casting and handling an exception.
217      */
218     public SNM getAreaCityCode() {
219        return getTyped(5, SNM.class);
220     }
221 
222     
223     /**
224      * Returns Area/City Code (component 6).  This is a convenience method that saves you from 
225      * casting and handling an exception.
226      */
227     public SNM getXtn6_AreaCityCode() {
228        return getTyped(5, SNM.class);
229     }
230 
231 
232     /**
233      * Returns Local Number (component 7).  This is a convenience method that saves you from 
234      * casting and handling an exception.
235      */
236     public SNM getLocalNumber() {
237        return getTyped(6, SNM.class);
238     }
239 
240     
241     /**
242      * Returns Local Number (component 7).  This is a convenience method that saves you from 
243      * casting and handling an exception.
244      */
245     public SNM getXtn7_LocalNumber() {
246        return getTyped(6, SNM.class);
247     }
248 
249 
250     /**
251      * Returns Extension (component 8).  This is a convenience method that saves you from 
252      * casting and handling an exception.
253      */
254     public SNM getExtension() {
255        return getTyped(7, SNM.class);
256     }
257 
258     
259     /**
260      * Returns Extension (component 8).  This is a convenience method that saves you from 
261      * casting and handling an exception.
262      */
263     public SNM getXtn8_Extension() {
264        return getTyped(7, SNM.class);
265     }
266 
267 
268     /**
269      * Returns Any Text (component 9).  This is a convenience method that saves you from 
270      * casting and handling an exception.
271      */
272     public ST getAnyText() {
273        return getTyped(8, ST.class);
274     }
275 
276     
277     /**
278      * Returns Any Text (component 9).  This is a convenience method that saves you from 
279      * casting and handling an exception.
280      */
281     public ST getXtn9_AnyText() {
282        return getTyped(8, ST.class);
283     }
284 
285 
286     /**
287      * Returns Extension Prefix (component 10).  This is a convenience method that saves you from 
288      * casting and handling an exception.
289      */
290     public ST getExtensionPrefix() {
291        return getTyped(9, ST.class);
292     }
293 
294     
295     /**
296      * Returns Extension Prefix (component 10).  This is a convenience method that saves you from 
297      * casting and handling an exception.
298      */
299     public ST getXtn10_ExtensionPrefix() {
300        return getTyped(9, ST.class);
301     }
302 
303 
304     /**
305      * Returns Speed Dial Code (component 11).  This is a convenience method that saves you from 
306      * casting and handling an exception.
307      */
308     public ST getSpeedDialCode() {
309        return getTyped(10, ST.class);
310     }
311 
312     
313     /**
314      * Returns Speed Dial Code (component 11).  This is a convenience method that saves you from 
315      * casting and handling an exception.
316      */
317     public ST getXtn11_SpeedDialCode() {
318        return getTyped(10, ST.class);
319     }
320 
321 
322     /**
323      * Returns Unformatted Telephone number (component 12).  This is a convenience method that saves you from 
324      * casting and handling an exception.
325      */
326     public ST getUnformattedTelephoneNumber() {
327        return getTyped(11, ST.class);
328     }
329 
330     
331     /**
332      * Returns Unformatted Telephone number (component 12).  This is a convenience method that saves you from 
333      * casting and handling an exception.
334      */
335     public ST getXtn12_UnformattedTelephoneNumber() {
336        return getTyped(11, ST.class);
337     }
338 
339 
340     /**
341      * Returns Effective Start Date (component 13).  This is a convenience method that saves you from 
342      * casting and handling an exception.
343      */
344     public DTM getEffectiveStartDate() {
345        return getTyped(12, DTM.class);
346     }
347 
348     
349     /**
350      * Returns Effective Start Date (component 13).  This is a convenience method that saves you from 
351      * casting and handling an exception.
352      */
353     public DTM getXtn13_EffectiveStartDate() {
354        return getTyped(12, DTM.class);
355     }
356 
357 
358     /**
359      * Returns Expiration Date (component 14).  This is a convenience method that saves you from 
360      * casting and handling an exception.
361      */
362     public DTM getExpirationDate() {
363        return getTyped(13, DTM.class);
364     }
365 
366     
367     /**
368      * Returns Expiration Date (component 14).  This is a convenience method that saves you from 
369      * casting and handling an exception.
370      */
371     public DTM getXtn14_ExpirationDate() {
372        return getTyped(13, DTM.class);
373     }
374 
375 
376     /**
377      * Returns Expiration Reason (component 15).  This is a convenience method that saves you from 
378      * casting and handling an exception.
379      */
380     public CWE getExpirationReason() {
381        return getTyped(14, CWE.class);
382     }
383 
384     
385     /**
386      * Returns Expiration Reason (component 15).  This is a convenience method that saves you from 
387      * casting and handling an exception.
388      */
389     public CWE getXtn15_ExpirationReason() {
390        return getTyped(14, CWE.class);
391     }
392 
393 
394     /**
395      * Returns Protection Code (component 16).  This is a convenience method that saves you from 
396      * casting and handling an exception.
397      */
398     public CWE getProtectionCode() {
399        return getTyped(15, CWE.class);
400     }
401 
402     
403     /**
404      * Returns Protection Code (component 16).  This is a convenience method that saves you from 
405      * casting and handling an exception.
406      */
407     public CWE getXtn16_ProtectionCode() {
408        return getTyped(15, CWE.class);
409     }
410 
411 
412     /**
413      * Returns Shared Telecommunication Identifier (component 17).  This is a convenience method that saves you from 
414      * casting and handling an exception.
415      */
416     public EI getSharedTelecommunicationIdentifier() {
417        return getTyped(16, EI.class);
418     }
419 
420     
421     /**
422      * Returns Shared Telecommunication Identifier (component 17).  This is a convenience method that saves you from 
423      * casting and handling an exception.
424      */
425     public EI getXtn17_SharedTelecommunicationIdentifier() {
426        return getTyped(16, EI.class);
427     }
428 
429 
430     /**
431      * Returns Preference Order (component 18).  This is a convenience method that saves you from 
432      * casting and handling an exception.
433      */
434     public NM getPreferenceOrder() {
435        return getTyped(17, NM.class);
436     }
437 
438     
439     /**
440      * Returns Preference Order (component 18).  This is a convenience method that saves you from 
441      * casting and handling an exception.
442      */
443     public NM getXtn18_PreferenceOrder() {
444        return getTyped(17, NM.class);
445     }
446 
447 
448 
449 }
450