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