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 "CNN.java".  Description:
15   * "Composite class CNN"
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 CNN (Composite ID Number and Name Simplified) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>ID Number (ST)
46   * <li>Family Name (ST)
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   - Namespace ID (IS)
54   * <li>Assigning Authority  - Universal ID (ST)
55   * <li>Assigning Authority  - Universal ID Type (ID)
56   * </ul>
57   */
58  @SuppressWarnings("unused")
59  public class CNN extends AbstractComposite {
60  
61      private Type[] data;
62  
63      /** 
64       * Creates a new CNN type
65       */
66      public CNN(Message message) {
67          super(message);
68          init();
69      }
70  
71      private void init() {
72          data = new Type[11];    
73          data[0] = new ST(getMessage());
74          data[1] = new ST(getMessage());
75          data[2] = new ST(getMessage());
76          data[3] = new ST(getMessage());
77          data[4] = new ST(getMessage());
78          data[5] = new ST(getMessage());
79          data[6] = new IS(getMessage(), 360);
80          data[7] = new IS(getMessage(), 297);
81          data[8] = new IS(getMessage(), 363);
82          data[9] = new ST(getMessage());
83          data[10] = new ID(getMessage(), 301);
84      }
85  
86  
87      /**
88       * Returns an array containing the data elements.
89       */
90      public Type[] getComponents() { 
91          return this.data; 
92      }
93  
94      /**
95       * Returns an individual data component.
96       *
97       * @param number The component number (0-indexed)
98       * @throws DataTypeException if the given element number is out of range.
99       */
100     public Type getComponent(int number) throws DataTypeException { 
101 
102         try { 
103             return this.data[number]; 
104         } catch (ArrayIndexOutOfBoundsException e) { 
105             throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
106         } 
107     } 
108 
109 
110     /**
111      * Returns ID Number (component 1).  This is a convenience method that saves you from 
112      * casting and handling an exception.
113      */
114     public ST getIDNumber() {
115        return getTyped(0, ST.class);
116     }
117 
118     
119     /**
120      * Returns ID Number (component 1).  This is a convenience method that saves you from 
121      * casting and handling an exception.
122      */
123     public ST getCnn1_IDNumber() {
124        return getTyped(0, ST.class);
125     }
126 
127 
128     /**
129      * Returns Family Name (component 2).  This is a convenience method that saves you from 
130      * casting and handling an exception.
131      */
132     public ST getFamilyName() {
133        return getTyped(1, ST.class);
134     }
135 
136     
137     /**
138      * Returns Family Name (component 2).  This is a convenience method that saves you from 
139      * casting and handling an exception.
140      */
141     public ST getCnn2_FamilyName() {
142        return getTyped(1, ST.class);
143     }
144 
145 
146     /**
147      * Returns Given Name (component 3).  This is a convenience method that saves you from 
148      * casting and handling an exception.
149      */
150     public ST getGivenName() {
151        return getTyped(2, ST.class);
152     }
153 
154     
155     /**
156      * Returns Given Name (component 3).  This is a convenience method that saves you from 
157      * casting and handling an exception.
158      */
159     public ST getCnn3_GivenName() {
160        return getTyped(2, ST.class);
161     }
162 
163 
164     /**
165      * Returns Second and Further Given Names or Initials Thereof (component 4).  This is a convenience method that saves you from 
166      * casting and handling an exception.
167      */
168     public ST getSecondAndFurtherGivenNamesOrInitialsThereof() {
169        return getTyped(3, ST.class);
170     }
171 
172     
173     /**
174      * Returns Second and Further Given Names or Initials Thereof (component 4).  This is a convenience method that saves you from 
175      * casting and handling an exception.
176      */
177     public ST getCnn4_SecondAndFurtherGivenNamesOrInitialsThereof() {
178        return getTyped(3, ST.class);
179     }
180 
181 
182     /**
183      * Returns Suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
184      * casting and handling an exception.
185      */
186     public ST getSuffixEgJRorIII() {
187        return getTyped(4, ST.class);
188     }
189 
190     
191     /**
192      * Returns Suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
193      * casting and handling an exception.
194      */
195     public ST getCnn5_SuffixEgJRorIII() {
196        return getTyped(4, ST.class);
197     }
198 
199 
200     /**
201      * Returns Prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
202      * casting and handling an exception.
203      */
204     public ST getPrefixEgDR() {
205        return getTyped(5, ST.class);
206     }
207 
208     
209     /**
210      * Returns Prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
211      * casting and handling an exception.
212      */
213     public ST getCnn6_PrefixEgDR() {
214        return getTyped(5, ST.class);
215     }
216 
217 
218     /**
219      * Returns Degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
220      * casting and handling an exception.
221      */
222     public IS getDegreeEgMD() {
223        return getTyped(6, IS.class);
224     }
225 
226     
227     /**
228      * Returns Degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
229      * casting and handling an exception.
230      */
231     public IS getCnn7_DegreeEgMD() {
232        return getTyped(6, IS.class);
233     }
234 
235 
236     /**
237      * Returns Source Table (component 8).  This is a convenience method that saves you from 
238      * casting and handling an exception.
239      */
240     public IS getSourceTable() {
241        return getTyped(7, IS.class);
242     }
243 
244     
245     /**
246      * Returns Source Table (component 8).  This is a convenience method that saves you from 
247      * casting and handling an exception.
248      */
249     public IS getCnn8_SourceTable() {
250        return getTyped(7, IS.class);
251     }
252 
253 
254     /**
255      * Returns Assigning Authority   - Namespace ID (component 9).  This is a convenience method that saves you from 
256      * casting and handling an exception.
257      */
258     public IS getAssigningAuthorityNamespaceID() {
259        return getTyped(8, IS.class);
260     }
261 
262     
263     /**
264      * Returns Assigning Authority   - Namespace ID (component 9).  This is a convenience method that saves you from 
265      * casting and handling an exception.
266      */
267     public IS getCnn9_AssigningAuthorityNamespaceID() {
268        return getTyped(8, IS.class);
269     }
270 
271 
272     /**
273      * Returns Assigning Authority  - Universal ID (component 10).  This is a convenience method that saves you from 
274      * casting and handling an exception.
275      */
276     public ST getAssigningAuthorityUniversalID() {
277        return getTyped(9, ST.class);
278     }
279 
280     
281     /**
282      * Returns Assigning Authority  - Universal ID (component 10).  This is a convenience method that saves you from 
283      * casting and handling an exception.
284      */
285     public ST getCnn10_AssigningAuthorityUniversalID() {
286        return getTyped(9, ST.class);
287     }
288 
289 
290     /**
291      * Returns Assigning Authority  - Universal ID Type (component 11).  This is a convenience method that saves you from 
292      * casting and handling an exception.
293      */
294     public ID getAssigningAuthorityUniversalIDType() {
295        return getTyped(10, ID.class);
296     }
297 
298     
299     /**
300      * Returns Assigning Authority  - Universal ID Type (component 11).  This is a convenience method that saves you from 
301      * casting and handling an exception.
302      */
303     public ID getCnn11_AssigningAuthorityUniversalIDType() {
304        return getTyped(10, ID.class);
305     }
306 
307 
308 
309 }
310