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 "LA2.java".  Description:
015 * "Composite class LA2"
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.v25.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 LA2 (Location with Address Variation 2) data type. 
043 * This type consists of the following components:</p>
044 * <ul>
045 * <li>Point of Care (IS)
046 * <li>Room (IS)
047 * <li>Bed (IS)
048 * <li>Facility (HD)
049 * <li>Location Status (IS)
050 * <li>Patient Location Type (IS)
051 * <li>Building (IS)
052 * <li>Floor (IS)
053 * <li>Street Address (ST)
054 * <li>Other Designation (ST)
055 * <li>City (ST)
056 * <li>State or Province (ST)
057 * <li>Zip or Postal Code (ST)
058 * <li>Country (ID)
059 * <li>Address Type (ID)
060 * <li>Other Geographic Designation (ST)
061 * </ul>
062 */
063@SuppressWarnings("unused")
064public class LA2 extends AbstractComposite {
065
066    private Type[] data;
067
068    /** 
069     * Creates a new LA2 type
070     */
071    public LA2(Message message) {
072        super(message);
073        init();
074    }
075
076    private void init() {
077        data = new Type[16];    
078        data[0] = new IS(getMessage(), 302);
079        data[1] = new IS(getMessage(), 303);
080        data[2] = new IS(getMessage(), 304);
081        data[3] = new HD(getMessage());
082        data[4] = new IS(getMessage(), 306);
083        data[5] = new IS(getMessage(), 305);
084        data[6] = new IS(getMessage(), 307);
085        data[7] = new IS(getMessage(), 308);
086        data[8] = new ST(getMessage());
087        data[9] = new ST(getMessage());
088        data[10] = new ST(getMessage());
089        data[11] = new ST(getMessage());
090        data[12] = new ST(getMessage());
091        data[13] = new ID(getMessage(), 399);
092        data[14] = new ID(getMessage(), 190);
093        data[15] = new ST(getMessage());
094    }
095
096
097    /**
098     * Returns an array containing the data elements.
099     */
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