001/*
002 * This class is an auto-generated source file for a HAPI
003 * HL7 v2.x standard structure class.
004 *
005 * For more information, visit: http://hl7api.sourceforge.net/
006 * 
007 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033package ca.uhn.hl7v2.model.v26.datatype;
034
035import ca.uhn.hl7v2.model.DataTypeException;
036import ca.uhn.hl7v2.model.Message;
037import ca.uhn.hl7v2.model.Type;
038import ca.uhn.hl7v2.model.AbstractComposite;
039
040/**
041 * <p>Represents an HL7 XTN (Extended Telecommunication Number) data type. 
042 * This type consists of the following components:</p>
043 * <ul>
044 * <li>Telephone Number (NULLDT)
045 * <li>Telecommunication Use Code (ID)
046 * <li>Telecommunication Equipment Type (ID)
047 * <li>Communication Address (ST)
048 * <li>Country Code (NM)
049 * <li>Area/City Code (NM)
050 * <li>Local Number (NM)
051 * <li>Extension (NM)
052 * <li>Any Text (ST)
053 * <li>Extension Prefix (ST)
054 * <li>Speed Dial Code (ST)
055 * <li>Unformatted Telephone number (ST)
056 * <li>Effective Start Date (DTM)
057 * <li>Expiration Date (DTM)
058 * <li>Expiration Reason (CWE)
059 * <li>Protection Code (CWE)
060 * <li>Shared Telecommunication Identifier (EI)
061 * <li>Preference Order (NM)
062 * </ul>
063 */
064@SuppressWarnings("unused")
065public class XTN extends AbstractComposite {
066
067    private Type[] data;
068
069    /** 
070     * Creates a new XTN type
071     */
072    public XTN(Message message) {
073        super(message);
074        init();
075    }
076
077    private void init() {
078        data = new Type[18];    
079        data[0] = new NULLDT(getMessage());
080        data[1] = new ID(getMessage(), 201);
081        data[2] = new ID(getMessage(), 202);
082        data[3] = new ST(getMessage());
083        data[4] = new NM(getMessage());
084        data[5] = new NM(getMessage());
085        data[6] = new NM(getMessage());
086        data[7] = new NM(getMessage());
087        data[8] = new ST(getMessage());
088        data[9] = new ST(getMessage());
089        data[10] = new ST(getMessage());
090        data[11] = new ST(getMessage());
091        data[12] = new DTM(getMessage());
092        data[13] = new DTM(getMessage());
093        data[14] = new CWE(getMessage());
094        data[15] = new CWE(getMessage());
095        data[16] = new EI(getMessage());
096        data[17] = new NM(getMessage());
097    }
098
099
100    /**
101     * Returns an array containing the data elements.
102     */
103    public Type[] getComponents() { 
104        return this.data; 
105    }
106
107    /**
108     * Returns an individual data component.
109     *
110     * @param number The component number (0-indexed)
111     * @throws DataTypeException if the given element number is out of range.
112     */
113    public Type getComponent(int number) throws DataTypeException { 
114
115        try { 
116            return this.data[number]; 
117        } catch (ArrayIndexOutOfBoundsException e) { 
118            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
119        } 
120    } 
121
122
123    /**
124     * Returns Telephone Number (component 1).  This is a convenience method that saves you from 
125     * casting and handling an exception.
126     */
127    public NULLDT getTelephoneNumber() {
128       return getTyped(0, NULLDT.class);
129    }
130
131    
132    /**
133     * Returns Telephone Number (component 1).  This is a convenience method that saves you from 
134     * casting and handling an exception.
135     */
136    public NULLDT getXtn1_TelephoneNumber() {
137       return getTyped(0, NULLDT.class);
138    }
139
140
141    /**
142     * Returns Telecommunication Use Code (component 2).  This is a convenience method that saves you from 
143     * casting and handling an exception.
144     */
145    public ID getTelecommunicationUseCode() {
146       return getTyped(1, ID.class);
147    }
148
149    
150    /**
151     * Returns Telecommunication Use Code (component 2).  This is a convenience method that saves you from 
152     * casting and handling an exception.
153     */
154    public ID getXtn2_TelecommunicationUseCode() {
155       return getTyped(1, ID.class);
156    }
157
158
159    /**
160     * Returns Telecommunication Equipment Type (component 3).  This is a convenience method that saves you from 
161     * casting and handling an exception.
162     */
163    public ID getTelecommunicationEquipmentType() {
164       return getTyped(2, ID.class);
165    }
166
167    
168    /**
169     * Returns Telecommunication Equipment Type (component 3).  This is a convenience method that saves you from 
170     * casting and handling an exception.
171     */
172    public ID getXtn3_TelecommunicationEquipmentType() {
173       return getTyped(2, ID.class);
174    }
175
176
177    /**
178     * Returns Communication Address (component 4).  This is a convenience method that saves you from 
179     * casting and handling an exception.
180     */
181    public ST getCommunicationAddress() {
182       return getTyped(3, ST.class);
183    }
184
185    
186    /**
187     * Returns Communication Address (component 4).  This is a convenience method that saves you from 
188     * casting and handling an exception.
189     */
190    public ST getXtn4_CommunicationAddress() {
191       return getTyped(3, ST.class);
192    }
193
194
195    /**
196     * Returns Country Code (component 5).  This is a convenience method that saves you from 
197     * casting and handling an exception.
198     */
199    public NM getCountryCode() {
200       return getTyped(4, NM.class);
201    }
202
203    
204    /**
205     * Returns Country Code (component 5).  This is a convenience method that saves you from 
206     * casting and handling an exception.
207     */
208    public NM getXtn5_CountryCode() {
209       return getTyped(4, NM.class);
210    }
211
212
213    /**
214     * Returns Area/City Code (component 6).  This is a convenience method that saves you from 
215     * casting and handling an exception.
216     */
217    public NM getAreaCityCode() {
218       return getTyped(5, NM.class);
219    }
220
221    
222    /**
223     * Returns Area/City Code (component 6).  This is a convenience method that saves you from 
224     * casting and handling an exception.
225     */
226    public NM getXtn6_AreaCityCode() {
227       return getTyped(5, NM.class);
228    }
229
230
231    /**
232     * Returns Local Number (component 7).  This is a convenience method that saves you from 
233     * casting and handling an exception.
234     */
235    public NM getLocalNumber() {
236       return getTyped(6, NM.class);
237    }
238
239    
240    /**
241     * Returns Local Number (component 7).  This is a convenience method that saves you from 
242     * casting and handling an exception.
243     */
244    public NM getXtn7_LocalNumber() {
245       return getTyped(6, NM.class);
246    }
247
248
249    /**
250     * Returns Extension (component 8).  This is a convenience method that saves you from 
251     * casting and handling an exception.
252     */
253    public NM getExtension() {
254       return getTyped(7, NM.class);
255    }
256
257    
258    /**
259     * Returns Extension (component 8).  This is a convenience method that saves you from 
260     * casting and handling an exception.
261     */
262    public NM getXtn8_Extension() {
263       return getTyped(7, NM.class);
264    }
265
266
267    /**
268     * Returns Any Text (component 9).  This is a convenience method that saves you from 
269     * casting and handling an exception.
270     */
271    public ST getAnyText() {
272       return getTyped(8, ST.class);
273    }
274
275    
276    /**
277     * Returns Any Text (component 9).  This is a convenience method that saves you from 
278     * casting and handling an exception.
279     */
280    public ST getXtn9_AnyText() {
281       return getTyped(8, ST.class);
282    }
283
284
285    /**
286     * Returns Extension Prefix (component 10).  This is a convenience method that saves you from 
287     * casting and handling an exception.
288     */
289    public ST getExtensionPrefix() {
290       return getTyped(9, ST.class);
291    }
292
293    
294    /**
295     * Returns Extension Prefix (component 10).  This is a convenience method that saves you from 
296     * casting and handling an exception.
297     */
298    public ST getXtn10_ExtensionPrefix() {
299       return getTyped(9, ST.class);
300    }
301
302
303    /**
304     * Returns Speed Dial Code (component 11).  This is a convenience method that saves you from 
305     * casting and handling an exception.
306     */
307    public ST getSpeedDialCode() {
308       return getTyped(10, ST.class);
309    }
310
311    
312    /**
313     * Returns Speed Dial Code (component 11).  This is a convenience method that saves you from 
314     * casting and handling an exception.
315     */
316    public ST getXtn11_SpeedDialCode() {
317       return getTyped(10, ST.class);
318    }
319
320
321    /**
322     * Returns Unformatted Telephone number (component 12).  This is a convenience method that saves you from 
323     * casting and handling an exception.
324     */
325    public ST getUnformattedTelephoneNumber() {
326       return getTyped(11, ST.class);
327    }
328
329    
330    /**
331     * Returns Unformatted Telephone number (component 12).  This is a convenience method that saves you from 
332     * casting and handling an exception.
333     */
334    public ST getXtn12_UnformattedTelephoneNumber() {
335       return getTyped(11, ST.class);
336    }
337
338
339    /**
340     * Returns Effective Start Date (component 13).  This is a convenience method that saves you from 
341     * casting and handling an exception.
342     */
343    public DTM getEffectiveStartDate() {
344       return getTyped(12, DTM.class);
345    }
346
347    
348    /**
349     * Returns Effective Start Date (component 13).  This is a convenience method that saves you from 
350     * casting and handling an exception.
351     */
352    public DTM getXtn13_EffectiveStartDate() {
353       return getTyped(12, DTM.class);
354    }
355
356
357    /**
358     * Returns Expiration Date (component 14).  This is a convenience method that saves you from 
359     * casting and handling an exception.
360     */
361    public DTM getExpirationDate() {
362       return getTyped(13, DTM.class);
363    }
364
365    
366    /**
367     * Returns Expiration Date (component 14).  This is a convenience method that saves you from 
368     * casting and handling an exception.
369     */
370    public DTM getXtn14_ExpirationDate() {
371       return getTyped(13, DTM.class);
372    }
373
374
375    /**
376     * Returns Expiration Reason (component 15).  This is a convenience method that saves you from 
377     * casting and handling an exception.
378     */
379    public CWE getExpirationReason() {
380       return getTyped(14, CWE.class);
381    }
382
383    
384    /**
385     * Returns Expiration Reason (component 15).  This is a convenience method that saves you from 
386     * casting and handling an exception.
387     */
388    public CWE getXtn15_ExpirationReason() {
389       return getTyped(14, CWE.class);
390    }
391
392
393    /**
394     * Returns Protection Code (component 16).  This is a convenience method that saves you from 
395     * casting and handling an exception.
396     */
397    public CWE getProtectionCode() {
398       return getTyped(15, CWE.class);
399    }
400
401    
402    /**
403     * Returns Protection Code (component 16).  This is a convenience method that saves you from 
404     * casting and handling an exception.
405     */
406    public CWE getXtn16_ProtectionCode() {
407       return getTyped(15, CWE.class);
408    }
409
410
411    /**
412     * Returns Shared Telecommunication Identifier (component 17).  This is a convenience method that saves you from 
413     * casting and handling an exception.
414     */
415    public EI getSharedTelecommunicationIdentifier() {
416       return getTyped(16, EI.class);
417    }
418
419    
420    /**
421     * Returns Shared Telecommunication Identifier (component 17).  This is a convenience method that saves you from 
422     * casting and handling an exception.
423     */
424    public EI getXtn17_SharedTelecommunicationIdentifier() {
425       return getTyped(16, EI.class);
426    }
427
428
429    /**
430     * Returns Preference Order (component 18).  This is a convenience method that saves you from 
431     * casting and handling an exception.
432     */
433    public NM getPreferenceOrder() {
434       return getTyped(17, NM.class);
435    }
436
437    
438    /**
439     * Returns Preference Order (component 18).  This is a convenience method that saves you from 
440     * casting and handling an exception.
441     */
442    public NM getXtn18_PreferenceOrder() {
443       return getTyped(17, NM.class);
444    }
445
446
447
448}
449