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 "CWE.java".  Description:
015 * "Composite class CWE"
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 CWE (Coded with Exceptions) data type. 
043 * This type consists of the following components:</p>
044 * <ul>
045 * <li>Identifier (ST)
046 * <li>Text (ST)
047 * <li>Name of Coding System (ID)
048 * <li>Alternate Identifier (ST)
049 * <li>Alternate Text (ST)
050 * <li>Name of Alternate Coding System (ID)
051 * <li>Coding System Version ID (ST)
052 * <li>Alternate Coding System Version ID (ST)
053 * <li>Original Text (ST)
054 * <li>Second Alternate Identifier (ST)
055 * <li>Second Alternate Text (ST)
056 * <li>Name of Second Alternate Coding System (ID)
057 * <li>Second Alternate Coding System Version ID (ST)
058 * <li>Coding System OID (ST)
059 * <li>Value Set OID (ST)
060 * <li>Value Set Version ID (DTM)
061 * <li>Alternate Coding System OID (ST)
062 * <li>Alternate Value Set OID (ST)
063 * <li>Alternate Value Set Version ID (DTM)
064 * <li>Second Alternate Coding System OID (ST)
065 * <li>Second Alternate Value Set OID (ST)
066 * <li>Second Alternate Value Set Version ID (DTM)
067 * </ul>
068 */
069@SuppressWarnings("unused")
070public class CWE extends AbstractComposite {
071
072    private Type[] data;
073
074    /** 
075     * Creates a new CWE type
076     */
077    public CWE(Message message) {
078        super(message);
079        init();
080    }
081
082    private void init() {
083        data = new Type[22];    
084        data[0] = new ST(getMessage());
085        data[1] = new ST(getMessage());
086        data[2] = new ID(getMessage(), 396);
087        data[3] = new ST(getMessage());
088        data[4] = new ST(getMessage());
089        data[5] = new ID(getMessage(), 396);
090        data[6] = new ST(getMessage());
091        data[7] = new ST(getMessage());
092        data[8] = new ST(getMessage());
093        data[9] = new ST(getMessage());
094        data[10] = new ST(getMessage());
095        data[11] = new ID(getMessage(), 396);
096        data[12] = new ST(getMessage());
097        data[13] = new ST(getMessage());
098        data[14] = new ST(getMessage());
099        data[15] = new DTM(getMessage());
100        data[16] = new ST(getMessage());
101        data[17] = new ST(getMessage());
102        data[18] = new DTM(getMessage());
103        data[19] = new ST(getMessage());
104        data[20] = new ST(getMessage());
105        data[21] = new DTM(getMessage());
106    }
107
108
109    /**
110     * Returns an array containing the data elements.
111     */
112    public Type[] getComponents() { 
113        return this.data; 
114    }
115
116    /**
117     * Returns an individual data component.
118     *
119     * @param number The component number (0-indexed)
120     * @throws DataTypeException if the given element number is out of range.
121     */
122    public Type getComponent(int number) throws DataTypeException { 
123
124        try { 
125            return this.data[number]; 
126        } catch (ArrayIndexOutOfBoundsException e) { 
127            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
128        } 
129    } 
130
131
132    /**
133     * Returns Identifier (component 1).  This is a convenience method that saves you from 
134     * casting and handling an exception.
135     */
136    public ST getIdentifier() {
137       return getTyped(0, ST.class);
138    }
139
140    
141    /**
142     * Returns Identifier (component 1).  This is a convenience method that saves you from 
143     * casting and handling an exception.
144     */
145    public ST getCwe1_Identifier() {
146       return getTyped(0, ST.class);
147    }
148
149
150    /**
151     * Returns Text (component 2).  This is a convenience method that saves you from 
152     * casting and handling an exception.
153     */
154    public ST getText() {
155       return getTyped(1, ST.class);
156    }
157
158    
159    /**
160     * Returns Text (component 2).  This is a convenience method that saves you from 
161     * casting and handling an exception.
162     */
163    public ST getCwe2_Text() {
164       return getTyped(1, ST.class);
165    }
166
167
168    /**
169     * Returns Name of Coding System (component 3).  This is a convenience method that saves you from 
170     * casting and handling an exception.
171     */
172    public ID getNameOfCodingSystem() {
173       return getTyped(2, ID.class);
174    }
175
176    
177    /**
178     * Returns Name of Coding System (component 3).  This is a convenience method that saves you from 
179     * casting and handling an exception.
180     */
181    public ID getCwe3_NameOfCodingSystem() {
182       return getTyped(2, ID.class);
183    }
184
185
186    /**
187     * Returns Alternate Identifier (component 4).  This is a convenience method that saves you from 
188     * casting and handling an exception.
189     */
190    public ST getAlternateIdentifier() {
191       return getTyped(3, ST.class);
192    }
193
194    
195    /**
196     * Returns Alternate Identifier (component 4).  This is a convenience method that saves you from 
197     * casting and handling an exception.
198     */
199    public ST getCwe4_AlternateIdentifier() {
200       return getTyped(3, ST.class);
201    }
202
203
204    /**
205     * Returns Alternate Text (component 5).  This is a convenience method that saves you from 
206     * casting and handling an exception.
207     */
208    public ST getAlternateText() {
209       return getTyped(4, ST.class);
210    }
211
212    
213    /**
214     * Returns Alternate Text (component 5).  This is a convenience method that saves you from 
215     * casting and handling an exception.
216     */
217    public ST getCwe5_AlternateText() {
218       return getTyped(4, ST.class);
219    }
220
221
222    /**
223     * Returns Name of Alternate Coding System (component 6).  This is a convenience method that saves you from 
224     * casting and handling an exception.
225     */
226    public ID getNameOfAlternateCodingSystem() {
227       return getTyped(5, ID.class);
228    }
229
230    
231    /**
232     * Returns Name of Alternate Coding System (component 6).  This is a convenience method that saves you from 
233     * casting and handling an exception.
234     */
235    public ID getCwe6_NameOfAlternateCodingSystem() {
236       return getTyped(5, ID.class);
237    }
238
239
240    /**
241     * Returns Coding System Version ID (component 7).  This is a convenience method that saves you from 
242     * casting and handling an exception.
243     */
244    public ST getCodingSystemVersionID() {
245       return getTyped(6, ST.class);
246    }
247
248    
249    /**
250     * Returns Coding System Version ID (component 7).  This is a convenience method that saves you from 
251     * casting and handling an exception.
252     */
253    public ST getCwe7_CodingSystemVersionID() {
254       return getTyped(6, ST.class);
255    }
256
257
258    /**
259     * Returns Alternate Coding System Version ID (component 8).  This is a convenience method that saves you from 
260     * casting and handling an exception.
261     */
262    public ST getAlternateCodingSystemVersionID() {
263       return getTyped(7, ST.class);
264    }
265
266    
267    /**
268     * Returns Alternate Coding System Version ID (component 8).  This is a convenience method that saves you from 
269     * casting and handling an exception.
270     */
271    public ST getCwe8_AlternateCodingSystemVersionID() {
272       return getTyped(7, ST.class);
273    }
274
275
276    /**
277     * Returns Original Text (component 9).  This is a convenience method that saves you from 
278     * casting and handling an exception.
279     */
280    public ST getOriginalText() {
281       return getTyped(8, ST.class);
282    }
283
284    
285    /**
286     * Returns Original Text (component 9).  This is a convenience method that saves you from 
287     * casting and handling an exception.
288     */
289    public ST getCwe9_OriginalText() {
290       return getTyped(8, ST.class);
291    }
292
293
294    /**
295     * Returns Second Alternate Identifier (component 10).  This is a convenience method that saves you from 
296     * casting and handling an exception.
297     */
298    public ST getSecondAlternateIdentifier() {
299       return getTyped(9, ST.class);
300    }
301
302    
303    /**
304     * Returns Second Alternate Identifier (component 10).  This is a convenience method that saves you from 
305     * casting and handling an exception.
306     */
307    public ST getCwe10_SecondAlternateIdentifier() {
308       return getTyped(9, ST.class);
309    }
310
311
312    /**
313     * Returns Second Alternate Text (component 11).  This is a convenience method that saves you from 
314     * casting and handling an exception.
315     */
316    public ST getSecondAlternateText() {
317       return getTyped(10, ST.class);
318    }
319
320    
321    /**
322     * Returns Second Alternate Text (component 11).  This is a convenience method that saves you from 
323     * casting and handling an exception.
324     */
325    public ST getCwe11_SecondAlternateText() {
326       return getTyped(10, ST.class);
327    }
328
329
330    /**
331     * Returns Name of Second Alternate Coding System (component 12).  This is a convenience method that saves you from 
332     * casting and handling an exception.
333     */
334    public ID getNameOfSecondAlternateCodingSystem() {
335       return getTyped(11, ID.class);
336    }
337
338    
339    /**
340     * Returns Name of Second Alternate Coding System (component 12).  This is a convenience method that saves you from 
341     * casting and handling an exception.
342     */
343    public ID getCwe12_NameOfSecondAlternateCodingSystem() {
344       return getTyped(11, ID.class);
345    }
346
347
348    /**
349     * Returns Second Alternate Coding System Version ID (component 13).  This is a convenience method that saves you from 
350     * casting and handling an exception.
351     */
352    public ST getSecondAlternateCodingSystemVersionID() {
353       return getTyped(12, ST.class);
354    }
355
356    
357    /**
358     * Returns Second Alternate Coding System Version ID (component 13).  This is a convenience method that saves you from 
359     * casting and handling an exception.
360     */
361    public ST getCwe13_SecondAlternateCodingSystemVersionID() {
362       return getTyped(12, ST.class);
363    }
364
365
366    /**
367     * Returns Coding System OID (component 14).  This is a convenience method that saves you from 
368     * casting and handling an exception.
369     */
370    public ST getCodingSystemOID() {
371       return getTyped(13, ST.class);
372    }
373
374    
375    /**
376     * Returns Coding System OID (component 14).  This is a convenience method that saves you from 
377     * casting and handling an exception.
378     */
379    public ST getCwe14_CodingSystemOID() {
380       return getTyped(13, ST.class);
381    }
382
383
384    /**
385     * Returns Value Set OID (component 15).  This is a convenience method that saves you from 
386     * casting and handling an exception.
387     */
388    public ST getValueSetOID() {
389       return getTyped(14, ST.class);
390    }
391
392    
393    /**
394     * Returns Value Set OID (component 15).  This is a convenience method that saves you from 
395     * casting and handling an exception.
396     */
397    public ST getCwe15_ValueSetOID() {
398       return getTyped(14, ST.class);
399    }
400
401
402    /**
403     * Returns Value Set Version ID (component 16).  This is a convenience method that saves you from 
404     * casting and handling an exception.
405     */
406    public DTM getValueSetVersionID() {
407       return getTyped(15, DTM.class);
408    }
409
410    
411    /**
412     * Returns Value Set Version ID (component 16).  This is a convenience method that saves you from 
413     * casting and handling an exception.
414     */
415    public DTM getCwe16_ValueSetVersionID() {
416       return getTyped(15, DTM.class);
417    }
418
419
420    /**
421     * Returns Alternate Coding System OID (component 17).  This is a convenience method that saves you from 
422     * casting and handling an exception.
423     */
424    public ST getAlternateCodingSystemOID() {
425       return getTyped(16, ST.class);
426    }
427
428    
429    /**
430     * Returns Alternate Coding System OID (component 17).  This is a convenience method that saves you from 
431     * casting and handling an exception.
432     */
433    public ST getCwe17_AlternateCodingSystemOID() {
434       return getTyped(16, ST.class);
435    }
436
437
438    /**
439     * Returns Alternate Value Set OID (component 18).  This is a convenience method that saves you from 
440     * casting and handling an exception.
441     */
442    public ST getAlternateValueSetOID() {
443       return getTyped(17, ST.class);
444    }
445
446    
447    /**
448     * Returns Alternate Value Set OID (component 18).  This is a convenience method that saves you from 
449     * casting and handling an exception.
450     */
451    public ST getCwe18_AlternateValueSetOID() {
452       return getTyped(17, ST.class);
453    }
454
455
456    /**
457     * Returns Alternate Value Set Version ID (component 19).  This is a convenience method that saves you from 
458     * casting and handling an exception.
459     */
460    public DTM getAlternateValueSetVersionID() {
461       return getTyped(18, DTM.class);
462    }
463
464    
465    /**
466     * Returns Alternate Value Set Version ID (component 19).  This is a convenience method that saves you from 
467     * casting and handling an exception.
468     */
469    public DTM getCwe19_AlternateValueSetVersionID() {
470       return getTyped(18, DTM.class);
471    }
472
473
474    /**
475     * Returns Second Alternate Coding System OID (component 20).  This is a convenience method that saves you from 
476     * casting and handling an exception.
477     */
478    public ST getSecondAlternateCodingSystemOID() {
479       return getTyped(19, ST.class);
480    }
481
482    
483    /**
484     * Returns Second Alternate Coding System OID (component 20).  This is a convenience method that saves you from 
485     * casting and handling an exception.
486     */
487    public ST getCwe20_SecondAlternateCodingSystemOID() {
488       return getTyped(19, ST.class);
489    }
490
491
492    /**
493     * Returns Second Alternate Value Set OID (component 21).  This is a convenience method that saves you from 
494     * casting and handling an exception.
495     */
496    public ST getSecondAlternateValueSetOID() {
497       return getTyped(20, ST.class);
498    }
499
500    
501    /**
502     * Returns Second Alternate Value Set OID (component 21).  This is a convenience method that saves you from 
503     * casting and handling an exception.
504     */
505    public ST getCwe21_SecondAlternateValueSetOID() {
506       return getTyped(20, ST.class);
507    }
508
509
510    /**
511     * Returns Second Alternate Value Set Version ID (component 22).  This is a convenience method that saves you from 
512     * casting and handling an exception.
513     */
514    public DTM getSecondAlternateValueSetVersionID() {
515       return getTyped(21, DTM.class);
516    }
517
518    
519    /**
520     * Returns Second Alternate Value Set Version ID (component 22).  This is a convenience method that saves you from 
521     * casting and handling an exception.
522     */
523    public DTM getCwe22_SecondAlternateValueSetVersionID() {
524       return getTyped(21, DTM.class);
525    }
526
527
528
529}
530