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.v23.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)
045 * <li>family name (ST)
046 * <li>given name (ST)
047 * <li>middle initial or name (ST)
048 * <li>suffix (e.g., JR or III) (ST)
049 * <li>prefix (e.g., DR) (ST)
050 * <li>degree (e.g., MD) (ST)
051 * <li>source table (ID)
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)
057 * <li>assigning facility (HD)
058 * <li>Date/Time Action Performed (TS)
059 * </ul>
060 */
061@SuppressWarnings("unused")
062public class PPN extends AbstractComposite {
063
064    private Type[] data;
065
066    /** 
067     * Creates a new PPN type
068     */
069    public PPN(Message message) {
070        super(message);
071        init();
072    }
073
074    private void init() {
075        data = new Type[15];    
076        data[0] = new ST(getMessage());
077        data[1] = new ST(getMessage());
078        data[2] = new ST(getMessage());
079        data[3] = new ST(getMessage());
080        data[4] = new ST(getMessage());
081        data[5] = new ST(getMessage());
082        data[6] = new ST(getMessage());
083        data[7] = new ID(getMessage(), 0);
084        data[8] = new HD(getMessage());
085        data[9] = new ID(getMessage(), 0);
086        data[10] = new ST(getMessage());
087        data[11] = new ID(getMessage(), 0);
088        data[12] = new IS(getMessage(), 0);
089        data[13] = new HD(getMessage());
090        data[14] = new TS(getMessage());
091    }
092
093
094    /**
095     * Returns an array containing the data elements.
096     */
097    public Type[] getComponents() { 
098        return this.data; 
099    }
100
101    /**
102     * Returns an individual data component.
103     *
104     * @param number The component number (0-indexed)
105     * @throws DataTypeException if the given element number is out of range.
106     */
107    public Type getComponent(int number) throws DataTypeException { 
108
109        try { 
110            return this.data[number]; 
111        } catch (ArrayIndexOutOfBoundsException e) { 
112            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
113        } 
114    } 
115
116
117    /**
118     * Returns ID number (component 1).  This is a convenience method that saves you from 
119     * casting and handling an exception.
120     */
121    public ST getIDNumber() {
122       return getTyped(0, ST.class);
123    }
124
125    
126    /**
127     * Returns ID number (component 1).  This is a convenience method that saves you from 
128     * casting and handling an exception.
129     */
130    public ST getPpn1_IDNumber() {
131       return getTyped(0, ST.class);
132    }
133
134
135    /**
136     * Returns family name (component 2).  This is a convenience method that saves you from 
137     * casting and handling an exception.
138     */
139    public ST getFamilyName() {
140       return getTyped(1, 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 ST getPpn2_FamilyName() {
149       return getTyped(1, ST.class);
150    }
151
152
153    /**
154     * Returns given name (component 3).  This is a convenience method that saves you from 
155     * casting and handling an exception.
156     */
157    public ST getGivenName() {
158       return getTyped(2, ST.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 getPpn3_GivenName() {
167       return getTyped(2, ST.class);
168    }
169
170
171    /**
172     * Returns middle initial or name (component 4).  This is a convenience method that saves you from 
173     * casting and handling an exception.
174     */
175    public ST getMiddleInitialOrName() {
176       return getTyped(3, ST.class);
177    }
178
179    
180    /**
181     * Returns middle initial or name (component 4).  This is a convenience method that saves you from 
182     * casting and handling an exception.
183     */
184    public ST getPpn4_MiddleInitialOrName() {
185       return getTyped(3, ST.class);
186    }
187
188
189    /**
190     * Returns suffix (e.g., JR or III) (component 5).  This is a convenience method that saves you from 
191     * casting and handling an exception.
192     */
193    public ST getSuffixEgJRorIII() {
194       return getTyped(4, 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 getPpn5_SuffixEgJRorIII() {
203       return getTyped(4, ST.class);
204    }
205
206
207    /**
208     * Returns prefix (e.g., DR) (component 6).  This is a convenience method that saves you from 
209     * casting and handling an exception.
210     */
211    public ST getPrefixEgDR() {
212       return getTyped(5, 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 getPpn6_PrefixEgDR() {
221       return getTyped(5, ST.class);
222    }
223
224
225    /**
226     * Returns degree (e.g., MD) (component 7).  This is a convenience method that saves you from 
227     * casting and handling an exception.
228     */
229    public ST getDegreeEgMD() {
230       return getTyped(6, 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 ST getPpn7_DegreeEgMD() {
239       return getTyped(6, ST.class);
240    }
241
242
243    /**
244     * Returns source table (component 8).  This is a convenience method that saves you from 
245     * casting and handling an exception.
246     */
247    public ID getSourceTable() {
248       return getTyped(7, ID.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 ID getPpn8_SourceTable() {
257       return getTyped(7, ID.class);
258    }
259
260
261    /**
262     * Returns assigning authority (component 9).  This is a convenience method that saves you from 
263     * casting and handling an exception.
264     */
265    public HD getAssigningAuthority() {
266       return getTyped(8, HD.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 getPpn9_AssigningAuthority() {
275       return getTyped(8, HD.class);
276    }
277
278
279    /**
280     * Returns name type code (component 10).  This is a convenience method that saves you from 
281     * casting and handling an exception.
282     */
283    public ID getNameTypeCode() {
284       return getTyped(9, ID.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 getPpn10_NameTypeCode() {
293       return getTyped(9, ID.class);
294    }
295
296
297    /**
298     * Returns identifier check digit (component 11).  This is a convenience method that saves you from 
299     * casting and handling an exception.
300     */
301    public ST getIdentifierCheckDigit() {
302       return getTyped(10, ST.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 getPpn11_IdentifierCheckDigit() {
311       return getTyped(10, ST.class);
312    }
313
314
315    /**
316     * Returns code identifying the check digit scheme employed (component 12).  This is a convenience method that saves you from 
317     * casting and handling an exception.
318     */
319    public ID getCodeIdentifyingTheCheckDigitSchemeEmployed() {
320       return getTyped(11, ID.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 getPpn12_CodeIdentifyingTheCheckDigitSchemeEmployed() {
329       return getTyped(11, ID.class);
330    }
331
332
333    /**
334     * Returns identifier type code (component 13).  This is a convenience method that saves you from 
335     * casting and handling an exception.
336     */
337    public IS getIdentifierTypeCode() {
338       return getTyped(12, IS.class);
339    }
340
341    
342    /**
343     * Returns identifier type code (component 13).  This is a convenience method that saves you from 
344     * casting and handling an exception.
345     */
346    public IS getPpn13_IdentifierTypeCode() {
347       return getTyped(12, IS.class);
348    }
349
350
351    /**
352     * Returns assigning facility (component 14).  This is a convenience method that saves you from 
353     * casting and handling an exception.
354     */
355    public HD getAssigningFacility() {
356       return getTyped(13, HD.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 getPpn14_AssigningFacility() {
365       return getTyped(13, HD.class);
366    }
367
368
369    /**
370     * Returns Date/Time Action Performed (component 15).  This is a convenience method that saves you from 
371     * casting and handling an exception.
372     */
373    public TS getDateTimeActionPerformed() {
374       return getTyped(14, TS.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 getPpn15_DateTimeActionPerformed() {
383       return getTyped(14, TS.class);
384    }
385
386
387
388}
389