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.v28.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) (ST) 51 * <li>Name Type Code (ID) 52 * <li>Name Representation Code (ID) 53 * <li>Name Context (CWE) 54 * <li>Name Validity Range (ST) 55 * <li>Name Assembly Order (ID) 56 * <li>Effective Date (DTM) 57 * <li>Expiration Date (DTM) 58 * <li>Professional Suffix (ST) 59 * <li>Called By (ST) 60 * </ul> 61 */ 62 @SuppressWarnings("unused") 63 public class XPN extends AbstractComposite { 64 65 private Type[] data; 66 67 /** 68 * Creates a new XPN type 69 */ 70 public XPN(Message message) { 71 super(message); 72 init(); 73 } 74 75 private void init() { 76 data = new Type[15]; 77 data[0] = new FN(getMessage()); 78 data[1] = new ST(getMessage()); 79 data[2] = new ST(getMessage()); 80 data[3] = new ST(getMessage()); 81 data[4] = new ST(getMessage()); 82 data[5] = new ST(getMessage()); 83 data[6] = new ID(getMessage(), 200); 84 data[7] = new ID(getMessage(), 465); 85 data[8] = new CWE(getMessage()); 86 data[9] = new ST(getMessage()); 87 data[10] = new ID(getMessage(), 444); 88 data[11] = new DTM(getMessage()); 89 data[12] = new DTM(getMessage()); 90 data[13] = new ST(getMessage()); 91 data[14] = new ST(getMessage()); 92 } 93 94 95 /** 96 * Returns an array containing the data elements. 97 */ 98 public Type[] getComponents() { 99 return this.data; 100 } 101 102 /** 103 * Returns an individual data component. 104 * 105 * @param number The component number (0-indexed) 106 * @throws DataTypeException if the given element number is out of range. 107 */ 108 public Type getComponent(int number) throws DataTypeException { 109 110 try { 111 return this.data[number]; 112 } catch (ArrayIndexOutOfBoundsException e) { 113 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 114 } 115 } 116 117 118 /** 119 * Returns Family Name (component 1). This is a convenience method that saves you from 120 * casting and handling an exception. 121 */ 122 public FN getFamilyName() { 123 return getTyped(0, FN.class); 124 } 125 126 127 /** 128 * Returns Family Name (component 1). This is a convenience method that saves you from 129 * casting and handling an exception. 130 */ 131 public FN getXpn1_FamilyName() { 132 return getTyped(0, FN.class); 133 } 134 135 136 /** 137 * Returns Given Name (component 2). This is a convenience method that saves you from 138 * casting and handling an exception. 139 */ 140 public ST getGivenName() { 141 return getTyped(1, ST.class); 142 } 143 144 145 /** 146 * Returns Given Name (component 2). This is a convenience method that saves you from 147 * casting and handling an exception. 148 */ 149 public ST getXpn2_GivenName() { 150 return getTyped(1, ST.class); 151 } 152 153 154 /** 155 * Returns Second and Further Given Names or Initials Thereof (component 3). This is a convenience method that saves you from 156 * casting and handling an exception. 157 */ 158 public ST getSecondAndFurtherGivenNamesOrInitialsThereof() { 159 return getTyped(2, ST.class); 160 } 161 162 163 /** 164 * Returns Second and Further Given Names or Initials Thereof (component 3). This is a convenience method that saves you from 165 * casting and handling an exception. 166 */ 167 public ST getXpn3_SecondAndFurtherGivenNamesOrInitialsThereof() { 168 return getTyped(2, ST.class); 169 } 170 171 172 /** 173 * Returns Suffix (e.g., JR or III) (component 4). This is a convenience method that saves you from 174 * casting and handling an exception. 175 */ 176 public ST getSuffixEgJRorIII() { 177 return getTyped(3, ST.class); 178 } 179 180 181 /** 182 * Returns Suffix (e.g., JR or III) (component 4). This is a convenience method that saves you from 183 * casting and handling an exception. 184 */ 185 public ST getXpn4_SuffixEgJRorIII() { 186 return getTyped(3, ST.class); 187 } 188 189 190 /** 191 * Returns Prefix (e.g., DR) (component 5). This is a convenience method that saves you from 192 * casting and handling an exception. 193 */ 194 public ST getPrefixEgDR() { 195 return getTyped(4, ST.class); 196 } 197 198 199 /** 200 * Returns Prefix (e.g., DR) (component 5). This is a convenience method that saves you from 201 * casting and handling an exception. 202 */ 203 public ST getXpn5_PrefixEgDR() { 204 return getTyped(4, ST.class); 205 } 206 207 208 /** 209 * Returns Degree (e.g., MD) (component 6). This is a convenience method that saves you from 210 * casting and handling an exception. 211 */ 212 public ST getDegreeEgMD() { 213 return getTyped(5, ST.class); 214 } 215 216 217 /** 218 * Returns Degree (e.g., MD) (component 6). This is a convenience method that saves you from 219 * casting and handling an exception. 220 */ 221 public ST getXpn6_DegreeEgMD() { 222 return getTyped(5, ST.class); 223 } 224 225 226 /** 227 * Returns Name Type Code (component 7). This is a convenience method that saves you from 228 * casting and handling an exception. 229 */ 230 public ID getNameTypeCode() { 231 return getTyped(6, ID.class); 232 } 233 234 235 /** 236 * Returns Name Type Code (component 7). This is a convenience method that saves you from 237 * casting and handling an exception. 238 */ 239 public ID getXpn7_NameTypeCode() { 240 return getTyped(6, ID.class); 241 } 242 243 244 /** 245 * Returns Name Representation Code (component 8). This is a convenience method that saves you from 246 * casting and handling an exception. 247 */ 248 public ID getNameRepresentationCode() { 249 return getTyped(7, ID.class); 250 } 251 252 253 /** 254 * Returns Name Representation Code (component 8). This is a convenience method that saves you from 255 * casting and handling an exception. 256 */ 257 public ID getXpn8_NameRepresentationCode() { 258 return getTyped(7, ID.class); 259 } 260 261 262 /** 263 * Returns Name Context (component 9). This is a convenience method that saves you from 264 * casting and handling an exception. 265 */ 266 public CWE getNameContext() { 267 return getTyped(8, CWE.class); 268 } 269 270 271 /** 272 * Returns Name Context (component 9). This is a convenience method that saves you from 273 * casting and handling an exception. 274 */ 275 public CWE getXpn9_NameContext() { 276 return getTyped(8, CWE.class); 277 } 278 279 280 /** 281 * Returns Name Validity Range (component 10). This is a convenience method that saves you from 282 * casting and handling an exception. 283 */ 284 public ST getNameValidityRange() { 285 return getTyped(9, ST.class); 286 } 287 288 289 /** 290 * Returns Name Validity Range (component 10). This is a convenience method that saves you from 291 * casting and handling an exception. 292 */ 293 public ST getXpn10_NameValidityRange() { 294 return getTyped(9, ST.class); 295 } 296 297 298 /** 299 * Returns Name Assembly Order (component 11). This is a convenience method that saves you from 300 * casting and handling an exception. 301 */ 302 public ID getNameAssemblyOrder() { 303 return getTyped(10, ID.class); 304 } 305 306 307 /** 308 * Returns Name Assembly Order (component 11). This is a convenience method that saves you from 309 * casting and handling an exception. 310 */ 311 public ID getXpn11_NameAssemblyOrder() { 312 return getTyped(10, ID.class); 313 } 314 315 316 /** 317 * Returns Effective Date (component 12). This is a convenience method that saves you from 318 * casting and handling an exception. 319 */ 320 public DTM getEffectiveDate() { 321 return getTyped(11, DTM.class); 322 } 323 324 325 /** 326 * Returns Effective Date (component 12). This is a convenience method that saves you from 327 * casting and handling an exception. 328 */ 329 public DTM getXpn12_EffectiveDate() { 330 return getTyped(11, DTM.class); 331 } 332 333 334 /** 335 * Returns Expiration Date (component 13). This is a convenience method that saves you from 336 * casting and handling an exception. 337 */ 338 public DTM getExpirationDate() { 339 return getTyped(12, DTM.class); 340 } 341 342 343 /** 344 * Returns Expiration Date (component 13). This is a convenience method that saves you from 345 * casting and handling an exception. 346 */ 347 public DTM getXpn13_ExpirationDate() { 348 return getTyped(12, DTM.class); 349 } 350 351 352 /** 353 * Returns Professional Suffix (component 14). This is a convenience method that saves you from 354 * casting and handling an exception. 355 */ 356 public ST getProfessionalSuffix() { 357 return getTyped(13, ST.class); 358 } 359 360 361 /** 362 * Returns Professional Suffix (component 14). This is a convenience method that saves you from 363 * casting and handling an exception. 364 */ 365 public ST getXpn14_ProfessionalSuffix() { 366 return getTyped(13, ST.class); 367 } 368 369 370 /** 371 * Returns Called By (component 15). This is a convenience method that saves you from 372 * casting and handling an exception. 373 */ 374 public ST getCalledBy() { 375 return getTyped(14, ST.class); 376 } 377 378 379 /** 380 * Returns Called By (component 15). This is a convenience method that saves you from 381 * casting and handling an exception. 382 */ 383 public ST getXpn15_CalledBy() { 384 return getTyped(14, ST.class); 385 } 386 387 388 389 } 390