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 "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  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.v24.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 * <p>Represents an HL7 PPN (performing person time stamp) data type. 
042 * This type consists of the following components:</p>
043 * <ul>
044 * <li>ID number (ST) (ST)
045 * <li>family name (FN)
046 * <li>given name (ST)
047 * <li>second and further given names or initials thereof (ST)
048 * <li>suffix (e.g., JR or III) (ST)
049 * <li>prefix (e.g., DR) (ST)
050 * <li>degree (e.g., MD) (IS)
051 * <li>source table (IS)
052 * <li>assigning authority (HD)
053 * <li>name type code (ID)
054 * <li>identifier check digit (ST)
055 * <li>code identifying the check digit scheme employed (ID)
056 * <li>identifier type code (IS) (IS)
057 * <li>assigning facility (HD)
058 * <li>Date/Time Action Performed (TS)
059 * <li>Name Representation code (ID)
060 * <li>name context (CE)
061 * <li>name validity range (DR)
062 * <li>name assembly order (ID)
063 * </ul>
064 */
065@SuppressWarnings("unused")
066public class PPN extends AbstractComposite {
067
068    private Type[] data;
069
070    /** 
071     * Creates a new PPN type
072     */
073    public PPN(Message message) {
074        super(message);
075        init();
076    }
077
078    private void init() {
079        data = new Type[19];    
080        data[0] = new ST(getMessage());
081        data[1] = new FN(getMessage());
082        data[2] = new ST(getMessage());
083        data[3] = new ST(getMessage());
084        data[4] = new ST(getMessage());
085        data[5] = new ST(getMessage());
086        data[6] = new IS(getMessage(), 0);
087        data[7] = new IS(getMessage(), 0);
088        data[8] = new HD(getMessage());
089        data[9] = new ID(getMessage(), 0);
090        data[10] = new ST(getMessage());
091        data[11] = new ID(getMessage(), 0);
092        data[12] = new IS(getMessage(), 0);
093        data[13] = new HD(getMessage());
094        data[14] = new TS(getMessage());
095        data[15] = new ID(getMessage(), 0);
096        data[16] = new CE(getMessage());
097        data[17] = new DR(getMessage());
098        data[18] = new ID(getMessage(), 0);
099    }
100
101
102    /**
103     * Returns an array containing the data elements.
104     */
105    public Type[] getComponents() { 
106        return this.data; 
107    }
108
109    /**
110     * Returns an individual data component.
111     *
112     * @param number The component number (0-indexed)
113     * @throws DataTypeException if the given element number is out of range.
114     */
115    public Type getComponent(int number) throws DataTypeException { 
116
117        try { 
118            return this.data[number]; 
119        } catch (ArrayIndexOutOfBoundsException e) { 
120            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
121        } 
122    } 
123
124
125    /**
126     * Returns ID number (ST) (component 1).  This is a convenience method that saves you from 
127     * casting and handling an exception.
128     */
129    public ST getIDNumber() {
130       return getTyped(0, ST.class);
131    }
132
133    
134    /**
135     * Returns ID number (ST) (component 1).  This is a convenience method that saves you from 
136     * casting and handling an exception.
137     */
138    public ST getPpn1_IDNumber() {
139       return getTyped(0, ST.class);
140    }
141
142
143    /**
144     * Returns family name (component 2).  This is a convenience method that saves you from 
145     * casting and handling an exception.
146     */
147    public FN getFamilyName() {
148       return getTyped(1, FN.class);
149    }
150
151    
152    /**
153     * Returns family name (component 2).  This is a convenience method that saves you from 
154     * casting and handling an exception.
155     */
156    public FN getPpn2_FamilyName() {
157       return getTyped(1, FN.class);
158    }
159
160
161    /**
162     * Returns given name (component 3).  This is a convenience method that saves you from 
163     * casting and handling an exception.
164     */
165    public ST getGivenName() {
166       return getTyped(2, ST.class);
167    }
168
169    
170    /**
171     * Returns given name (component 3).  This is a convenience method that saves you from 
172     * casting and handling an exception.
173     */
174    public ST getPpn3_GivenName() {
175       return getTyped(2, ST.class);
176    }
177
178
179    /**
180     * Returns second and further given names or initials thereof (component 4).  This is a convenience method that saves you from 
181     * casting and handling an exception.
182     */
183    public ST getSecondAndFurtherGivenNamesOrInitialsThereof() {
184       return getTyped(3, ST.class);
185    }
186
187    
188    /**
189     * Returns second and further given names or initials thereof (component 4).  This is a convenience method that saves you from 
190     * casting and handling an exception.
191     */
192    public ST getPpn4_SecondAndFurtherGivenNamesOrInitialsThereof() {
193       return getTyped(3, ST.class);
194    }
195
196
197    /**
198     * Returns suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
199     * casting and handling an exception.
200     */
201    public ST getSuffixEgJRorIII() {
202       return getTyped(4, ST.class);
203    }
204
205    
206    /**
207     * Returns suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
208     * casting and handling an exception.
209     */
210    public ST getPpn5_SuffixEgJRorIII() {
211       return getTyped(4, ST.class);
212    }
213
214
215    /**
216     * Returns prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
217     * casting and handling an exception.
218     */
219    public ST getPrefixEgDR() {
220       return getTyped(5, ST.class);
221    }
222
223    
224    /**
225     * Returns prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
226     * casting and handling an exception.
227     */
228    public ST getPpn6_PrefixEgDR() {
229       return getTyped(5, ST.class);
230    }
231
232
233    /**
234     * Returns degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
235     * casting and handling an exception.
236     */
237    public IS getDegreeEgMD() {
238       return getTyped(6, IS.class);
239    }
240
241    
242    /**
243     * Returns degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
244     * casting and handling an exception.
245     */
246    public IS getPpn7_DegreeEgMD() {
247       return getTyped(6, IS.class);
248    }
249
250
251    /**
252     * Returns source table (component 8).  This is a convenience method that saves you from 
253     * casting and handling an exception.
254     */
255    public IS getSourceTable() {
256       return getTyped(7, IS.class);
257    }
258
259    
260    /**
261     * Returns source table (component 8).  This is a convenience method that saves you from 
262     * casting and handling an exception.
263     */
264    public IS getPpn8_SourceTable() {
265       return getTyped(7, IS.class);
266    }
267
268
269    /**
270     * Returns assigning authority (component 9).  This is a convenience method that saves you from 
271     * casting and handling an exception.
272     */
273    public HD getAssigningAuthority() {
274       return getTyped(8, HD.class);
275    }
276
277    
278    /**
279     * Returns assigning authority (component 9).  This is a convenience method that saves you from 
280     * casting and handling an exception.
281     */
282    public HD getPpn9_AssigningAuthority() {
283       return getTyped(8, HD.class);
284    }
285
286
287    /**
288     * Returns name type code (component 10).  This is a convenience method that saves you from 
289     * casting and handling an exception.
290     */
291    public ID getNameTypeCode() {
292       return getTyped(9, ID.class);
293    }
294
295    
296    /**
297     * Returns name type code (component 10).  This is a convenience method that saves you from 
298     * casting and handling an exception.
299     */
300    public ID getPpn10_NameTypeCode() {
301       return getTyped(9, ID.class);
302    }
303
304
305    /**
306     * Returns identifier check digit (component 11).  This is a convenience method that saves you from 
307     * casting and handling an exception.
308     */
309    public ST getIdentifierCheckDigit() {
310       return getTyped(10, ST.class);
311    }
312
313    
314    /**
315     * Returns identifier check digit (component 11).  This is a convenience method that saves you from 
316     * casting and handling an exception.
317     */
318    public ST getPpn11_IdentifierCheckDigit() {
319       return getTyped(10, ST.class);
320    }
321
322
323    /**
324     * Returns code identifying the check digit scheme employed (component 12).  This is a convenience method that saves you from 
325     * casting and handling an exception.
326     */
327    public ID getCodeIdentifyingTheCheckDigitSchemeEmployed() {
328       return getTyped(11, ID.class);
329    }
330
331    
332    /**
333     * Returns code identifying the check digit scheme employed (component 12).  This is a convenience method that saves you from 
334     * casting and handling an exception.
335     */
336    public ID getPpn12_CodeIdentifyingTheCheckDigitSchemeEmployed() {
337       return getTyped(11, ID.class);
338    }
339
340
341    /**
342     * Returns identifier type code (IS) (component 13).  This is a convenience method that saves you from 
343     * casting and handling an exception.
344     */
345    public IS getIdentifierTypeCode() {
346       return getTyped(12, IS.class);
347    }
348
349    
350    /**
351     * Returns identifier type code (IS) (component 13).  This is a convenience method that saves you from 
352     * casting and handling an exception.
353     */
354    public IS getPpn13_IdentifierTypeCode() {
355       return getTyped(12, IS.class);
356    }
357
358
359    /**
360     * Returns assigning facility (component 14).  This is a convenience method that saves you from 
361     * casting and handling an exception.
362     */
363    public HD getAssigningFacility() {
364       return getTyped(13, HD.class);
365    }
366
367    
368    /**
369     * Returns assigning facility (component 14).  This is a convenience method that saves you from 
370     * casting and handling an exception.
371     */
372    public HD getPpn14_AssigningFacility() {
373       return getTyped(13, HD.class);
374    }
375
376
377    /**
378     * Returns Date/Time Action Performed (component 15).  This is a convenience method that saves you from 
379     * casting and handling an exception.
380     */
381    public TS getDateTimeActionPerformed() {
382       return getTyped(14, TS.class);
383    }
384
385    
386    /**
387     * Returns Date/Time Action Performed (component 15).  This is a convenience method that saves you from 
388     * casting and handling an exception.
389     */
390    public TS getPpn15_DateTimeActionPerformed() {
391       return getTyped(14, TS.class);
392    }
393
394
395    /**
396     * Returns Name Representation code (component 16).  This is a convenience method that saves you from 
397     * casting and handling an exception.
398     */
399    public ID getNameRepresentationCode() {
400       return getTyped(15, ID.class);
401    }
402
403    
404    /**
405     * Returns Name Representation code (component 16).  This is a convenience method that saves you from 
406     * casting and handling an exception.
407     */
408    public ID getPpn16_NameRepresentationCode() {
409       return getTyped(15, ID.class);
410    }
411
412
413    /**
414     * Returns name context (component 17).  This is a convenience method that saves you from 
415     * casting and handling an exception.
416     */
417    public CE getNameContext() {
418       return getTyped(16, CE.class);
419    }
420
421    
422    /**
423     * Returns name context (component 17).  This is a convenience method that saves you from 
424     * casting and handling an exception.
425     */
426    public CE getPpn17_NameContext() {
427       return getTyped(16, CE.class);
428    }
429
430
431    /**
432     * Returns name validity range (component 18).  This is a convenience method that saves you from 
433     * casting and handling an exception.
434     */
435    public DR getNameValidityRange() {
436       return getTyped(17, DR.class);
437    }
438
439    
440    /**
441     * Returns name validity range (component 18).  This is a convenience method that saves you from 
442     * casting and handling an exception.
443     */
444    public DR getPpn18_NameValidityRange() {
445       return getTyped(17, DR.class);
446    }
447
448
449    /**
450     * Returns name assembly order (component 19).  This is a convenience method that saves you from 
451     * casting and handling an exception.
452     */
453    public ID getNameAssemblyOrder() {
454       return getTyped(18, ID.class);
455    }
456
457    
458    /**
459     * Returns name assembly order (component 19).  This is a convenience method that saves you from 
460     * casting and handling an exception.
461     */
462    public ID getPpn19_NameAssemblyOrder() {
463       return getTyped(18, ID.class);
464    }
465
466
467
468}
469