View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "XPN.java".  Description:
15   * "Composite class XPN"
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2013.  All Rights Reserved.
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  package ca.uhn.hl7v2.model.v26.datatype;
34  
35  import ca.uhn.hl7v2.model.DataTypeException;
36  import ca.uhn.hl7v2.model.Message;
37  import ca.uhn.hl7v2.model.Type;
38  import ca.uhn.hl7v2.model.AbstractComposite;
39  
40  
41  /**
42   * <p>Represents an HL7 XPN (Extended Person Name) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>Family Name (FN)
46   * <li>Given Name (ST)
47   * <li>Second and Further Given Names or Initials Thereof (ST)
48   * <li>Suffix (e.g., JR or III) (ST)
49   * <li>Prefix (e.g., DR) (ST)
50   * <li>Degree (e.g., MD) (IS)
51   * <li>Name Type Code (ID)
52   * <li>Name Representation Code (ID)
53   * <li>Name Context (CWE)
54   * <li>Name Validity Range (DR)
55   * <li>Name Assembly Order (ID)
56   * <li>Effective Date (DTM)
57   * <li>Expiration Date (DTM)
58   * <li>Professional Suffix (ST)
59   * </ul>
60   */
61  @SuppressWarnings("unused")
62  public class XPN extends AbstractComposite {
63  
64      private Type[] data;
65  
66      /** 
67       * Creates a new XPN type
68       */
69      public XPN(Message message) {
70          super(message);
71          init();
72      }
73  
74      private void init() {
75          data = new Type[14];    
76          data[0] = new FN(getMessage());
77          data[1] = new ST(getMessage());
78          data[2] = new ST(getMessage());
79          data[3] = new ST(getMessage());
80          data[4] = new ST(getMessage());
81          data[5] = new IS(getMessage(), 360);
82          data[6] = new ID(getMessage(), 200);
83          data[7] = new ID(getMessage(), 465);
84          data[8] = new CWE(getMessage());
85          data[9] = new DR(getMessage());
86          data[10] = new ID(getMessage(), 444);
87          data[11] = new DTM(getMessage());
88          data[12] = new DTM(getMessage());
89          data[13] = new ST(getMessage());
90      }
91  
92  
93      /**
94       * Returns an array containing the data elements.
95       */
96      public Type[] getComponents() { 
97          return this.data; 
98      }
99  
100     /**
101      * Returns an individual data component.
102      *
103      * @param number The component number (0-indexed)
104      * @throws DataTypeException if the given element number is out of range.
105      */
106     public Type getComponent(int number) throws DataTypeException { 
107 
108         try { 
109             return this.data[number]; 
110         } catch (ArrayIndexOutOfBoundsException e) { 
111             throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
112         } 
113     } 
114 
115 
116     /**
117      * Returns Family Name (component 1).  This is a convenience method that saves you from 
118      * casting and handling an exception.
119      */
120     public FN getFamilyName() {
121        return getTyped(0, FN.class);
122     }
123 
124     
125     /**
126      * Returns Family Name (component 1).  This is a convenience method that saves you from 
127      * casting and handling an exception.
128      */
129     public FN getXpn1_FamilyName() {
130        return getTyped(0, FN.class);
131     }
132 
133 
134     /**
135      * Returns Given Name (component 2).  This is a convenience method that saves you from 
136      * casting and handling an exception.
137      */
138     public ST getGivenName() {
139        return getTyped(1, ST.class);
140     }
141 
142     
143     /**
144      * Returns Given Name (component 2).  This is a convenience method that saves you from 
145      * casting and handling an exception.
146      */
147     public ST getXpn2_GivenName() {
148        return getTyped(1, ST.class);
149     }
150 
151 
152     /**
153      * Returns Second and Further Given Names or Initials Thereof (component 3).  This is a convenience method that saves you from 
154      * casting and handling an exception.
155      */
156     public ST getSecondAndFurtherGivenNamesOrInitialsThereof() {
157        return getTyped(2, ST.class);
158     }
159 
160     
161     /**
162      * Returns Second and Further Given Names or Initials Thereof (component 3).  This is a convenience method that saves you from 
163      * casting and handling an exception.
164      */
165     public ST getXpn3_SecondAndFurtherGivenNamesOrInitialsThereof() {
166        return getTyped(2, ST.class);
167     }
168 
169 
170     /**
171      * Returns Suffix (e.g., JR or III) (component 4).  This is a convenience method that saves you from 
172      * casting and handling an exception.
173      */
174     public ST getSuffixEgJRorIII() {
175        return getTyped(3, ST.class);
176     }
177 
178     
179     /**
180      * Returns Suffix (e.g., JR or III) (component 4).  This is a convenience method that saves you from 
181      * casting and handling an exception.
182      */
183     public ST getXpn4_SuffixEgJRorIII() {
184        return getTyped(3, ST.class);
185     }
186 
187 
188     /**
189      * Returns Prefix (e.g., DR) (component 5).  This is a convenience method that saves you from 
190      * casting and handling an exception.
191      */
192     public ST getPrefixEgDR() {
193        return getTyped(4, ST.class);
194     }
195 
196     
197     /**
198      * Returns Prefix (e.g., DR) (component 5).  This is a convenience method that saves you from 
199      * casting and handling an exception.
200      */
201     public ST getXpn5_PrefixEgDR() {
202        return getTyped(4, ST.class);
203     }
204 
205 
206     /**
207      * Returns Degree (e.g., MD) (component 6).  This is a convenience method that saves you from 
208      * casting and handling an exception.
209      */
210     public IS getDegreeEgMD() {
211        return getTyped(5, IS.class);
212     }
213 
214     
215     /**
216      * Returns Degree (e.g., MD) (component 6).  This is a convenience method that saves you from 
217      * casting and handling an exception.
218      */
219     public IS getXpn6_DegreeEgMD() {
220        return getTyped(5, IS.class);
221     }
222 
223 
224     /**
225      * Returns Name Type Code (component 7).  This is a convenience method that saves you from 
226      * casting and handling an exception.
227      */
228     public ID getNameTypeCode() {
229        return getTyped(6, ID.class);
230     }
231 
232     
233     /**
234      * Returns Name Type Code (component 7).  This is a convenience method that saves you from 
235      * casting and handling an exception.
236      */
237     public ID getXpn7_NameTypeCode() {
238        return getTyped(6, ID.class);
239     }
240 
241 
242     /**
243      * Returns Name Representation Code (component 8).  This is a convenience method that saves you from 
244      * casting and handling an exception.
245      */
246     public ID getNameRepresentationCode() {
247        return getTyped(7, ID.class);
248     }
249 
250     
251     /**
252      * Returns Name Representation Code (component 8).  This is a convenience method that saves you from 
253      * casting and handling an exception.
254      */
255     public ID getXpn8_NameRepresentationCode() {
256        return getTyped(7, ID.class);
257     }
258 
259 
260     /**
261      * Returns Name Context (component 9).  This is a convenience method that saves you from 
262      * casting and handling an exception.
263      */
264     public CWE getNameContext() {
265        return getTyped(8, CWE.class);
266     }
267 
268     
269     /**
270      * Returns Name Context (component 9).  This is a convenience method that saves you from 
271      * casting and handling an exception.
272      */
273     public CWE getXpn9_NameContext() {
274        return getTyped(8, CWE.class);
275     }
276 
277 
278     /**
279      * Returns Name Validity Range (component 10).  This is a convenience method that saves you from 
280      * casting and handling an exception.
281      */
282     public DR getNameValidityRange() {
283        return getTyped(9, DR.class);
284     }
285 
286     
287     /**
288      * Returns Name Validity Range (component 10).  This is a convenience method that saves you from 
289      * casting and handling an exception.
290      */
291     public DR getXpn10_NameValidityRange() {
292        return getTyped(9, DR.class);
293     }
294 
295 
296     /**
297      * Returns Name Assembly Order (component 11).  This is a convenience method that saves you from 
298      * casting and handling an exception.
299      */
300     public ID getNameAssemblyOrder() {
301        return getTyped(10, ID.class);
302     }
303 
304     
305     /**
306      * Returns Name Assembly Order (component 11).  This is a convenience method that saves you from 
307      * casting and handling an exception.
308      */
309     public ID getXpn11_NameAssemblyOrder() {
310        return getTyped(10, ID.class);
311     }
312 
313 
314     /**
315      * Returns Effective Date (component 12).  This is a convenience method that saves you from 
316      * casting and handling an exception.
317      */
318     public DTM getEffectiveDate() {
319        return getTyped(11, DTM.class);
320     }
321 
322     
323     /**
324      * Returns Effective Date (component 12).  This is a convenience method that saves you from 
325      * casting and handling an exception.
326      */
327     public DTM getXpn12_EffectiveDate() {
328        return getTyped(11, DTM.class);
329     }
330 
331 
332     /**
333      * Returns Expiration Date (component 13).  This is a convenience method that saves you from 
334      * casting and handling an exception.
335      */
336     public DTM getExpirationDate() {
337        return getTyped(12, DTM.class);
338     }
339 
340     
341     /**
342      * Returns Expiration Date (component 13).  This is a convenience method that saves you from 
343      * casting and handling an exception.
344      */
345     public DTM getXpn13_ExpirationDate() {
346        return getTyped(12, DTM.class);
347     }
348 
349 
350     /**
351      * Returns Professional Suffix (component 14).  This is a convenience method that saves you from 
352      * casting and handling an exception.
353      */
354     public ST getProfessionalSuffix() {
355        return getTyped(13, ST.class);
356     }
357 
358     
359     /**
360      * Returns Professional Suffix (component 14).  This is a convenience method that saves you from 
361      * casting and handling an exception.
362      */
363     public ST getXpn14_ProfessionalSuffix() {
364        return getTyped(13, ST.class);
365     }
366 
367 
368 
369 }
370