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 "LA2.java".  Description:
15   * "Composite class LA2"
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 LA2 (Location with Address Variation 2) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>Point of Care (IS)
46   * <li>Room (IS)
47   * <li>Bed (IS)
48   * <li>Facility (HD)
49   * <li>Location Status (IS)
50   * <li>Patient Location Type (IS)
51   * <li>Building (IS)
52   * <li>Floor (IS)
53   * <li>Street Address (ST)
54   * <li>Other Designation (ST)
55   * <li>City (ST)
56   * <li>State or Province (ST)
57   * <li>Zip or Postal Code (ST)
58   * <li>Country (ID)
59   * <li>Address Type (ID)
60   * <li>Other Geographic Designation (ST)
61   * </ul>
62   */
63  @SuppressWarnings("unused")
64  public class LA2 extends AbstractComposite {
65  
66      private Type[] data;
67  
68      /** 
69       * Creates a new LA2 type
70       */
71      public LA2(Message message) {
72          super(message);
73          init();
74      }
75  
76      private void init() {
77          data = new Type[16];    
78          data[0] = new IS(getMessage(), 302);
79          data[1] = new IS(getMessage(), 303);
80          data[2] = new IS(getMessage(), 304);
81          data[3] = new HD(getMessage());
82          data[4] = new IS(getMessage(), 306);
83          data[5] = new IS(getMessage(), 305);
84          data[6] = new IS(getMessage(), 307);
85          data[7] = new IS(getMessage(), 308);
86          data[8] = new ST(getMessage());
87          data[9] = new ST(getMessage());
88          data[10] = new ST(getMessage());
89          data[11] = new ST(getMessage());
90          data[12] = new ST(getMessage());
91          data[13] = new ID(getMessage(), 399);
92          data[14] = new ID(getMessage(), 190);
93          data[15] = new ST(getMessage());
94      }
95  
96  
97      /**
98       * Returns an array containing the data elements.
99       */
100     public Type[] getComponents() { 
101         return this.data; 
102     }
103 
104     /**
105      * Returns an individual data component.
106      *
107      * @param number The component number (0-indexed)
108      * @throws DataTypeException if the given element number is out of range.
109      */
110     public Type getComponent(int number) throws DataTypeException { 
111 
112         try { 
113             return this.data[number]; 
114         } catch (ArrayIndexOutOfBoundsException e) { 
115             throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
116         } 
117     } 
118 
119 
120     /**
121      * Returns Point of Care (component 1).  This is a convenience method that saves you from 
122      * casting and handling an exception.
123      */
124     public IS getPointOfCare() {
125        return getTyped(0, IS.class);
126     }
127 
128     
129     /**
130      * Returns Point of Care (component 1).  This is a convenience method that saves you from 
131      * casting and handling an exception.
132      */
133     public IS getLa21_PointOfCare() {
134        return getTyped(0, IS.class);
135     }
136 
137 
138     /**
139      * Returns Room (component 2).  This is a convenience method that saves you from 
140      * casting and handling an exception.
141      */
142     public IS getRoom() {
143        return getTyped(1, IS.class);
144     }
145 
146     
147     /**
148      * Returns Room (component 2).  This is a convenience method that saves you from 
149      * casting and handling an exception.
150      */
151     public IS getLa22_Room() {
152        return getTyped(1, IS.class);
153     }
154 
155 
156     /**
157      * Returns Bed (component 3).  This is a convenience method that saves you from 
158      * casting and handling an exception.
159      */
160     public IS getBed() {
161        return getTyped(2, IS.class);
162     }
163 
164     
165     /**
166      * Returns Bed (component 3).  This is a convenience method that saves you from 
167      * casting and handling an exception.
168      */
169     public IS getLa23_Bed() {
170        return getTyped(2, IS.class);
171     }
172 
173 
174     /**
175      * Returns Facility (component 4).  This is a convenience method that saves you from 
176      * casting and handling an exception.
177      */
178     public HD getFacility() {
179        return getTyped(3, HD.class);
180     }
181 
182     
183     /**
184      * Returns Facility (component 4).  This is a convenience method that saves you from 
185      * casting and handling an exception.
186      */
187     public HD getLa24_Facility() {
188        return getTyped(3, HD.class);
189     }
190 
191 
192     /**
193      * Returns Location Status (component 5).  This is a convenience method that saves you from 
194      * casting and handling an exception.
195      */
196     public IS getLocationStatus() {
197        return getTyped(4, IS.class);
198     }
199 
200     
201     /**
202      * Returns Location Status (component 5).  This is a convenience method that saves you from 
203      * casting and handling an exception.
204      */
205     public IS getLa25_LocationStatus() {
206        return getTyped(4, IS.class);
207     }
208 
209 
210     /**
211      * Returns Patient Location Type (component 6).  This is a convenience method that saves you from 
212      * casting and handling an exception.
213      */
214     public IS getPatientLocationType() {
215        return getTyped(5, IS.class);
216     }
217 
218     
219     /**
220      * Returns Patient Location Type (component 6).  This is a convenience method that saves you from 
221      * casting and handling an exception.
222      */
223     public IS getLa26_PatientLocationType() {
224        return getTyped(5, IS.class);
225     }
226 
227 
228     /**
229      * Returns Building (component 7).  This is a convenience method that saves you from 
230      * casting and handling an exception.
231      */
232     public IS getBuilding() {
233        return getTyped(6, IS.class);
234     }
235 
236     
237     /**
238      * Returns Building (component 7).  This is a convenience method that saves you from 
239      * casting and handling an exception.
240      */
241     public IS getLa27_Building() {
242        return getTyped(6, IS.class);
243     }
244 
245 
246     /**
247      * Returns Floor (component 8).  This is a convenience method that saves you from 
248      * casting and handling an exception.
249      */
250     public IS getFloor() {
251        return getTyped(7, IS.class);
252     }
253 
254     
255     /**
256      * Returns Floor (component 8).  This is a convenience method that saves you from 
257      * casting and handling an exception.
258      */
259     public IS getLa28_Floor() {
260        return getTyped(7, IS.class);
261     }
262 
263 
264     /**
265      * Returns Street Address (component 9).  This is a convenience method that saves you from 
266      * casting and handling an exception.
267      */
268     public ST getStreetAddress() {
269        return getTyped(8, ST.class);
270     }
271 
272     
273     /**
274      * Returns Street Address (component 9).  This is a convenience method that saves you from 
275      * casting and handling an exception.
276      */
277     public ST getLa29_StreetAddress() {
278        return getTyped(8, ST.class);
279     }
280 
281 
282     /**
283      * Returns Other Designation (component 10).  This is a convenience method that saves you from 
284      * casting and handling an exception.
285      */
286     public ST getOtherDesignation() {
287        return getTyped(9, ST.class);
288     }
289 
290     
291     /**
292      * Returns Other Designation (component 10).  This is a convenience method that saves you from 
293      * casting and handling an exception.
294      */
295     public ST getLa210_OtherDesignation() {
296        return getTyped(9, ST.class);
297     }
298 
299 
300     /**
301      * Returns City (component 11).  This is a convenience method that saves you from 
302      * casting and handling an exception.
303      */
304     public ST getCity() {
305        return getTyped(10, ST.class);
306     }
307 
308     
309     /**
310      * Returns City (component 11).  This is a convenience method that saves you from 
311      * casting and handling an exception.
312      */
313     public ST getLa211_City() {
314        return getTyped(10, ST.class);
315     }
316 
317 
318     /**
319      * Returns State or Province (component 12).  This is a convenience method that saves you from 
320      * casting and handling an exception.
321      */
322     public ST getStateOrProvince() {
323        return getTyped(11, ST.class);
324     }
325 
326     
327     /**
328      * Returns State or Province (component 12).  This is a convenience method that saves you from 
329      * casting and handling an exception.
330      */
331     public ST getLa212_StateOrProvince() {
332        return getTyped(11, ST.class);
333     }
334 
335 
336     /**
337      * Returns Zip or Postal Code (component 13).  This is a convenience method that saves you from 
338      * casting and handling an exception.
339      */
340     public ST getZipOrPostalCode() {
341        return getTyped(12, ST.class);
342     }
343 
344     
345     /**
346      * Returns Zip or Postal Code (component 13).  This is a convenience method that saves you from 
347      * casting and handling an exception.
348      */
349     public ST getLa213_ZipOrPostalCode() {
350        return getTyped(12, ST.class);
351     }
352 
353 
354     /**
355      * Returns Country (component 14).  This is a convenience method that saves you from 
356      * casting and handling an exception.
357      */
358     public ID getCountry() {
359        return getTyped(13, ID.class);
360     }
361 
362     
363     /**
364      * Returns Country (component 14).  This is a convenience method that saves you from 
365      * casting and handling an exception.
366      */
367     public ID getLa214_Country() {
368        return getTyped(13, ID.class);
369     }
370 
371 
372     /**
373      * Returns Address Type (component 15).  This is a convenience method that saves you from 
374      * casting and handling an exception.
375      */
376     public ID getAddressType() {
377        return getTyped(14, ID.class);
378     }
379 
380     
381     /**
382      * Returns Address Type (component 15).  This is a convenience method that saves you from 
383      * casting and handling an exception.
384      */
385     public ID getLa215_AddressType() {
386        return getTyped(14, ID.class);
387     }
388 
389 
390     /**
391      * Returns Other Geographic Designation (component 16).  This is a convenience method that saves you from 
392      * casting and handling an exception.
393      */
394     public ST getOtherGeographicDesignation() {
395        return getTyped(15, ST.class);
396     }
397 
398     
399     /**
400      * Returns Other Geographic Designation (component 16).  This is a convenience method that saves you from 
401      * casting and handling an exception.
402      */
403     public ST getLa216_OtherGeographicDesignation() {
404        return getTyped(15, ST.class);
405     }
406 
407 
408 
409 }
410