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 "CX.java".  Description:
15   * "Composite class CX"
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 CX (Extended Composite ID with Check Digit) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>ID Number (ST)
46   * <li>Identifier Check Digit (ST)
47   * <li>Check Digit Scheme (ID)
48   * <li>Assigning Authority (HD)
49   * <li>Identifier Type Code (ID)
50   * <li>Assigning Facility (HD)
51   * <li>Effective Date (DT)
52   * <li>Expiration Date (DT)
53   * <li>Assigning Jurisdiction (CWE)
54   * <li>Assigning Agency or Department (CWE)
55   * <li>Security Check (ST)
56   * <li>Security Check Scheme (ID)
57   * </ul>
58   */
59  @SuppressWarnings("unused")
60  public class CX extends AbstractComposite {
61  
62      private Type[] data;
63  
64      /** 
65       * Creates a new CX type
66       */
67      public CX(Message message) {
68          super(message);
69          init();
70      }
71  
72      private void init() {
73          data = new Type[12];    
74          data[0] = new ST(getMessage());
75          data[1] = new ST(getMessage());
76          data[2] = new ID(getMessage(), 61);
77          data[3] = new HD(getMessage());
78          data[4] = new ID(getMessage(), 203);
79          data[5] = new HD(getMessage());
80          data[6] = new DT(getMessage());
81          data[7] = new DT(getMessage());
82          data[8] = new CWE(getMessage());
83          data[9] = new CWE(getMessage());
84          data[10] = new ST(getMessage());
85          data[11] = new ID(getMessage(), 904);
86      }
87  
88  
89      /**
90       * Returns an array containing the data elements.
91       */
92      public Type[] getComponents() { 
93          return this.data; 
94      }
95  
96      /**
97       * Returns an individual data component.
98       *
99       * @param number The component number (0-indexed)
100      * @throws DataTypeException if the given element number is out of range.
101      */
102     public Type getComponent(int number) throws DataTypeException { 
103 
104         try { 
105             return this.data[number]; 
106         } catch (ArrayIndexOutOfBoundsException e) { 
107             throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
108         } 
109     } 
110 
111 
112     /**
113      * Returns ID Number (component 1).  This is a convenience method that saves you from 
114      * casting and handling an exception.
115      */
116     public ST getIDNumber() {
117        return getTyped(0, ST.class);
118     }
119 
120     
121     /**
122      * Returns ID Number (component 1).  This is a convenience method that saves you from 
123      * casting and handling an exception.
124      */
125     public ST getCx1_IDNumber() {
126        return getTyped(0, ST.class);
127     }
128 
129 
130     /**
131      * Returns Identifier Check Digit (component 2).  This is a convenience method that saves you from 
132      * casting and handling an exception.
133      */
134     public ST getIdentifierCheckDigit() {
135        return getTyped(1, ST.class);
136     }
137 
138     
139     /**
140      * Returns Identifier Check Digit (component 2).  This is a convenience method that saves you from 
141      * casting and handling an exception.
142      */
143     public ST getCx2_IdentifierCheckDigit() {
144        return getTyped(1, ST.class);
145     }
146 
147 
148     /**
149      * Returns Check Digit Scheme (component 3).  This is a convenience method that saves you from 
150      * casting and handling an exception.
151      */
152     public ID getCheckDigitScheme() {
153        return getTyped(2, ID.class);
154     }
155 
156     
157     /**
158      * Returns Check Digit Scheme (component 3).  This is a convenience method that saves you from 
159      * casting and handling an exception.
160      */
161     public ID getCx3_CheckDigitScheme() {
162        return getTyped(2, ID.class);
163     }
164 
165 
166     /**
167      * Returns Assigning Authority (component 4).  This is a convenience method that saves you from 
168      * casting and handling an exception.
169      */
170     public HD getAssigningAuthority() {
171        return getTyped(3, HD.class);
172     }
173 
174     
175     /**
176      * Returns Assigning Authority (component 4).  This is a convenience method that saves you from 
177      * casting and handling an exception.
178      */
179     public HD getCx4_AssigningAuthority() {
180        return getTyped(3, HD.class);
181     }
182 
183 
184     /**
185      * Returns Identifier Type Code (component 5).  This is a convenience method that saves you from 
186      * casting and handling an exception.
187      */
188     public ID getIdentifierTypeCode() {
189        return getTyped(4, ID.class);
190     }
191 
192     
193     /**
194      * Returns Identifier Type Code (component 5).  This is a convenience method that saves you from 
195      * casting and handling an exception.
196      */
197     public ID getCx5_IdentifierTypeCode() {
198        return getTyped(4, ID.class);
199     }
200 
201 
202     /**
203      * Returns Assigning Facility (component 6).  This is a convenience method that saves you from 
204      * casting and handling an exception.
205      */
206     public HD getAssigningFacility() {
207        return getTyped(5, HD.class);
208     }
209 
210     
211     /**
212      * Returns Assigning Facility (component 6).  This is a convenience method that saves you from 
213      * casting and handling an exception.
214      */
215     public HD getCx6_AssigningFacility() {
216        return getTyped(5, HD.class);
217     }
218 
219 
220     /**
221      * Returns Effective Date (component 7).  This is a convenience method that saves you from 
222      * casting and handling an exception.
223      */
224     public DT getEffectiveDate() {
225        return getTyped(6, DT.class);
226     }
227 
228     
229     /**
230      * Returns Effective Date (component 7).  This is a convenience method that saves you from 
231      * casting and handling an exception.
232      */
233     public DT getCx7_EffectiveDate() {
234        return getTyped(6, DT.class);
235     }
236 
237 
238     /**
239      * Returns Expiration Date (component 8).  This is a convenience method that saves you from 
240      * casting and handling an exception.
241      */
242     public DT getExpirationDate() {
243        return getTyped(7, DT.class);
244     }
245 
246     
247     /**
248      * Returns Expiration Date (component 8).  This is a convenience method that saves you from 
249      * casting and handling an exception.
250      */
251     public DT getCx8_ExpirationDate() {
252        return getTyped(7, DT.class);
253     }
254 
255 
256     /**
257      * Returns Assigning Jurisdiction (component 9).  This is a convenience method that saves you from 
258      * casting and handling an exception.
259      */
260     public CWE getAssigningJurisdiction() {
261        return getTyped(8, CWE.class);
262     }
263 
264     
265     /**
266      * Returns Assigning Jurisdiction (component 9).  This is a convenience method that saves you from 
267      * casting and handling an exception.
268      */
269     public CWE getCx9_AssigningJurisdiction() {
270        return getTyped(8, CWE.class);
271     }
272 
273 
274     /**
275      * Returns Assigning Agency or Department (component 10).  This is a convenience method that saves you from 
276      * casting and handling an exception.
277      */
278     public CWE getAssigningAgencyOrDepartment() {
279        return getTyped(9, CWE.class);
280     }
281 
282     
283     /**
284      * Returns Assigning Agency or Department (component 10).  This is a convenience method that saves you from 
285      * casting and handling an exception.
286      */
287     public CWE getCx10_AssigningAgencyOrDepartment() {
288        return getTyped(9, CWE.class);
289     }
290 
291 
292     /**
293      * Returns Security Check (component 11).  This is a convenience method that saves you from 
294      * casting and handling an exception.
295      */
296     public ST getSecurityCheck() {
297        return getTyped(10, ST.class);
298     }
299 
300     
301     /**
302      * Returns Security Check (component 11).  This is a convenience method that saves you from 
303      * casting and handling an exception.
304      */
305     public ST getCx11_SecurityCheck() {
306        return getTyped(10, ST.class);
307     }
308 
309 
310     /**
311      * Returns Security Check Scheme (component 12).  This is a convenience method that saves you from 
312      * casting and handling an exception.
313      */
314     public ID getSecurityCheckScheme() {
315        return getTyped(11, ID.class);
316     }
317 
318     
319     /**
320      * Returns Security Check Scheme (component 12).  This is a convenience method that saves you from 
321      * casting and handling an exception.
322      */
323     public ID getCx12_SecurityCheckScheme() {
324        return getTyped(11, ID.class);
325     }
326 
327 
328 
329 }
330