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 "CSU.java".  Description:
15   * "Composite class CSU"
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.v27.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 CSU (Channel Sensitivity and Units) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>Channel Sensitivity (NM)
46   * <li>Unit of Measure Identifier (ST)
47   * <li>Unit of Measure Description (ST)
48   * <li>Unit of Measure Coding System (ID)
49   * <li>Alternate Unit of Measure Identifier (ST)
50   * <li>Alternate Unit of Measure Description (ST)
51   * <li>Alternate Unit of Measure Coding System (ID)
52   * <li>Unit of Measure Coding System Version ID (ST)
53   * <li>Alternate Unit of Measure Coding System Version ID (ST)
54   * <li>Original Text (ST)
55   * <li>Second Alternate Unit of Measure Identifier (ST)
56   * <li>Second Alternate Unit of Measure Text (ST)
57   * <li>Name of Second Alternate Unit of Measure Coding Sy (ID)
58   * <li>Second Alternate Unit of Measure Coding System Ver (ST)
59   * <li>Unit of Measure Coding System OID (ST)
60   * <li>Unit of Measure Value Set OID (ST)
61   * <li>Unit of Measure Value Set Version ID (DTM)
62   * <li>Alternate Unit of Measure Coding System OID (ST)
63   * <li>Alternate Unit of Measure Value Set OID (ST)
64   * <li>Alternate Unit of Measure Value Set Version ID (DTM)
65   * <li>Alternate Unit of Measure Coding System OID2 (ST)
66   * <li>Alternate Unit of Measure Value Set OID2 (ST)
67   * <li>Alternate Unit of Measure Value Set Version ID2 (ST)
68   * </ul>
69   */
70  @SuppressWarnings("unused")
71  public class CSU extends AbstractComposite {
72  
73      private Type[] data;
74  
75      /** 
76       * Creates a new CSU type
77       */
78      public CSU(Message message) {
79          super(message);
80          init();
81      }
82  
83      private void init() {
84          data = new Type[23];    
85          data[0] = new NM(getMessage());
86          data[1] = new ST(getMessage());
87          data[2] = new ST(getMessage());
88          data[3] = new ID(getMessage(), 396);
89          data[4] = new ST(getMessage());
90          data[5] = new ST(getMessage());
91          data[6] = new ID(getMessage(), 396);
92          data[7] = new ST(getMessage());
93          data[8] = new ST(getMessage());
94          data[9] = new ST(getMessage());
95          data[10] = new ST(getMessage());
96          data[11] = new ST(getMessage());
97          data[12] = new ID(getMessage(), 396);
98          data[13] = new ST(getMessage());
99          data[14] = new ST(getMessage());
100         data[15] = new ST(getMessage());
101         data[16] = new DTM(getMessage());
102         data[17] = new ST(getMessage());
103         data[18] = new ST(getMessage());
104         data[19] = new DTM(getMessage());
105         data[20] = new ST(getMessage());
106         data[21] = new ST(getMessage());
107         data[22] = new ST(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 Channel Sensitivity (component 1).  This is a convenience method that saves you from 
136      * casting and handling an exception.
137      */
138     public NM getChannelSensitivity() {
139        return getTyped(0, NM.class);
140     }
141 
142     
143     /**
144      * Returns Channel Sensitivity (component 1).  This is a convenience method that saves you from 
145      * casting and handling an exception.
146      */
147     public NM getCsu1_ChannelSensitivity() {
148        return getTyped(0, NM.class);
149     }
150 
151 
152     /**
153      * Returns Unit of Measure Identifier (component 2).  This is a convenience method that saves you from 
154      * casting and handling an exception.
155      */
156     public ST getUnitOfMeasureIdentifier() {
157        return getTyped(1, ST.class);
158     }
159 
160     
161     /**
162      * Returns Unit of Measure Identifier (component 2).  This is a convenience method that saves you from 
163      * casting and handling an exception.
164      */
165     public ST getCsu2_UnitOfMeasureIdentifier() {
166        return getTyped(1, ST.class);
167     }
168 
169 
170     /**
171      * Returns Unit of Measure Description (component 3).  This is a convenience method that saves you from 
172      * casting and handling an exception.
173      */
174     public ST getUnitOfMeasureDescription() {
175        return getTyped(2, ST.class);
176     }
177 
178     
179     /**
180      * Returns Unit of Measure Description (component 3).  This is a convenience method that saves you from 
181      * casting and handling an exception.
182      */
183     public ST getCsu3_UnitOfMeasureDescription() {
184        return getTyped(2, ST.class);
185     }
186 
187 
188     /**
189      * Returns Unit of Measure Coding System (component 4).  This is a convenience method that saves you from 
190      * casting and handling an exception.
191      */
192     public ID getUnitOfMeasureCodingSystem() {
193        return getTyped(3, ID.class);
194     }
195 
196     
197     /**
198      * Returns Unit of Measure Coding System (component 4).  This is a convenience method that saves you from 
199      * casting and handling an exception.
200      */
201     public ID getCsu4_UnitOfMeasureCodingSystem() {
202        return getTyped(3, ID.class);
203     }
204 
205 
206     /**
207      * Returns Alternate Unit of Measure Identifier (component 5).  This is a convenience method that saves you from 
208      * casting and handling an exception.
209      */
210     public ST getAlternateUnitOfMeasureIdentifier() {
211        return getTyped(4, ST.class);
212     }
213 
214     
215     /**
216      * Returns Alternate Unit of Measure Identifier (component 5).  This is a convenience method that saves you from 
217      * casting and handling an exception.
218      */
219     public ST getCsu5_AlternateUnitOfMeasureIdentifier() {
220        return getTyped(4, ST.class);
221     }
222 
223 
224     /**
225      * Returns Alternate Unit of Measure Description (component 6).  This is a convenience method that saves you from 
226      * casting and handling an exception.
227      */
228     public ST getAlternateUnitOfMeasureDescription() {
229        return getTyped(5, ST.class);
230     }
231 
232     
233     /**
234      * Returns Alternate Unit of Measure Description (component 6).  This is a convenience method that saves you from 
235      * casting and handling an exception.
236      */
237     public ST getCsu6_AlternateUnitOfMeasureDescription() {
238        return getTyped(5, ST.class);
239     }
240 
241 
242     /**
243      * Returns Alternate Unit of Measure Coding System (component 7).  This is a convenience method that saves you from 
244      * casting and handling an exception.
245      */
246     public ID getAlternateUnitOfMeasureCodingSystem() {
247        return getTyped(6, ID.class);
248     }
249 
250     
251     /**
252      * Returns Alternate Unit of Measure Coding System (component 7).  This is a convenience method that saves you from 
253      * casting and handling an exception.
254      */
255     public ID getCsu7_AlternateUnitOfMeasureCodingSystem() {
256        return getTyped(6, ID.class);
257     }
258 
259 
260     /**
261      * Returns Unit of Measure Coding System Version ID (component 8).  This is a convenience method that saves you from 
262      * casting and handling an exception.
263      */
264     public ST getUnitOfMeasureCodingSystemVersionID() {
265        return getTyped(7, ST.class);
266     }
267 
268     
269     /**
270      * Returns Unit of Measure Coding System Version ID (component 8).  This is a convenience method that saves you from 
271      * casting and handling an exception.
272      */
273     public ST getCsu8_UnitOfMeasureCodingSystemVersionID() {
274        return getTyped(7, ST.class);
275     }
276 
277 
278     /**
279      * Returns Alternate Unit of Measure Coding System Version ID (component 9).  This is a convenience method that saves you from 
280      * casting and handling an exception.
281      */
282     public ST getAlternateUnitOfMeasureCodingSystemVersionID() {
283        return getTyped(8, ST.class);
284     }
285 
286     
287     /**
288      * Returns Alternate Unit of Measure Coding System Version ID (component 9).  This is a convenience method that saves you from 
289      * casting and handling an exception.
290      */
291     public ST getCsu9_AlternateUnitOfMeasureCodingSystemVersionID() {
292        return getTyped(8, ST.class);
293     }
294 
295 
296     /**
297      * Returns Original Text (component 10).  This is a convenience method that saves you from 
298      * casting and handling an exception.
299      */
300     public ST getOriginalText() {
301        return getTyped(9, ST.class);
302     }
303 
304     
305     /**
306      * Returns Original Text (component 10).  This is a convenience method that saves you from 
307      * casting and handling an exception.
308      */
309     public ST getCsu10_OriginalText() {
310        return getTyped(9, ST.class);
311     }
312 
313 
314     /**
315      * Returns Second Alternate Unit of Measure Identifier (component 11).  This is a convenience method that saves you from 
316      * casting and handling an exception.
317      */
318     public ST getSecondAlternateUnitOfMeasureIdentifier() {
319        return getTyped(10, ST.class);
320     }
321 
322     
323     /**
324      * Returns Second Alternate Unit of Measure Identifier (component 11).  This is a convenience method that saves you from 
325      * casting and handling an exception.
326      */
327     public ST getCsu11_SecondAlternateUnitOfMeasureIdentifier() {
328        return getTyped(10, ST.class);
329     }
330 
331 
332     /**
333      * Returns Second Alternate Unit of Measure Text (component 12).  This is a convenience method that saves you from 
334      * casting and handling an exception.
335      */
336     public ST getSecondAlternateUnitOfMeasureText() {
337        return getTyped(11, ST.class);
338     }
339 
340     
341     /**
342      * Returns Second Alternate Unit of Measure Text (component 12).  This is a convenience method that saves you from 
343      * casting and handling an exception.
344      */
345     public ST getCsu12_SecondAlternateUnitOfMeasureText() {
346        return getTyped(11, ST.class);
347     }
348 
349 
350     /**
351      * Returns Name of Second Alternate Unit of Measure Coding Sy (component 13).  This is a convenience method that saves you from 
352      * casting and handling an exception.
353      */
354     public ID getNameOfSecondAlternateUnitOfMeasureCodingSy() {
355        return getTyped(12, ID.class);
356     }
357 
358     
359     /**
360      * Returns Name of Second Alternate Unit of Measure Coding Sy (component 13).  This is a convenience method that saves you from 
361      * casting and handling an exception.
362      */
363     public ID getCsu13_NameOfSecondAlternateUnitOfMeasureCodingSy() {
364        return getTyped(12, ID.class);
365     }
366 
367 
368     /**
369      * Returns Second Alternate Unit of Measure Coding System Ver (component 14).  This is a convenience method that saves you from 
370      * casting and handling an exception.
371      */
372     public ST getSecondAlternateUnitOfMeasureCodingSystemVer() {
373        return getTyped(13, ST.class);
374     }
375 
376     
377     /**
378      * Returns Second Alternate Unit of Measure Coding System Ver (component 14).  This is a convenience method that saves you from 
379      * casting and handling an exception.
380      */
381     public ST getCsu14_SecondAlternateUnitOfMeasureCodingSystemVer() {
382        return getTyped(13, ST.class);
383     }
384 
385 
386     /**
387      * Returns Unit of Measure Coding System OID (component 15).  This is a convenience method that saves you from 
388      * casting and handling an exception.
389      */
390     public ST getUnitOfMeasureCodingSystemOID() {
391        return getTyped(14, ST.class);
392     }
393 
394     
395     /**
396      * Returns Unit of Measure Coding System OID (component 15).  This is a convenience method that saves you from 
397      * casting and handling an exception.
398      */
399     public ST getCsu15_UnitOfMeasureCodingSystemOID() {
400        return getTyped(14, ST.class);
401     }
402 
403 
404     /**
405      * Returns Unit of Measure Value Set OID (component 16).  This is a convenience method that saves you from 
406      * casting and handling an exception.
407      */
408     public ST getUnitOfMeasureValueSetOID() {
409        return getTyped(15, ST.class);
410     }
411 
412     
413     /**
414      * Returns Unit of Measure Value Set OID (component 16).  This is a convenience method that saves you from 
415      * casting and handling an exception.
416      */
417     public ST getCsu16_UnitOfMeasureValueSetOID() {
418        return getTyped(15, ST.class);
419     }
420 
421 
422     /**
423      * Returns Unit of Measure Value Set Version ID (component 17).  This is a convenience method that saves you from 
424      * casting and handling an exception.
425      */
426     public DTM getUnitOfMeasureValueSetVersionID() {
427        return getTyped(16, DTM.class);
428     }
429 
430     
431     /**
432      * Returns Unit of Measure Value Set Version ID (component 17).  This is a convenience method that saves you from 
433      * casting and handling an exception.
434      */
435     public DTM getCsu17_UnitOfMeasureValueSetVersionID() {
436        return getTyped(16, DTM.class);
437     }
438 
439 
440     /**
441      * Returns Alternate Unit of Measure Coding System OID (component 18).  This is a convenience method that saves you from 
442      * casting and handling an exception.
443      */
444     public ST getAlternateUnitOfMeasureCodingSystemOID() {
445        return getTyped(17, ST.class);
446     }
447 
448     
449     /**
450      * Returns Alternate Unit of Measure Coding System OID (component 18).  This is a convenience method that saves you from 
451      * casting and handling an exception.
452      */
453     public ST getCsu18_AlternateUnitOfMeasureCodingSystemOID() {
454        return getTyped(17, ST.class);
455     }
456 
457 
458     /**
459      * Returns Alternate Unit of Measure Value Set OID (component 19).  This is a convenience method that saves you from 
460      * casting and handling an exception.
461      */
462     public ST getAlternateUnitOfMeasureValueSetOID() {
463        return getTyped(18, ST.class);
464     }
465 
466     
467     /**
468      * Returns Alternate Unit of Measure Value Set OID (component 19).  This is a convenience method that saves you from 
469      * casting and handling an exception.
470      */
471     public ST getCsu19_AlternateUnitOfMeasureValueSetOID() {
472        return getTyped(18, ST.class);
473     }
474 
475 
476     /**
477      * Returns Alternate Unit of Measure Value Set Version ID (component 20).  This is a convenience method that saves you from 
478      * casting and handling an exception.
479      */
480     public DTM getAlternateUnitOfMeasureValueSetVersionID() {
481        return getTyped(19, DTM.class);
482     }
483 
484     
485     /**
486      * Returns Alternate Unit of Measure Value Set Version ID (component 20).  This is a convenience method that saves you from 
487      * casting and handling an exception.
488      */
489     public DTM getCsu20_AlternateUnitOfMeasureValueSetVersionID() {
490        return getTyped(19, DTM.class);
491     }
492 
493 
494     /**
495      * Returns Alternate Unit of Measure Coding System OID2 (component 21).  This is a convenience method that saves you from 
496      * casting and handling an exception.
497      */
498     public ST getAlternateUnitOfMeasureCodingSystemOID2() {
499        return getTyped(20, ST.class);
500     }
501 
502     
503     /**
504      * Returns Alternate Unit of Measure Coding System OID2 (component 21).  This is a convenience method that saves you from 
505      * casting and handling an exception.
506      */
507     public ST getCsu21_AlternateUnitOfMeasureCodingSystemOID2() {
508        return getTyped(20, ST.class);
509     }
510 
511 
512     /**
513      * Returns Alternate Unit of Measure Value Set OID2 (component 22).  This is a convenience method that saves you from 
514      * casting and handling an exception.
515      */
516     public ST getAlternateUnitOfMeasureValueSetOID2() {
517        return getTyped(21, ST.class);
518     }
519 
520     
521     /**
522      * Returns Alternate Unit of Measure Value Set OID2 (component 22).  This is a convenience method that saves you from 
523      * casting and handling an exception.
524      */
525     public ST getCsu22_AlternateUnitOfMeasureValueSetOID2() {
526        return getTyped(21, ST.class);
527     }
528 
529 
530     /**
531      * Returns Alternate Unit of Measure Value Set Version ID2 (component 23).  This is a convenience method that saves you from 
532      * casting and handling an exception.
533      */
534     public ST getAlternateUnitOfMeasureValueSetVersionID2() {
535        return getTyped(22, ST.class);
536     }
537 
538     
539     /**
540      * Returns Alternate Unit of Measure Value Set Version ID2 (component 23).  This is a convenience method that saves you from 
541      * casting and handling an exception.
542      */
543     public ST getCsu23_AlternateUnitOfMeasureValueSetVersionID2() {
544        return getTyped(22, ST.class);
545     }
546 
547 
548 
549 }
550