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.v231.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+last name (FN)
047 * <li>given name (ST)
048 * <li>middle initial or name (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)
058 * <li>assigning facility (HD)
059 * <li>Date/Time Action Performed (TS)
060 * <li>Name Representation code (ID)
061 * </ul>
062 */
063@SuppressWarnings("unused")
064public class PPN extends AbstractComposite {
065
066    private Type[] data;
067
068    /** 
069     * Creates a new PPN type
070     */
071    public PPN(Message message) {
072        super(message);
073        init();
074    }
075
076    private void init() {
077        data = new Type[16];    
078        data[0] = new ST(getMessage());
079        data[1] = new FN(getMessage());
080        data[2] = new ST(getMessage());
081        data[3] = new ST(getMessage());
082        data[4] = new ST(getMessage());
083        data[5] = new ST(getMessage());
084        data[6] = new IS(getMessage(), 0);
085        data[7] = new IS(getMessage(), 0);
086        data[8] = new HD(getMessage());
087        data[9] = new ID(getMessage(), 0);
088        data[10] = new ST(getMessage());
089        data[11] = new ID(getMessage(), 0);
090        data[12] = new IS(getMessage(), 0);
091        data[13] = new HD(getMessage());
092        data[14] = new TS(getMessage());
093        data[15] = new ID(getMessage(), 0);
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 ID number (ST) (component 1).  This is a convenience method that saves you from 
122     * casting and handling an exception.
123     */
124    public ST getIDNumber() {
125       return getTyped(0, ST.class);
126    }
127
128    
129    /**
130     * Returns ID number (ST) (component 1).  This is a convenience method that saves you from 
131     * casting and handling an exception.
132     */
133    public ST getPpn1_IDNumber() {
134       return getTyped(0, ST.class);
135    }
136
137
138    /**
139     * Returns family+last name (component 2).  This is a convenience method that saves you from 
140     * casting and handling an exception.
141     */
142    public FN getFamilyLastName() {
143       return getTyped(1, FN.class);
144    }
145
146    
147    /**
148     * Returns family+last name (component 2).  This is a convenience method that saves you from 
149     * casting and handling an exception.
150     */
151    public FN getPpn2_FamilyLastName() {
152       return getTyped(1, FN.class);
153    }
154
155
156    /**
157     * Returns given name (component 3).  This is a convenience method that saves you from 
158     * casting and handling an exception.
159     */
160    public ST getGivenName() {
161       return getTyped(2, ST.class);
162    }
163
164    
165    /**
166     * Returns given name (component 3).  This is a convenience method that saves you from 
167     * casting and handling an exception.
168     */
169    public ST getPpn3_GivenName() {
170       return getTyped(2, ST.class);
171    }
172
173
174    /**
175     * Returns middle initial or name (component 4).  This is a convenience method that saves you from 
176     * casting and handling an exception.
177     */
178    public ST getMiddleInitialOrName() {
179       return getTyped(3, ST.class);
180    }
181
182    
183    /**
184     * Returns middle initial or name (component 4).  This is a convenience method that saves you from 
185     * casting and handling an exception.
186     */
187    public ST getPpn4_MiddleInitialOrName() {
188       return getTyped(3, ST.class);
189    }
190
191
192    /**
193     * Returns suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
194     * casting and handling an exception.
195     */
196    public ST getSuffixEgJRorIII() {
197       return getTyped(4, ST.class);
198    }
199
200    
201    /**
202     * Returns suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
203     * casting and handling an exception.
204     */
205    public ST getPpn5_SuffixEgJRorIII() {
206       return getTyped(4, ST.class);
207    }
208
209
210    /**
211     * Returns prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
212     * casting and handling an exception.
213     */
214    public ST getPrefixEgDR() {
215       return getTyped(5, ST.class);
216    }
217
218    
219    /**
220     * Returns prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
221     * casting and handling an exception.
222     */
223    public ST getPpn6_PrefixEgDR() {
224       return getTyped(5, ST.class);
225    }
226
227
228    /**
229     * Returns degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
230     * casting and handling an exception.
231     */
232    public IS getDegreeEgMD() {
233       return getTyped(6, IS.class);
234    }
235
236    
237    /**
238     * Returns degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
239     * casting and handling an exception.
240     */
241    public IS getPpn7_DegreeEgMD() {
242       return getTyped(6, IS.class);
243    }
244
245
246    /**
247     * Returns source table (component 8).  This is a convenience method that saves you from 
248     * casting and handling an exception.
249     */
250    public IS getSourceTable() {
251       return getTyped(7, IS.class);
252    }
253
254    
255    /**
256     * Returns source table (component 8).  This is a convenience method that saves you from 
257     * casting and handling an exception.
258     */
259    public IS getPpn8_SourceTable() {
260       return getTyped(7, IS.class);
261    }
262
263
264    /**
265     * Returns assigning authority (component 9).  This is a convenience method that saves you from 
266     * casting and handling an exception.
267     */
268    public HD getAssigningAuthority() {
269       return getTyped(8, HD.class);
270    }
271
272    
273    /**
274     * Returns assigning authority (component 9).  This is a convenience method that saves you from 
275     * casting and handling an exception.
276     */
277    public HD getPpn9_AssigningAuthority() {
278       return getTyped(8, HD.class);
279    }
280
281
282    /**
283     * Returns name type code (component 10).  This is a convenience method that saves you from 
284     * casting and handling an exception.
285     */
286    public ID getNameTypeCode() {
287       return getTyped(9, ID.class);
288    }
289
290    
291    /**
292     * Returns name type code (component 10).  This is a convenience method that saves you from 
293     * casting and handling an exception.
294     */
295    public ID getPpn10_NameTypeCode() {
296       return getTyped(9, ID.class);
297    }
298
299
300    /**
301     * Returns identifier check digit (component 11).  This is a convenience method that saves you from 
302     * casting and handling an exception.
303     */
304    public ST getIdentifierCheckDigit() {
305       return getTyped(10, ST.class);
306    }
307
308    
309    /**
310     * Returns identifier check digit (component 11).  This is a convenience method that saves you from 
311     * casting and handling an exception.
312     */
313    public ST getPpn11_IdentifierCheckDigit() {
314       return getTyped(10, ST.class);
315    }
316
317
318    /**
319     * Returns code identifying the check digit scheme employed (component 12).  This is a convenience method that saves you from 
320     * casting and handling an exception.
321     */
322    public ID getCodeIdentifyingTheCheckDigitSchemeEmployed() {
323       return getTyped(11, ID.class);
324    }
325
326    
327    /**
328     * Returns code identifying the check digit scheme employed (component 12).  This is a convenience method that saves you from 
329     * casting and handling an exception.
330     */
331    public ID getPpn12_CodeIdentifyingTheCheckDigitSchemeEmployed() {
332       return getTyped(11, ID.class);
333    }
334
335
336    /**
337     * Returns identifier type code (component 13).  This is a convenience method that saves you from 
338     * casting and handling an exception.
339     */
340    public IS getIdentifierTypeCode() {
341       return getTyped(12, IS.class);
342    }
343
344    
345    /**
346     * Returns identifier type code (component 13).  This is a convenience method that saves you from 
347     * casting and handling an exception.
348     */
349    public IS getPpn13_IdentifierTypeCode() {
350       return getTyped(12, IS.class);
351    }
352
353
354    /**
355     * Returns assigning facility (component 14).  This is a convenience method that saves you from 
356     * casting and handling an exception.
357     */
358    public HD getAssigningFacility() {
359       return getTyped(13, HD.class);
360    }
361
362    
363    /**
364     * Returns assigning facility (component 14).  This is a convenience method that saves you from 
365     * casting and handling an exception.
366     */
367    public HD getPpn14_AssigningFacility() {
368       return getTyped(13, HD.class);
369    }
370
371
372    /**
373     * Returns Date/Time Action Performed (component 15).  This is a convenience method that saves you from 
374     * casting and handling an exception.
375     */
376    public TS getDateTimeActionPerformed() {
377       return getTyped(14, TS.class);
378    }
379
380    
381    /**
382     * Returns Date/Time Action Performed (component 15).  This is a convenience method that saves you from 
383     * casting and handling an exception.
384     */
385    public TS getPpn15_DateTimeActionPerformed() {
386       return getTyped(14, TS.class);
387    }
388
389
390    /**
391     * Returns Name Representation code (component 16).  This is a convenience method that saves you from 
392     * casting and handling an exception.
393     */
394    public ID getNameRepresentationCode() {
395       return getTyped(15, ID.class);
396    }
397
398    
399    /**
400     * Returns Name Representation code (component 16).  This is a convenience method that saves you from 
401     * casting and handling an exception.
402     */
403    public ID getPpn16_NameRepresentationCode() {
404       return getTyped(15, ID.class);
405    }
406
407
408
409}
410