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 "XCN.java". Description: 15 * "Composite class XCN" 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 XCN (Extended Composite ID Number and Name for Persons) data type. 43 * This type consists of the following components:</p> 44 * <ul> 45 * <li>Person Identifier (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) (ST) 52 * <li>Source Table (CWE) 53 * <li>Assigning Authority (HD) 54 * <li>Name Type Code (ID) 55 * <li>Identifier Check Digit (ST) 56 * <li>Check Digit Scheme (ID) 57 * <li>Identifier Type Code (ID) 58 * <li>Assigning Facility (HD) 59 * <li>Name Representation Code (ID) 60 * <li>Name Context (CWE) 61 * <li>Name Validity Range (ST) 62 * <li>Name Assembly Order (ID) 63 * <li>Effective Date (DTM) 64 * <li>Expiration Date (DTM) 65 * <li>Professional Suffix (ST) 66 * <li>Assigning Jurisdiction (CWE) 67 * <li>Assigning Agency or Department (CWE) 68 * <li>Security Check (ST) 69 * <li>Security Check Scheme (ID) 70 * </ul> 71 */ 72 @SuppressWarnings("unused") 73 public class XCN extends AbstractComposite { 74 75 private Type[] data; 76 77 /** 78 * Creates a new XCN type 79 */ 80 public XCN(Message message) { 81 super(message); 82 init(); 83 } 84 85 private void init() { 86 data = new Type[25]; 87 data[0] = new ST(getMessage()); 88 data[1] = new FN(getMessage()); 89 data[2] = new ST(getMessage()); 90 data[3] = new ST(getMessage()); 91 data[4] = new ST(getMessage()); 92 data[5] = new ST(getMessage()); 93 data[6] = new ST(getMessage()); 94 data[7] = new CWE(getMessage()); 95 data[8] = new HD(getMessage()); 96 data[9] = new ID(getMessage(), 200); 97 data[10] = new ST(getMessage()); 98 data[11] = new ID(getMessage(), 61); 99 data[12] = new ID(getMessage(), 203); 100 data[13] = new HD(getMessage()); 101 data[14] = new ID(getMessage(), 465); 102 data[15] = new CWE(getMessage()); 103 data[16] = new ST(getMessage()); 104 data[17] = new ID(getMessage(), 444); 105 data[18] = new DTM(getMessage()); 106 data[19] = new DTM(getMessage()); 107 data[20] = new ST(getMessage()); 108 data[21] = new CWE(getMessage()); 109 data[22] = new CWE(getMessage()); 110 data[23] = new ST(getMessage()); 111 data[24] = new ID(getMessage(), 904); 112 } 113 114 115 /** 116 * Returns an array containing the data elements. 117 */ 118 public Type[] getComponents() { 119 return this.data; 120 } 121 122 /** 123 * Returns an individual data component. 124 * 125 * @param number The component number (0-indexed) 126 * @throws DataTypeException if the given element number is out of range. 127 */ 128 public Type getComponent(int number) throws DataTypeException { 129 130 try { 131 return this.data[number]; 132 } catch (ArrayIndexOutOfBoundsException e) { 133 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 134 } 135 } 136 137 138 /** 139 * Returns Person Identifier (component 1). This is a convenience method that saves you from 140 * casting and handling an exception. 141 */ 142 public ST getPersonIdentifier() { 143 return getTyped(0, ST.class); 144 } 145 146 147 /** 148 * Returns Person Identifier (component 1). This is a convenience method that saves you from 149 * casting and handling an exception. 150 */ 151 public ST getXcn1_PersonIdentifier() { 152 return getTyped(0, ST.class); 153 } 154 155 156 /** 157 * Returns Family Name (component 2). This is a convenience method that saves you from 158 * casting and handling an exception. 159 */ 160 public FN getFamilyName() { 161 return getTyped(1, FN.class); 162 } 163 164 165 /** 166 * Returns Family Name (component 2). This is a convenience method that saves you from 167 * casting and handling an exception. 168 */ 169 public FN getXcn2_FamilyName() { 170 return getTyped(1, FN.class); 171 } 172 173 174 /** 175 * Returns Given Name (component 3). This is a convenience method that saves you from 176 * casting and handling an exception. 177 */ 178 public ST getGivenName() { 179 return getTyped(2, ST.class); 180 } 181 182 183 /** 184 * Returns Given Name (component 3). This is a convenience method that saves you from 185 * casting and handling an exception. 186 */ 187 public ST getXcn3_GivenName() { 188 return getTyped(2, ST.class); 189 } 190 191 192 /** 193 * Returns Second and Further Given Names or Initials Thereof (component 4). This is a convenience method that saves you from 194 * casting and handling an exception. 195 */ 196 public ST getSecondAndFurtherGivenNamesOrInitialsThereof() { 197 return getTyped(3, ST.class); 198 } 199 200 201 /** 202 * Returns Second and Further Given Names or Initials Thereof (component 4). This is a convenience method that saves you from 203 * casting and handling an exception. 204 */ 205 public ST getXcn4_SecondAndFurtherGivenNamesOrInitialsThereof() { 206 return getTyped(3, ST.class); 207 } 208 209 210 /** 211 * Returns Suffix (e.g., JR or III) (component 5). This is a convenience method that saves you from 212 * casting and handling an exception. 213 */ 214 public ST getSuffixEgJRorIII() { 215 return getTyped(4, ST.class); 216 } 217 218 219 /** 220 * Returns Suffix (e.g., JR or III) (component 5). This is a convenience method that saves you from 221 * casting and handling an exception. 222 */ 223 public ST getXcn5_SuffixEgJRorIII() { 224 return getTyped(4, ST.class); 225 } 226 227 228 /** 229 * Returns Prefix (e.g., DR) (component 6). This is a convenience method that saves you from 230 * casting and handling an exception. 231 */ 232 public ST getPrefixEgDR() { 233 return getTyped(5, ST.class); 234 } 235 236 237 /** 238 * Returns Prefix (e.g., DR) (component 6). This is a convenience method that saves you from 239 * casting and handling an exception. 240 */ 241 public ST getXcn6_PrefixEgDR() { 242 return getTyped(5, ST.class); 243 } 244 245 246 /** 247 * Returns Degree (e.g., MD) (component 7). This is a convenience method that saves you from 248 * casting and handling an exception. 249 */ 250 public ST getDegreeEgMD() { 251 return getTyped(6, ST.class); 252 } 253 254 255 /** 256 * Returns Degree (e.g., MD) (component 7). This is a convenience method that saves you from 257 * casting and handling an exception. 258 */ 259 public ST getXcn7_DegreeEgMD() { 260 return getTyped(6, ST.class); 261 } 262 263 264 /** 265 * Returns Source Table (component 8). This is a convenience method that saves you from 266 * casting and handling an exception. 267 */ 268 public CWE getSourceTable() { 269 return getTyped(7, CWE.class); 270 } 271 272 273 /** 274 * Returns Source Table (component 8). This is a convenience method that saves you from 275 * casting and handling an exception. 276 */ 277 public CWE getXcn8_SourceTable() { 278 return getTyped(7, CWE.class); 279 } 280 281 282 /** 283 * Returns Assigning Authority (component 9). This is a convenience method that saves you from 284 * casting and handling an exception. 285 */ 286 public HD getAssigningAuthority() { 287 return getTyped(8, HD.class); 288 } 289 290 291 /** 292 * Returns Assigning Authority (component 9). This is a convenience method that saves you from 293 * casting and handling an exception. 294 */ 295 public HD getXcn9_AssigningAuthority() { 296 return getTyped(8, HD.class); 297 } 298 299 300 /** 301 * Returns Name Type Code (component 10). This is a convenience method that saves you from 302 * casting and handling an exception. 303 */ 304 public ID getNameTypeCode() { 305 return getTyped(9, ID.class); 306 } 307 308 309 /** 310 * Returns Name Type Code (component 10). This is a convenience method that saves you from 311 * casting and handling an exception. 312 */ 313 public ID getXcn10_NameTypeCode() { 314 return getTyped(9, ID.class); 315 } 316 317 318 /** 319 * Returns Identifier Check Digit (component 11). This is a convenience method that saves you from 320 * casting and handling an exception. 321 */ 322 public ST getIdentifierCheckDigit() { 323 return getTyped(10, ST.class); 324 } 325 326 327 /** 328 * Returns Identifier Check Digit (component 11). This is a convenience method that saves you from 329 * casting and handling an exception. 330 */ 331 public ST getXcn11_IdentifierCheckDigit() { 332 return getTyped(10, ST.class); 333 } 334 335 336 /** 337 * Returns Check Digit Scheme (component 12). This is a convenience method that saves you from 338 * casting and handling an exception. 339 */ 340 public ID getCheckDigitScheme() { 341 return getTyped(11, ID.class); 342 } 343 344 345 /** 346 * Returns Check Digit Scheme (component 12). This is a convenience method that saves you from 347 * casting and handling an exception. 348 */ 349 public ID getXcn12_CheckDigitScheme() { 350 return getTyped(11, ID.class); 351 } 352 353 354 /** 355 * Returns Identifier Type Code (component 13). This is a convenience method that saves you from 356 * casting and handling an exception. 357 */ 358 public ID getIdentifierTypeCode() { 359 return getTyped(12, ID.class); 360 } 361 362 363 /** 364 * Returns Identifier Type Code (component 13). This is a convenience method that saves you from 365 * casting and handling an exception. 366 */ 367 public ID getXcn13_IdentifierTypeCode() { 368 return getTyped(12, ID.class); 369 } 370 371 372 /** 373 * Returns Assigning Facility (component 14). This is a convenience method that saves you from 374 * casting and handling an exception. 375 */ 376 public HD getAssigningFacility() { 377 return getTyped(13, HD.class); 378 } 379 380 381 /** 382 * Returns Assigning Facility (component 14). This is a convenience method that saves you from 383 * casting and handling an exception. 384 */ 385 public HD getXcn14_AssigningFacility() { 386 return getTyped(13, HD.class); 387 } 388 389 390 /** 391 * Returns Name Representation Code (component 15). This is a convenience method that saves you from 392 * casting and handling an exception. 393 */ 394 public ID getNameRepresentationCode() { 395 return getTyped(14, ID.class); 396 } 397 398 399 /** 400 * Returns Name Representation Code (component 15). This is a convenience method that saves you from 401 * casting and handling an exception. 402 */ 403 public ID getXcn15_NameRepresentationCode() { 404 return getTyped(14, ID.class); 405 } 406 407 408 /** 409 * Returns Name Context (component 16). This is a convenience method that saves you from 410 * casting and handling an exception. 411 */ 412 public CWE getNameContext() { 413 return getTyped(15, CWE.class); 414 } 415 416 417 /** 418 * Returns Name Context (component 16). This is a convenience method that saves you from 419 * casting and handling an exception. 420 */ 421 public CWE getXcn16_NameContext() { 422 return getTyped(15, CWE.class); 423 } 424 425 426 /** 427 * Returns Name Validity Range (component 17). This is a convenience method that saves you from 428 * casting and handling an exception. 429 */ 430 public ST getNameValidityRange() { 431 return getTyped(16, ST.class); 432 } 433 434 435 /** 436 * Returns Name Validity Range (component 17). This is a convenience method that saves you from 437 * casting and handling an exception. 438 */ 439 public ST getXcn17_NameValidityRange() { 440 return getTyped(16, ST.class); 441 } 442 443 444 /** 445 * Returns Name Assembly Order (component 18). This is a convenience method that saves you from 446 * casting and handling an exception. 447 */ 448 public ID getNameAssemblyOrder() { 449 return getTyped(17, ID.class); 450 } 451 452 453 /** 454 * Returns Name Assembly Order (component 18). This is a convenience method that saves you from 455 * casting and handling an exception. 456 */ 457 public ID getXcn18_NameAssemblyOrder() { 458 return getTyped(17, ID.class); 459 } 460 461 462 /** 463 * Returns Effective Date (component 19). This is a convenience method that saves you from 464 * casting and handling an exception. 465 */ 466 public DTM getEffectiveDate() { 467 return getTyped(18, DTM.class); 468 } 469 470 471 /** 472 * Returns Effective Date (component 19). This is a convenience method that saves you from 473 * casting and handling an exception. 474 */ 475 public DTM getXcn19_EffectiveDate() { 476 return getTyped(18, DTM.class); 477 } 478 479 480 /** 481 * Returns Expiration Date (component 20). This is a convenience method that saves you from 482 * casting and handling an exception. 483 */ 484 public DTM getExpirationDate() { 485 return getTyped(19, DTM.class); 486 } 487 488 489 /** 490 * Returns Expiration Date (component 20). This is a convenience method that saves you from 491 * casting and handling an exception. 492 */ 493 public DTM getXcn20_ExpirationDate() { 494 return getTyped(19, DTM.class); 495 } 496 497 498 /** 499 * Returns Professional Suffix (component 21). This is a convenience method that saves you from 500 * casting and handling an exception. 501 */ 502 public ST getProfessionalSuffix() { 503 return getTyped(20, ST.class); 504 } 505 506 507 /** 508 * Returns Professional Suffix (component 21). This is a convenience method that saves you from 509 * casting and handling an exception. 510 */ 511 public ST getXcn21_ProfessionalSuffix() { 512 return getTyped(20, ST.class); 513 } 514 515 516 /** 517 * Returns Assigning Jurisdiction (component 22). This is a convenience method that saves you from 518 * casting and handling an exception. 519 */ 520 public CWE getAssigningJurisdiction() { 521 return getTyped(21, CWE.class); 522 } 523 524 525 /** 526 * Returns Assigning Jurisdiction (component 22). This is a convenience method that saves you from 527 * casting and handling an exception. 528 */ 529 public CWE getXcn22_AssigningJurisdiction() { 530 return getTyped(21, CWE.class); 531 } 532 533 534 /** 535 * Returns Assigning Agency or Department (component 23). This is a convenience method that saves you from 536 * casting and handling an exception. 537 */ 538 public CWE getAssigningAgencyOrDepartment() { 539 return getTyped(22, CWE.class); 540 } 541 542 543 /** 544 * Returns Assigning Agency or Department (component 23). This is a convenience method that saves you from 545 * casting and handling an exception. 546 */ 547 public CWE getXcn23_AssigningAgencyOrDepartment() { 548 return getTyped(22, CWE.class); 549 } 550 551 552 /** 553 * Returns Security Check (component 24). This is a convenience method that saves you from 554 * casting and handling an exception. 555 */ 556 public ST getSecurityCheck() { 557 return getTyped(23, ST.class); 558 } 559 560 561 /** 562 * Returns Security Check (component 24). This is a convenience method that saves you from 563 * casting and handling an exception. 564 */ 565 public ST getXcn24_SecurityCheck() { 566 return getTyped(23, ST.class); 567 } 568 569 570 /** 571 * Returns Security Check Scheme (component 25). This is a convenience method that saves you from 572 * casting and handling an exception. 573 */ 574 public ID getSecurityCheckScheme() { 575 return getTyped(24, ID.class); 576 } 577 578 579 /** 580 * Returns Security Check Scheme (component 25). This is a convenience method that saves you from 581 * casting and handling an exception. 582 */ 583 public ID getXcn25_SecurityCheckScheme() { 584 return getTyped(24, ID.class); 585 } 586 587 588 589 } 590