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