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 "PPN.java". Description: 15 * "Composite class PPN" 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.v24.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 PPN (performing person time stamp) data type. 43 * This type consists of the following components:</p> 44 * <ul> 45 * <li>ID number (ST) (ST) 46 * <li>family name (FN) 47 * <li>given name (ST) 48 * <li>second and further given names or initials thereof (ST) 49 * <li>suffix (e.g., JR or III) (ST) 50 * <li>prefix (e.g., DR) (ST) 51 * <li>degree (e.g., MD) (IS) 52 * <li>source table (IS) 53 * <li>assigning authority (HD) 54 * <li>name type code (ID) 55 * <li>identifier check digit (ST) 56 * <li>code identifying the check digit scheme employed (ID) 57 * <li>identifier type code (IS) (IS) 58 * <li>assigning facility (HD) 59 * <li>Date/Time Action Performed (TS) 60 * <li>Name Representation code (ID) 61 * <li>name context (CE) 62 * <li>name validity range (DR) 63 * <li>name assembly order (ID) 64 * </ul> 65 */ 66 @SuppressWarnings("unused") 67 public class PPN extends AbstractComposite { 68 69 private Type[] data; 70 71 /** 72 * Creates a new PPN type 73 */ 74 public PPN(Message message) { 75 super(message); 76 init(); 77 } 78 79 private void init() { 80 data = new Type[19]; 81 data[0] = new ST(getMessage()); 82 data[1] = new FN(getMessage()); 83 data[2] = new ST(getMessage()); 84 data[3] = new ST(getMessage()); 85 data[4] = new ST(getMessage()); 86 data[5] = new ST(getMessage()); 87 data[6] = new IS(getMessage(), 0); 88 data[7] = new IS(getMessage(), 0); 89 data[8] = new HD(getMessage()); 90 data[9] = new ID(getMessage(), 0); 91 data[10] = new ST(getMessage()); 92 data[11] = new ID(getMessage(), 0); 93 data[12] = new IS(getMessage(), 0); 94 data[13] = new HD(getMessage()); 95 data[14] = new TS(getMessage()); 96 data[15] = new ID(getMessage(), 0); 97 data[16] = new CE(getMessage()); 98 data[17] = new DR(getMessage()); 99 data[18] = new ID(getMessage(), 0); 100 } 101 102 103 /** 104 * Returns an array containing the data elements. 105 */ 106 public Type[] getComponents() { 107 return this.data; 108 } 109 110 /** 111 * Returns an individual data component. 112 * 113 * @param number The component number (0-indexed) 114 * @throws DataTypeException if the given element number is out of range. 115 */ 116 public Type getComponent(int number) throws DataTypeException { 117 118 try { 119 return this.data[number]; 120 } catch (ArrayIndexOutOfBoundsException e) { 121 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 122 } 123 } 124 125 126 /** 127 * Returns ID number (ST) (component 1). This is a convenience method that saves you from 128 * casting and handling an exception. 129 */ 130 public ST getIDNumber() { 131 return getTyped(0, ST.class); 132 } 133 134 135 /** 136 * Returns ID number (ST) (component 1). This is a convenience method that saves you from 137 * casting and handling an exception. 138 */ 139 public ST getPpn1_IDNumber() { 140 return getTyped(0, 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 FN getFamilyName() { 149 return getTyped(1, FN.class); 150 } 151 152 153 /** 154 * Returns family name (component 2). This is a convenience method that saves you from 155 * casting and handling an exception. 156 */ 157 public FN getPpn2_FamilyName() { 158 return getTyped(1, FN.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 getGivenName() { 167 return getTyped(2, ST.class); 168 } 169 170 171 /** 172 * Returns given name (component 3). This is a convenience method that saves you from 173 * casting and handling an exception. 174 */ 175 public ST getPpn3_GivenName() { 176 return getTyped(2, ST.class); 177 } 178 179 180 /** 181 * Returns second and further given names or initials thereof (component 4). This is a convenience method that saves you from 182 * casting and handling an exception. 183 */ 184 public ST getSecondAndFurtherGivenNamesOrInitialsThereof() { 185 return getTyped(3, ST.class); 186 } 187 188 189 /** 190 * Returns second and further given names or initials thereof (component 4). This is a convenience method that saves you from 191 * casting and handling an exception. 192 */ 193 public ST getPpn4_SecondAndFurtherGivenNamesOrInitialsThereof() { 194 return getTyped(3, 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 getSuffixEgJRorIII() { 203 return getTyped(4, ST.class); 204 } 205 206 207 /** 208 * Returns suffix (e.g., JR or III) (component 5). This is a convenience method that saves you from 209 * casting and handling an exception. 210 */ 211 public ST getPpn5_SuffixEgJRorIII() { 212 return getTyped(4, 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 getPrefixEgDR() { 221 return getTyped(5, ST.class); 222 } 223 224 225 /** 226 * Returns prefix (e.g., DR) (component 6). This is a convenience method that saves you from 227 * casting and handling an exception. 228 */ 229 public ST getPpn6_PrefixEgDR() { 230 return getTyped(5, 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 IS getDegreeEgMD() { 239 return getTyped(6, IS.class); 240 } 241 242 243 /** 244 * Returns degree (e.g., MD) (component 7). This is a convenience method that saves you from 245 * casting and handling an exception. 246 */ 247 public IS getPpn7_DegreeEgMD() { 248 return getTyped(6, IS.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 IS getSourceTable() { 257 return getTyped(7, IS.class); 258 } 259 260 261 /** 262 * Returns source table (component 8). This is a convenience method that saves you from 263 * casting and handling an exception. 264 */ 265 public IS getPpn8_SourceTable() { 266 return getTyped(7, IS.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 getAssigningAuthority() { 275 return getTyped(8, HD.class); 276 } 277 278 279 /** 280 * Returns assigning authority (component 9). This is a convenience method that saves you from 281 * casting and handling an exception. 282 */ 283 public HD getPpn9_AssigningAuthority() { 284 return getTyped(8, HD.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 getNameTypeCode() { 293 return getTyped(9, ID.class); 294 } 295 296 297 /** 298 * Returns name type code (component 10). This is a convenience method that saves you from 299 * casting and handling an exception. 300 */ 301 public ID getPpn10_NameTypeCode() { 302 return getTyped(9, ID.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 getIdentifierCheckDigit() { 311 return getTyped(10, ST.class); 312 } 313 314 315 /** 316 * Returns identifier check digit (component 11). This is a convenience method that saves you from 317 * casting and handling an exception. 318 */ 319 public ST getPpn11_IdentifierCheckDigit() { 320 return getTyped(10, ST.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 getCodeIdentifyingTheCheckDigitSchemeEmployed() { 329 return getTyped(11, ID.class); 330 } 331 332 333 /** 334 * Returns code identifying the check digit scheme employed (component 12). This is a convenience method that saves you from 335 * casting and handling an exception. 336 */ 337 public ID getPpn12_CodeIdentifyingTheCheckDigitSchemeEmployed() { 338 return getTyped(11, ID.class); 339 } 340 341 342 /** 343 * Returns identifier type code (IS) (component 13). This is a convenience method that saves you from 344 * casting and handling an exception. 345 */ 346 public IS getIdentifierTypeCode() { 347 return getTyped(12, IS.class); 348 } 349 350 351 /** 352 * Returns identifier type code (IS) (component 13). This is a convenience method that saves you from 353 * casting and handling an exception. 354 */ 355 public IS getPpn13_IdentifierTypeCode() { 356 return getTyped(12, IS.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 getAssigningFacility() { 365 return getTyped(13, HD.class); 366 } 367 368 369 /** 370 * Returns assigning facility (component 14). This is a convenience method that saves you from 371 * casting and handling an exception. 372 */ 373 public HD getPpn14_AssigningFacility() { 374 return getTyped(13, HD.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 getDateTimeActionPerformed() { 383 return getTyped(14, TS.class); 384 } 385 386 387 /** 388 * Returns Date/Time Action Performed (component 15). This is a convenience method that saves you from 389 * casting and handling an exception. 390 */ 391 public TS getPpn15_DateTimeActionPerformed() { 392 return getTyped(14, TS.class); 393 } 394 395 396 /** 397 * Returns Name Representation code (component 16). This is a convenience method that saves you from 398 * casting and handling an exception. 399 */ 400 public ID getNameRepresentationCode() { 401 return getTyped(15, ID.class); 402 } 403 404 405 /** 406 * Returns Name Representation code (component 16). This is a convenience method that saves you from 407 * casting and handling an exception. 408 */ 409 public ID getPpn16_NameRepresentationCode() { 410 return getTyped(15, ID.class); 411 } 412 413 414 /** 415 * Returns name context (component 17). This is a convenience method that saves you from 416 * casting and handling an exception. 417 */ 418 public CE getNameContext() { 419 return getTyped(16, CE.class); 420 } 421 422 423 /** 424 * Returns name context (component 17). This is a convenience method that saves you from 425 * casting and handling an exception. 426 */ 427 public CE getPpn17_NameContext() { 428 return getTyped(16, CE.class); 429 } 430 431 432 /** 433 * Returns name validity range (component 18). This is a convenience method that saves you from 434 * casting and handling an exception. 435 */ 436 public DR getNameValidityRange() { 437 return getTyped(17, DR.class); 438 } 439 440 441 /** 442 * Returns name validity range (component 18). This is a convenience method that saves you from 443 * casting and handling an exception. 444 */ 445 public DR getPpn18_NameValidityRange() { 446 return getTyped(17, DR.class); 447 } 448 449 450 /** 451 * Returns name assembly order (component 19). This is a convenience method that saves you from 452 * casting and handling an exception. 453 */ 454 public ID getNameAssemblyOrder() { 455 return getTyped(18, ID.class); 456 } 457 458 459 /** 460 * Returns name assembly order (component 19). This is a convenience method that saves you from 461 * casting and handling an exception. 462 */ 463 public ID getPpn19_NameAssemblyOrder() { 464 return getTyped(18, ID.class); 465 } 466 467 468 469 } 470