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.v251.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 XCN (Extended Composite ID Number and Name for Persons) data type. 
042 * This type consists of the following components:</p>
043 * <ul>
044 * <li>ID Number (ST)
045 * <li>Family Name (FN)
046 * <li>Given Name (ST)
047 * <li>Second and Further Given Names or Initials Thereof (ST)
048 * <li>Suffix (e.g., JR or III) (ST)
049 * <li>Prefix (e.g., DR) (ST)
050 * <li>Degree (e.g., MD) (IS)
051 * <li>Source Table (IS)
052 * <li>Assigning Authority (HD)
053 * <li>Name Type Code (ID)
054 * <li>Identifier Check Digit (ST)
055 * <li>Check Digit Scheme (ID)
056 * <li>Identifier Type Code (ID)
057 * <li>Assigning Facility (HD)
058 * <li>Name Representation Code (ID)
059 * <li>Name Context (CE)
060 * <li>Name Validity Range (DR)
061 * <li>Name Assembly Order (ID)
062 * <li>Effective Date (TS)
063 * <li>Expiration Date (TS)
064 * <li>Professional Suffix (ST)
065 * <li>Assigning Jurisdiction (CWE)
066 * <li>Assigning Agency or Department (CWE)
067 * </ul>
068 */
069@SuppressWarnings("unused")
070public class XCN extends AbstractComposite {
071
072    private Type[] data;
073
074    /** 
075     * Creates a new XCN type
076     */
077    public XCN(Message message) {
078        super(message);
079        init();
080    }
081
082    private void init() {
083        data = new Type[23];    
084        data[0] = new ST(getMessage());
085        data[1] = new FN(getMessage());
086        data[2] = new ST(getMessage());
087        data[3] = new ST(getMessage());
088        data[4] = new ST(getMessage());
089        data[5] = new ST(getMessage());
090        data[6] = new IS(getMessage(), 360);
091        data[7] = new IS(getMessage(), 297);
092        data[8] = new HD(getMessage());
093        data[9] = new ID(getMessage(), 200);
094        data[10] = new ST(getMessage());
095        data[11] = new ID(getMessage(), 61);
096        data[12] = new ID(getMessage(), 203);
097        data[13] = new HD(getMessage());
098        data[14] = new ID(getMessage(), 465);
099        data[15] = new CE(getMessage());
100        data[16] = new DR(getMessage());
101        data[17] = new ID(getMessage(), 444);
102        data[18] = new TS(getMessage());
103        data[19] = new TS(getMessage());
104        data[20] = new ST(getMessage());
105        data[21] = new CWE(getMessage());
106        data[22] = new CWE(getMessage());
107    }
108
109
110    /**
111     * Returns an array containing the data elements.
112     */
113    public Type[] getComponents() { 
114        return this.data; 
115    }
116
117    /**
118     * Returns an individual data component.
119     *
120     * @param number The component number (0-indexed)
121     * @throws DataTypeException if the given element number is out of range.
122     */
123    public Type getComponent(int number) throws DataTypeException { 
124
125        try { 
126            return this.data[number]; 
127        } catch (ArrayIndexOutOfBoundsException e) { 
128            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
129        } 
130    } 
131
132
133    /**
134     * Returns ID Number (component 1).  This is a convenience method that saves you from 
135     * casting and handling an exception.
136     */
137    public ST getIDNumber() {
138       return getTyped(0, ST.class);
139    }
140
141    
142    /**
143     * Returns ID Number (component 1).  This is a convenience method that saves you from 
144     * casting and handling an exception.
145     */
146    public ST getXcn1_IDNumber() {
147       return getTyped(0, ST.class);
148    }
149
150
151    /**
152     * Returns Family Name (component 2).  This is a convenience method that saves you from 
153     * casting and handling an exception.
154     */
155    public FN getFamilyName() {
156       return getTyped(1, FN.class);
157    }
158
159    
160    /**
161     * Returns Family Name (component 2).  This is a convenience method that saves you from 
162     * casting and handling an exception.
163     */
164    public FN getXcn2_FamilyName() {
165       return getTyped(1, FN.class);
166    }
167
168
169    /**
170     * Returns Given Name (component 3).  This is a convenience method that saves you from 
171     * casting and handling an exception.
172     */
173    public ST getGivenName() {
174       return getTyped(2, ST.class);
175    }
176
177    
178    /**
179     * Returns Given Name (component 3).  This is a convenience method that saves you from 
180     * casting and handling an exception.
181     */
182    public ST getXcn3_GivenName() {
183       return getTyped(2, ST.class);
184    }
185
186
187    /**
188     * Returns Second and Further Given Names or Initials Thereof (component 4).  This is a convenience method that saves you from 
189     * casting and handling an exception.
190     */
191    public ST getSecondAndFurtherGivenNamesOrInitialsThereof() {
192       return getTyped(3, ST.class);
193    }
194
195    
196    /**
197     * Returns Second and Further Given Names or Initials Thereof (component 4).  This is a convenience method that saves you from 
198     * casting and handling an exception.
199     */
200    public ST getXcn4_SecondAndFurtherGivenNamesOrInitialsThereof() {
201       return getTyped(3, ST.class);
202    }
203
204
205    /**
206     * Returns Suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
207     * casting and handling an exception.
208     */
209    public ST getSuffixEgJRorIII() {
210       return getTyped(4, ST.class);
211    }
212
213    
214    /**
215     * Returns Suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
216     * casting and handling an exception.
217     */
218    public ST getXcn5_SuffixEgJRorIII() {
219       return getTyped(4, ST.class);
220    }
221
222
223    /**
224     * Returns Prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
225     * casting and handling an exception.
226     */
227    public ST getPrefixEgDR() {
228       return getTyped(5, ST.class);
229    }
230
231    
232    /**
233     * Returns Prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
234     * casting and handling an exception.
235     */
236    public ST getXcn6_PrefixEgDR() {
237       return getTyped(5, ST.class);
238    }
239
240
241    /**
242     * Returns Degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
243     * casting and handling an exception.
244     */
245    public IS getDegreeEgMD() {
246       return getTyped(6, IS.class);
247    }
248
249    
250    /**
251     * Returns Degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
252     * casting and handling an exception.
253     */
254    public IS getXcn7_DegreeEgMD() {
255       return getTyped(6, IS.class);
256    }
257
258
259    /**
260     * Returns Source Table (component 8).  This is a convenience method that saves you from 
261     * casting and handling an exception.
262     */
263    public IS getSourceTable() {
264       return getTyped(7, IS.class);
265    }
266
267    
268    /**
269     * Returns Source Table (component 8).  This is a convenience method that saves you from 
270     * casting and handling an exception.
271     */
272    public IS getXcn8_SourceTable() {
273       return getTyped(7, IS.class);
274    }
275
276
277    /**
278     * Returns Assigning Authority (component 9).  This is a convenience method that saves you from 
279     * casting and handling an exception.
280     */
281    public HD getAssigningAuthority() {
282       return getTyped(8, HD.class);
283    }
284
285    
286    /**
287     * Returns Assigning Authority (component 9).  This is a convenience method that saves you from 
288     * casting and handling an exception.
289     */
290    public HD getXcn9_AssigningAuthority() {
291       return getTyped(8, HD.class);
292    }
293
294
295    /**
296     * Returns Name Type Code (component 10).  This is a convenience method that saves you from 
297     * casting and handling an exception.
298     */
299    public ID getNameTypeCode() {
300       return getTyped(9, ID.class);
301    }
302
303    
304    /**
305     * Returns Name Type Code (component 10).  This is a convenience method that saves you from 
306     * casting and handling an exception.
307     */
308    public ID getXcn10_NameTypeCode() {
309       return getTyped(9, ID.class);
310    }
311
312
313    /**
314     * Returns Identifier Check Digit (component 11).  This is a convenience method that saves you from 
315     * casting and handling an exception.
316     */
317    public ST getIdentifierCheckDigit() {
318       return getTyped(10, ST.class);
319    }
320
321    
322    /**
323     * Returns Identifier Check Digit (component 11).  This is a convenience method that saves you from 
324     * casting and handling an exception.
325     */
326    public ST getXcn11_IdentifierCheckDigit() {
327       return getTyped(10, ST.class);
328    }
329
330
331    /**
332     * Returns Check Digit Scheme (component 12).  This is a convenience method that saves you from 
333     * casting and handling an exception.
334     */
335    public ID getCheckDigitScheme() {
336       return getTyped(11, ID.class);
337    }
338
339    
340    /**
341     * Returns Check Digit Scheme (component 12).  This is a convenience method that saves you from 
342     * casting and handling an exception.
343     */
344    public ID getXcn12_CheckDigitScheme() {
345       return getTyped(11, ID.class);
346    }
347
348
349    /**
350     * Returns Identifier Type Code (component 13).  This is a convenience method that saves you from 
351     * casting and handling an exception.
352     */
353    public ID getIdentifierTypeCode() {
354       return getTyped(12, ID.class);
355    }
356
357    
358    /**
359     * Returns Identifier Type Code (component 13).  This is a convenience method that saves you from 
360     * casting and handling an exception.
361     */
362    public ID getXcn13_IdentifierTypeCode() {
363       return getTyped(12, ID.class);
364    }
365
366
367    /**
368     * Returns Assigning Facility (component 14).  This is a convenience method that saves you from 
369     * casting and handling an exception.
370     */
371    public HD getAssigningFacility() {
372       return getTyped(13, HD.class);
373    }
374
375    
376    /**
377     * Returns Assigning Facility (component 14).  This is a convenience method that saves you from 
378     * casting and handling an exception.
379     */
380    public HD getXcn14_AssigningFacility() {
381       return getTyped(13, HD.class);
382    }
383
384
385    /**
386     * Returns Name Representation Code (component 15).  This is a convenience method that saves you from 
387     * casting and handling an exception.
388     */
389    public ID getNameRepresentationCode() {
390       return getTyped(14, ID.class);
391    }
392
393    
394    /**
395     * Returns Name Representation Code (component 15).  This is a convenience method that saves you from 
396     * casting and handling an exception.
397     */
398    public ID getXcn15_NameRepresentationCode() {
399       return getTyped(14, ID.class);
400    }
401
402
403    /**
404     * Returns Name Context (component 16).  This is a convenience method that saves you from 
405     * casting and handling an exception.
406     */
407    public CE getNameContext() {
408       return getTyped(15, CE.class);
409    }
410
411    
412    /**
413     * Returns Name Context (component 16).  This is a convenience method that saves you from 
414     * casting and handling an exception.
415     */
416    public CE getXcn16_NameContext() {
417       return getTyped(15, CE.class);
418    }
419
420
421    /**
422     * Returns Name Validity Range (component 17).  This is a convenience method that saves you from 
423     * casting and handling an exception.
424     */
425    public DR getNameValidityRange() {
426       return getTyped(16, DR.class);
427    }
428
429    
430    /**
431     * Returns Name Validity Range (component 17).  This is a convenience method that saves you from 
432     * casting and handling an exception.
433     */
434    public DR getXcn17_NameValidityRange() {
435       return getTyped(16, DR.class);
436    }
437
438
439    /**
440     * Returns Name Assembly Order (component 18).  This is a convenience method that saves you from 
441     * casting and handling an exception.
442     */
443    public ID getNameAssemblyOrder() {
444       return getTyped(17, ID.class);
445    }
446
447    
448    /**
449     * Returns Name Assembly Order (component 18).  This is a convenience method that saves you from 
450     * casting and handling an exception.
451     */
452    public ID getXcn18_NameAssemblyOrder() {
453       return getTyped(17, ID.class);
454    }
455
456
457    /**
458     * Returns Effective Date (component 19).  This is a convenience method that saves you from 
459     * casting and handling an exception.
460     */
461    public TS getEffectiveDate() {
462       return getTyped(18, TS.class);
463    }
464
465    
466    /**
467     * Returns Effective Date (component 19).  This is a convenience method that saves you from 
468     * casting and handling an exception.
469     */
470    public TS getXcn19_EffectiveDate() {
471       return getTyped(18, TS.class);
472    }
473
474
475    /**
476     * Returns Expiration Date (component 20).  This is a convenience method that saves you from 
477     * casting and handling an exception.
478     */
479    public TS getExpirationDate() {
480       return getTyped(19, TS.class);
481    }
482
483    
484    /**
485     * Returns Expiration Date (component 20).  This is a convenience method that saves you from 
486     * casting and handling an exception.
487     */
488    public TS getXcn20_ExpirationDate() {
489       return getTyped(19, TS.class);
490    }
491
492
493    /**
494     * Returns Professional Suffix (component 21).  This is a convenience method that saves you from 
495     * casting and handling an exception.
496     */
497    public ST getProfessionalSuffix() {
498       return getTyped(20, ST.class);
499    }
500
501    
502    /**
503     * Returns Professional Suffix (component 21).  This is a convenience method that saves you from 
504     * casting and handling an exception.
505     */
506    public ST getXcn21_ProfessionalSuffix() {
507       return getTyped(20, ST.class);
508    }
509
510
511    /**
512     * Returns Assigning Jurisdiction (component 22).  This is a convenience method that saves you from 
513     * casting and handling an exception.
514     */
515    public CWE getAssigningJurisdiction() {
516       return getTyped(21, CWE.class);
517    }
518
519    
520    /**
521     * Returns Assigning Jurisdiction (component 22).  This is a convenience method that saves you from 
522     * casting and handling an exception.
523     */
524    public CWE getXcn22_AssigningJurisdiction() {
525       return getTyped(21, CWE.class);
526    }
527
528
529    /**
530     * Returns Assigning Agency or Department (component 23).  This is a convenience method that saves you from 
531     * casting and handling an exception.
532     */
533    public CWE getAssigningAgencyOrDepartment() {
534       return getTyped(22, CWE.class);
535    }
536
537    
538    /**
539     * Returns Assigning Agency or Department (component 23).  This is a convenience method that saves you from 
540     * casting and handling an exception.
541     */
542    public CWE getXcn23_AssigningAgencyOrDepartment() {
543       return getTyped(22, CWE.class);
544    }
545
546
547
548}
549