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.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 PPN (Performing Person Time Stamp) data type. 
043 * This type consists of the following components:</p>
044 * <ul>
045 * <li>ID Number (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>Check Digit Scheme (ID)
057 * <li>Identifier Type Code (ID)
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 * <li>Effective Date (TS)
065 * <li>Expiration Date (TS)
066 * <li>Professional Suffix (ST)
067 * <li>Assigning Jurisdiction (CWE)
068 * <li>Assigning Agency or Department (CWE)
069 * </ul>
070 */
071@SuppressWarnings("unused")
072public class PPN extends AbstractComposite {
073
074    private Type[] data;
075
076    /** 
077     * Creates a new PPN type
078     */
079    public PPN(Message message) {
080        super(message);
081        init();
082    }
083
084    private void init() {
085        data = new Type[24];    
086        data[0] = new ST(getMessage());
087        data[1] = new FN(getMessage());
088        data[2] = new ST(getMessage());
089        data[3] = new ST(getMessage());
090        data[4] = new ST(getMessage());
091        data[5] = new ST(getMessage());
092        data[6] = new IS(getMessage(), 360);
093        data[7] = new IS(getMessage(), 297);
094        data[8] = new HD(getMessage());
095        data[9] = new ID(getMessage(), 200);
096        data[10] = new ST(getMessage());
097        data[11] = new ID(getMessage(), 61);
098        data[12] = new ID(getMessage(), 203);
099        data[13] = new HD(getMessage());
100        data[14] = new TS(getMessage());
101        data[15] = new ID(getMessage(), 465);
102        data[16] = new CE(getMessage());
103        data[17] = new DR(getMessage());
104        data[18] = new ID(getMessage(), 444);
105        data[19] = new TS(getMessage());
106        data[20] = new TS(getMessage());
107        data[21] = new ST(getMessage());
108        data[22] = new CWE(getMessage());
109        data[23] = new CWE(getMessage());
110    }
111
112
113    /**
114     * Returns an array containing the data elements.
115     */
116    public Type[] getComponents() { 
117        return this.data; 
118    }
119
120    /**
121     * Returns an individual data component.
122     *
123     * @param number The component number (0-indexed)
124     * @throws DataTypeException if the given element number is out of range.
125     */
126    public Type getComponent(int number) throws DataTypeException { 
127
128        try { 
129            return this.data[number]; 
130        } catch (ArrayIndexOutOfBoundsException e) { 
131            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
132        } 
133    } 
134
135
136    /**
137     * Returns ID Number (component 1).  This is a convenience method that saves you from 
138     * casting and handling an exception.
139     */
140    public ST getIDNumber() {
141       return getTyped(0, ST.class);
142    }
143
144    
145    /**
146     * Returns ID Number (component 1).  This is a convenience method that saves you from 
147     * casting and handling an exception.
148     */
149    public ST getPpn1_IDNumber() {
150       return getTyped(0, ST.class);
151    }
152
153
154    /**
155     * Returns Family Name (component 2).  This is a convenience method that saves you from 
156     * casting and handling an exception.
157     */
158    public FN getFamilyName() {
159       return getTyped(1, FN.class);
160    }
161
162    
163    /**
164     * Returns Family Name (component 2).  This is a convenience method that saves you from 
165     * casting and handling an exception.
166     */
167    public FN getPpn2_FamilyName() {
168       return getTyped(1, FN.class);
169    }
170
171
172    /**
173     * Returns Given Name (component 3).  This is a convenience method that saves you from 
174     * casting and handling an exception.
175     */
176    public ST getGivenName() {
177       return getTyped(2, ST.class);
178    }
179
180    
181    /**
182     * Returns Given Name (component 3).  This is a convenience method that saves you from 
183     * casting and handling an exception.
184     */
185    public ST getPpn3_GivenName() {
186       return getTyped(2, ST.class);
187    }
188
189
190    /**
191     * Returns Second and Further Given Names or Initials Thereof (component 4).  This is a convenience method that saves you from 
192     * casting and handling an exception.
193     */
194    public ST getSecondAndFurtherGivenNamesOrInitialsThereof() {
195       return getTyped(3, ST.class);
196    }
197
198    
199    /**
200     * Returns Second and Further Given Names or Initials Thereof (component 4).  This is a convenience method that saves you from 
201     * casting and handling an exception.
202     */
203    public ST getPpn4_SecondAndFurtherGivenNamesOrInitialsThereof() {
204       return getTyped(3, ST.class);
205    }
206
207
208    /**
209     * Returns Suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
210     * casting and handling an exception.
211     */
212    public ST getSuffixEgJRorIII() {
213       return getTyped(4, ST.class);
214    }
215
216    
217    /**
218     * Returns Suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
219     * casting and handling an exception.
220     */
221    public ST getPpn5_SuffixEgJRorIII() {
222       return getTyped(4, ST.class);
223    }
224
225
226    /**
227     * Returns Prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
228     * casting and handling an exception.
229     */
230    public ST getPrefixEgDR() {
231       return getTyped(5, ST.class);
232    }
233
234    
235    /**
236     * Returns Prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
237     * casting and handling an exception.
238     */
239    public ST getPpn6_PrefixEgDR() {
240       return getTyped(5, ST.class);
241    }
242
243
244    /**
245     * Returns Degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
246     * casting and handling an exception.
247     */
248    public IS getDegreeEgMD() {
249       return getTyped(6, IS.class);
250    }
251
252    
253    /**
254     * Returns Degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
255     * casting and handling an exception.
256     */
257    public IS getPpn7_DegreeEgMD() {
258       return getTyped(6, IS.class);
259    }
260
261
262    /**
263     * Returns Source Table (component 8).  This is a convenience method that saves you from 
264     * casting and handling an exception.
265     */
266    public IS getSourceTable() {
267       return getTyped(7, IS.class);
268    }
269
270    
271    /**
272     * Returns Source Table (component 8).  This is a convenience method that saves you from 
273     * casting and handling an exception.
274     */
275    public IS getPpn8_SourceTable() {
276       return getTyped(7, IS.class);
277    }
278
279
280    /**
281     * Returns Assigning Authority (component 9).  This is a convenience method that saves you from 
282     * casting and handling an exception.
283     */
284    public HD getAssigningAuthority() {
285       return getTyped(8, HD.class);
286    }
287
288    
289    /**
290     * Returns Assigning Authority (component 9).  This is a convenience method that saves you from 
291     * casting and handling an exception.
292     */
293    public HD getPpn9_AssigningAuthority() {
294       return getTyped(8, HD.class);
295    }
296
297
298    /**
299     * Returns Name Type Code (component 10).  This is a convenience method that saves you from 
300     * casting and handling an exception.
301     */
302    public ID getNameTypeCode() {
303       return getTyped(9, ID.class);
304    }
305
306    
307    /**
308     * Returns Name Type Code (component 10).  This is a convenience method that saves you from 
309     * casting and handling an exception.
310     */
311    public ID getPpn10_NameTypeCode() {
312       return getTyped(9, ID.class);
313    }
314
315
316    /**
317     * Returns Identifier Check Digit (component 11).  This is a convenience method that saves you from 
318     * casting and handling an exception.
319     */
320    public ST getIdentifierCheckDigit() {
321       return getTyped(10, ST.class);
322    }
323
324    
325    /**
326     * Returns Identifier Check Digit (component 11).  This is a convenience method that saves you from 
327     * casting and handling an exception.
328     */
329    public ST getPpn11_IdentifierCheckDigit() {
330       return getTyped(10, ST.class);
331    }
332
333
334    /**
335     * Returns Check Digit Scheme (component 12).  This is a convenience method that saves you from 
336     * casting and handling an exception.
337     */
338    public ID getCheckDigitScheme() {
339       return getTyped(11, ID.class);
340    }
341
342    
343    /**
344     * Returns Check Digit Scheme (component 12).  This is a convenience method that saves you from 
345     * casting and handling an exception.
346     */
347    public ID getPpn12_CheckDigitScheme() {
348       return getTyped(11, ID.class);
349    }
350
351
352    /**
353     * Returns Identifier Type Code (component 13).  This is a convenience method that saves you from 
354     * casting and handling an exception.
355     */
356    public ID getIdentifierTypeCode() {
357       return getTyped(12, ID.class);
358    }
359
360    
361    /**
362     * Returns Identifier Type Code (component 13).  This is a convenience method that saves you from 
363     * casting and handling an exception.
364     */
365    public ID getPpn13_IdentifierTypeCode() {
366       return getTyped(12, ID.class);
367    }
368
369
370    /**
371     * Returns Assigning Facility (component 14).  This is a convenience method that saves you from 
372     * casting and handling an exception.
373     */
374    public HD getAssigningFacility() {
375       return getTyped(13, HD.class);
376    }
377
378    
379    /**
380     * Returns Assigning Facility (component 14).  This is a convenience method that saves you from 
381     * casting and handling an exception.
382     */
383    public HD getPpn14_AssigningFacility() {
384       return getTyped(13, HD.class);
385    }
386
387
388    /**
389     * Returns Date/Time Action Performed (component 15).  This is a convenience method that saves you from 
390     * casting and handling an exception.
391     */
392    public TS getDateTimeActionPerformed() {
393       return getTyped(14, TS.class);
394    }
395
396    
397    /**
398     * Returns Date/Time Action Performed (component 15).  This is a convenience method that saves you from 
399     * casting and handling an exception.
400     */
401    public TS getPpn15_DateTimeActionPerformed() {
402       return getTyped(14, TS.class);
403    }
404
405
406    /**
407     * Returns Name Representation Code (component 16).  This is a convenience method that saves you from 
408     * casting and handling an exception.
409     */
410    public ID getNameRepresentationCode() {
411       return getTyped(15, ID.class);
412    }
413
414    
415    /**
416     * Returns Name Representation Code (component 16).  This is a convenience method that saves you from 
417     * casting and handling an exception.
418     */
419    public ID getPpn16_NameRepresentationCode() {
420       return getTyped(15, ID.class);
421    }
422
423
424    /**
425     * Returns Name Context (component 17).  This is a convenience method that saves you from 
426     * casting and handling an exception.
427     */
428    public CE getNameContext() {
429       return getTyped(16, CE.class);
430    }
431
432    
433    /**
434     * Returns Name Context (component 17).  This is a convenience method that saves you from 
435     * casting and handling an exception.
436     */
437    public CE getPpn17_NameContext() {
438       return getTyped(16, CE.class);
439    }
440
441
442    /**
443     * Returns Name Validity Range (component 18).  This is a convenience method that saves you from 
444     * casting and handling an exception.
445     */
446    public DR getNameValidityRange() {
447       return getTyped(17, DR.class);
448    }
449
450    
451    /**
452     * Returns Name Validity Range (component 18).  This is a convenience method that saves you from 
453     * casting and handling an exception.
454     */
455    public DR getPpn18_NameValidityRange() {
456       return getTyped(17, DR.class);
457    }
458
459
460    /**
461     * Returns Name Assembly Order (component 19).  This is a convenience method that saves you from 
462     * casting and handling an exception.
463     */
464    public ID getNameAssemblyOrder() {
465       return getTyped(18, ID.class);
466    }
467
468    
469    /**
470     * Returns Name Assembly Order (component 19).  This is a convenience method that saves you from 
471     * casting and handling an exception.
472     */
473    public ID getPpn19_NameAssemblyOrder() {
474       return getTyped(18, ID.class);
475    }
476
477
478    /**
479     * Returns Effective Date (component 20).  This is a convenience method that saves you from 
480     * casting and handling an exception.
481     */
482    public TS getEffectiveDate() {
483       return getTyped(19, TS.class);
484    }
485
486    
487    /**
488     * Returns Effective Date (component 20).  This is a convenience method that saves you from 
489     * casting and handling an exception.
490     */
491    public TS getPpn20_EffectiveDate() {
492       return getTyped(19, TS.class);
493    }
494
495
496    /**
497     * Returns Expiration Date (component 21).  This is a convenience method that saves you from 
498     * casting and handling an exception.
499     */
500    public TS getExpirationDate() {
501       return getTyped(20, TS.class);
502    }
503
504    
505    /**
506     * Returns Expiration Date (component 21).  This is a convenience method that saves you from 
507     * casting and handling an exception.
508     */
509    public TS getPpn21_ExpirationDate() {
510       return getTyped(20, TS.class);
511    }
512
513
514    /**
515     * Returns Professional Suffix (component 22).  This is a convenience method that saves you from 
516     * casting and handling an exception.
517     */
518    public ST getProfessionalSuffix() {
519       return getTyped(21, ST.class);
520    }
521
522    
523    /**
524     * Returns Professional Suffix (component 22).  This is a convenience method that saves you from 
525     * casting and handling an exception.
526     */
527    public ST getPpn22_ProfessionalSuffix() {
528       return getTyped(21, ST.class);
529    }
530
531
532    /**
533     * Returns Assigning Jurisdiction (component 23).  This is a convenience method that saves you from 
534     * casting and handling an exception.
535     */
536    public CWE getAssigningJurisdiction() {
537       return getTyped(22, CWE.class);
538    }
539
540    
541    /**
542     * Returns Assigning Jurisdiction (component 23).  This is a convenience method that saves you from 
543     * casting and handling an exception.
544     */
545    public CWE getPpn23_AssigningJurisdiction() {
546       return getTyped(22, CWE.class);
547    }
548
549
550    /**
551     * Returns Assigning Agency or Department (component 24).  This is a convenience method that saves you from 
552     * casting and handling an exception.
553     */
554    public CWE getAssigningAgencyOrDepartment() {
555       return getTyped(23, CWE.class);
556    }
557
558    
559    /**
560     * Returns Assigning Agency or Department (component 24).  This is a convenience method that saves you from 
561     * casting and handling an exception.
562     */
563    public CWE getPpn24_AssigningAgencyOrDepartment() {
564       return getTyped(23, CWE.class);
565    }
566
567
568
569}
570