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