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 033 034package ca.uhn.hl7v2.model.v22.message; 035 036import ca.uhn.hl7v2.model.v22.group.*; 037import ca.uhn.hl7v2.model.v22.segment.*; 038 039import java.util.List; 040 041import ca.uhn.hl7v2.HL7Exception; 042import ca.uhn.hl7v2.parser.ModelClassFactory; 043import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 044import ca.uhn.hl7v2.model.AbstractMessage; 045 046/** 047 * <p>Represents a ADT_A14 message structure (see chapter ?). This structure contains the 048 * following elements: </p> 049 * <ul> 050 * <li>1: MSH (MESSAGE HEADER) <b> </b></li> 051 * <li>2: EVN (EVENT TYPE) <b> </b></li> 052 * <li>3: PID (PATIENT IDENTIFICATION) <b> </b></li> 053 * <li>4: NK1 (NEXT OF KIN) <b>optional repeating</b></li> 054 * <li>5: PV1 (PATIENT VISIT) <b> </b></li> 055 * <li>6: PV2 (PATIENT VISIT - additional information) <b>optional </b></li> 056 * <li>7: OBX (OBSERVATION RESULT) <b>optional repeating</b></li> 057 * <li>8: AL1 (PATIENT ALLERGY INFORMATION) <b>optional repeating</b></li> 058 * <li>9: DG1 (DIAGNOSIS) <b>optional repeating</b></li> 059 * <li>10: PR1 (PROCEDURES) <b>optional repeating</b></li> 060 * <li>11: GT1 (GUARANTOR) <b>optional repeating</b></li> 061 * <li>12: ADT_A14_INSURANCE (a Group object) <b>optional repeating</b></li> 062 * <li>13: ACC (ACCIDENT) <b>optional </b></li> 063 * <li>14: UB1 (UB82 DATA) <b>optional </b></li> 064 * <li>15: UB2 (UB92 DATA) <b>optional </b></li> 065 * </ul> 066 */ 067@SuppressWarnings("unused") 068public class ADT_A14 extends AbstractMessage { 069 070 /** 071 * Creates a new ADT_A14 message with DefaultModelClassFactory. 072 */ 073 public ADT_A14() { 074 this(new DefaultModelClassFactory()); 075 } 076 077 /** 078 * Creates a new ADT_A14 message with custom ModelClassFactory. 079 */ 080 public ADT_A14(ModelClassFactory factory) { 081 super(factory); 082 init(factory); 083 } 084 085 private void init(ModelClassFactory factory) { 086 try { 087 this.add(MSH.class, true, false); 088 this.add(EVN.class, true, false); 089 this.add(PID.class, true, false); 090 this.add(NK1.class, false, true); 091 this.add(PV1.class, true, false); 092 this.add(PV2.class, false, false); 093 this.add(OBX.class, false, true); 094 this.add(AL1.class, false, true); 095 this.add(DG1.class, false, true); 096 this.add(PR1.class, false, true); 097 this.add(GT1.class, false, true); 098 this.add(ADT_A14_INSURANCE.class, false, true); 099 this.add(ACC.class, false, false); 100 this.add(UB1.class, false, false); 101 this.add(UB2.class, false, false); 102 } catch(HL7Exception e) { 103 log.error("Unexpected error creating ADT_A14 - this is probably a bug in the source code generator.", e); 104 } 105 } 106 107 /** 108 * Returns "2.2" 109 */ 110 public String getVersion() { 111 return "2.2"; 112 } 113 114 115 116 /** 117 * Returns 118 * MSH (MESSAGE HEADER) - creates it if necessary 119 */ 120 public MSH getMSH() { 121 return getTyped("MSH", MSH.class); 122 } 123 124 125 126 127 /** 128 * Returns 129 * EVN (EVENT TYPE) - creates it if necessary 130 */ 131 public EVN getEVN() { 132 return getTyped("EVN", EVN.class); 133 } 134 135 136 137 138 /** 139 * Returns 140 * PID (PATIENT IDENTIFICATION) - creates it if necessary 141 */ 142 public PID getPID() { 143 return getTyped("PID", PID.class); 144 } 145 146 147 148 149 /** 150 * Returns 151 * the first repetition of 152 * NK1 (NEXT OF KIN) - creates it if necessary 153 */ 154 public NK1 getNK1() { 155 return getTyped("NK1", NK1.class); 156 } 157 158 159 /** 160 * Returns a specific repetition of 161 * NK1 (NEXT OF KIN) - creates it if necessary 162 * 163 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 164 * @throws HL7Exception if the repetition requested is more than one 165 * greater than the number of existing repetitions. 166 */ 167 public NK1 getNK1(int rep) { 168 return getTyped("NK1", rep, NK1.class); 169 } 170 171 /** 172 * Returns the number of existing repetitions of NK1 173 */ 174 public int getNK1Reps() { 175 return getReps("NK1"); 176 } 177 178 /** 179 * <p> 180 * Returns a non-modifiable List containing all current existing repetitions of NK1. 181 * <p> 182 * <p> 183 * Note that unlike {@link #getNK1()}, this method will not create any reps 184 * if none are already present, so an empty list may be returned. 185 * </p> 186 */ 187 public List<NK1> getNK1All() throws HL7Exception { 188 return getAllAsList("NK1", NK1.class); 189 } 190 191 /** 192 * Inserts a specific repetition of NK1 (NEXT OF KIN) 193 * @see AbstractGroup#insertRepetition(Structure, int) 194 */ 195 public void insertNK1(NK1 structure, int rep) throws HL7Exception { 196 super.insertRepetition( "NK1", structure, rep); 197 } 198 199 200 /** 201 * Inserts a specific repetition of NK1 (NEXT OF KIN) 202 * @see AbstractGroup#insertRepetition(Structure, int) 203 */ 204 public NK1 insertNK1(int rep) throws HL7Exception { 205 return (NK1)super.insertRepetition("NK1", rep); 206 } 207 208 209 /** 210 * Removes a specific repetition of NK1 (NEXT OF KIN) 211 * @see AbstractGroup#removeRepetition(String, int) 212 */ 213 public NK1 removeNK1(int rep) throws HL7Exception { 214 return (NK1)super.removeRepetition("NK1", rep); 215 } 216 217 218 219 /** 220 * Returns 221 * PV1 (PATIENT VISIT) - creates it if necessary 222 */ 223 public PV1 getPV1() { 224 return getTyped("PV1", PV1.class); 225 } 226 227 228 229 230 /** 231 * Returns 232 * PV2 (PATIENT VISIT - additional information) - creates it if necessary 233 */ 234 public PV2 getPV2() { 235 return getTyped("PV2", PV2.class); 236 } 237 238 239 240 241 /** 242 * Returns 243 * the first repetition of 244 * OBX (OBSERVATION RESULT) - creates it if necessary 245 */ 246 public OBX getOBX() { 247 return getTyped("OBX", OBX.class); 248 } 249 250 251 /** 252 * Returns a specific repetition of 253 * OBX (OBSERVATION RESULT) - creates it if necessary 254 * 255 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 256 * @throws HL7Exception if the repetition requested is more than one 257 * greater than the number of existing repetitions. 258 */ 259 public OBX getOBX(int rep) { 260 return getTyped("OBX", rep, OBX.class); 261 } 262 263 /** 264 * Returns the number of existing repetitions of OBX 265 */ 266 public int getOBXReps() { 267 return getReps("OBX"); 268 } 269 270 /** 271 * <p> 272 * Returns a non-modifiable List containing all current existing repetitions of OBX. 273 * <p> 274 * <p> 275 * Note that unlike {@link #getOBX()}, this method will not create any reps 276 * if none are already present, so an empty list may be returned. 277 * </p> 278 */ 279 public List<OBX> getOBXAll() throws HL7Exception { 280 return getAllAsList("OBX", OBX.class); 281 } 282 283 /** 284 * Inserts a specific repetition of OBX (OBSERVATION RESULT) 285 * @see AbstractGroup#insertRepetition(Structure, int) 286 */ 287 public void insertOBX(OBX structure, int rep) throws HL7Exception { 288 super.insertRepetition( "OBX", structure, rep); 289 } 290 291 292 /** 293 * Inserts a specific repetition of OBX (OBSERVATION RESULT) 294 * @see AbstractGroup#insertRepetition(Structure, int) 295 */ 296 public OBX insertOBX(int rep) throws HL7Exception { 297 return (OBX)super.insertRepetition("OBX", rep); 298 } 299 300 301 /** 302 * Removes a specific repetition of OBX (OBSERVATION RESULT) 303 * @see AbstractGroup#removeRepetition(String, int) 304 */ 305 public OBX removeOBX(int rep) throws HL7Exception { 306 return (OBX)super.removeRepetition("OBX", rep); 307 } 308 309 310 311 /** 312 * Returns 313 * the first repetition of 314 * AL1 (PATIENT ALLERGY INFORMATION) - creates it if necessary 315 */ 316 public AL1 getAL1() { 317 return getTyped("AL1", AL1.class); 318 } 319 320 321 /** 322 * Returns a specific repetition of 323 * AL1 (PATIENT ALLERGY INFORMATION) - creates it if necessary 324 * 325 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 326 * @throws HL7Exception if the repetition requested is more than one 327 * greater than the number of existing repetitions. 328 */ 329 public AL1 getAL1(int rep) { 330 return getTyped("AL1", rep, AL1.class); 331 } 332 333 /** 334 * Returns the number of existing repetitions of AL1 335 */ 336 public int getAL1Reps() { 337 return getReps("AL1"); 338 } 339 340 /** 341 * <p> 342 * Returns a non-modifiable List containing all current existing repetitions of AL1. 343 * <p> 344 * <p> 345 * Note that unlike {@link #getAL1()}, this method will not create any reps 346 * if none are already present, so an empty list may be returned. 347 * </p> 348 */ 349 public List<AL1> getAL1All() throws HL7Exception { 350 return getAllAsList("AL1", AL1.class); 351 } 352 353 /** 354 * Inserts a specific repetition of AL1 (PATIENT ALLERGY INFORMATION) 355 * @see AbstractGroup#insertRepetition(Structure, int) 356 */ 357 public void insertAL1(AL1 structure, int rep) throws HL7Exception { 358 super.insertRepetition( "AL1", structure, rep); 359 } 360 361 362 /** 363 * Inserts a specific repetition of AL1 (PATIENT ALLERGY INFORMATION) 364 * @see AbstractGroup#insertRepetition(Structure, int) 365 */ 366 public AL1 insertAL1(int rep) throws HL7Exception { 367 return (AL1)super.insertRepetition("AL1", rep); 368 } 369 370 371 /** 372 * Removes a specific repetition of AL1 (PATIENT ALLERGY INFORMATION) 373 * @see AbstractGroup#removeRepetition(String, int) 374 */ 375 public AL1 removeAL1(int rep) throws HL7Exception { 376 return (AL1)super.removeRepetition("AL1", rep); 377 } 378 379 380 381 /** 382 * Returns 383 * the first repetition of 384 * DG1 (DIAGNOSIS) - creates it if necessary 385 */ 386 public DG1 getDG1() { 387 return getTyped("DG1", DG1.class); 388 } 389 390 391 /** 392 * Returns a specific repetition of 393 * DG1 (DIAGNOSIS) - creates it if necessary 394 * 395 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 396 * @throws HL7Exception if the repetition requested is more than one 397 * greater than the number of existing repetitions. 398 */ 399 public DG1 getDG1(int rep) { 400 return getTyped("DG1", rep, DG1.class); 401 } 402 403 /** 404 * Returns the number of existing repetitions of DG1 405 */ 406 public int getDG1Reps() { 407 return getReps("DG1"); 408 } 409 410 /** 411 * <p> 412 * Returns a non-modifiable List containing all current existing repetitions of DG1. 413 * <p> 414 * <p> 415 * Note that unlike {@link #getDG1()}, this method will not create any reps 416 * if none are already present, so an empty list may be returned. 417 * </p> 418 */ 419 public List<DG1> getDG1All() throws HL7Exception { 420 return getAllAsList("DG1", DG1.class); 421 } 422 423 /** 424 * Inserts a specific repetition of DG1 (DIAGNOSIS) 425 * @see AbstractGroup#insertRepetition(Structure, int) 426 */ 427 public void insertDG1(DG1 structure, int rep) throws HL7Exception { 428 super.insertRepetition( "DG1", structure, rep); 429 } 430 431 432 /** 433 * Inserts a specific repetition of DG1 (DIAGNOSIS) 434 * @see AbstractGroup#insertRepetition(Structure, int) 435 */ 436 public DG1 insertDG1(int rep) throws HL7Exception { 437 return (DG1)super.insertRepetition("DG1", rep); 438 } 439 440 441 /** 442 * Removes a specific repetition of DG1 (DIAGNOSIS) 443 * @see AbstractGroup#removeRepetition(String, int) 444 */ 445 public DG1 removeDG1(int rep) throws HL7Exception { 446 return (DG1)super.removeRepetition("DG1", rep); 447 } 448 449 450 451 /** 452 * Returns 453 * the first repetition of 454 * PR1 (PROCEDURES) - creates it if necessary 455 */ 456 public PR1 getPR1() { 457 return getTyped("PR1", PR1.class); 458 } 459 460 461 /** 462 * Returns a specific repetition of 463 * PR1 (PROCEDURES) - creates it if necessary 464 * 465 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 466 * @throws HL7Exception if the repetition requested is more than one 467 * greater than the number of existing repetitions. 468 */ 469 public PR1 getPR1(int rep) { 470 return getTyped("PR1", rep, PR1.class); 471 } 472 473 /** 474 * Returns the number of existing repetitions of PR1 475 */ 476 public int getPR1Reps() { 477 return getReps("PR1"); 478 } 479 480 /** 481 * <p> 482 * Returns a non-modifiable List containing all current existing repetitions of PR1. 483 * <p> 484 * <p> 485 * Note that unlike {@link #getPR1()}, this method will not create any reps 486 * if none are already present, so an empty list may be returned. 487 * </p> 488 */ 489 public List<PR1> getPR1All() throws HL7Exception { 490 return getAllAsList("PR1", PR1.class); 491 } 492 493 /** 494 * Inserts a specific repetition of PR1 (PROCEDURES) 495 * @see AbstractGroup#insertRepetition(Structure, int) 496 */ 497 public void insertPR1(PR1 structure, int rep) throws HL7Exception { 498 super.insertRepetition( "PR1", structure, rep); 499 } 500 501 502 /** 503 * Inserts a specific repetition of PR1 (PROCEDURES) 504 * @see AbstractGroup#insertRepetition(Structure, int) 505 */ 506 public PR1 insertPR1(int rep) throws HL7Exception { 507 return (PR1)super.insertRepetition("PR1", rep); 508 } 509 510 511 /** 512 * Removes a specific repetition of PR1 (PROCEDURES) 513 * @see AbstractGroup#removeRepetition(String, int) 514 */ 515 public PR1 removePR1(int rep) throws HL7Exception { 516 return (PR1)super.removeRepetition("PR1", rep); 517 } 518 519 520 521 /** 522 * Returns 523 * the first repetition of 524 * GT1 (GUARANTOR) - creates it if necessary 525 */ 526 public GT1 getGT1() { 527 return getTyped("GT1", GT1.class); 528 } 529 530 531 /** 532 * Returns a specific repetition of 533 * GT1 (GUARANTOR) - creates it if necessary 534 * 535 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 536 * @throws HL7Exception if the repetition requested is more than one 537 * greater than the number of existing repetitions. 538 */ 539 public GT1 getGT1(int rep) { 540 return getTyped("GT1", rep, GT1.class); 541 } 542 543 /** 544 * Returns the number of existing repetitions of GT1 545 */ 546 public int getGT1Reps() { 547 return getReps("GT1"); 548 } 549 550 /** 551 * <p> 552 * Returns a non-modifiable List containing all current existing repetitions of GT1. 553 * <p> 554 * <p> 555 * Note that unlike {@link #getGT1()}, this method will not create any reps 556 * if none are already present, so an empty list may be returned. 557 * </p> 558 */ 559 public List<GT1> getGT1All() throws HL7Exception { 560 return getAllAsList("GT1", GT1.class); 561 } 562 563 /** 564 * Inserts a specific repetition of GT1 (GUARANTOR) 565 * @see AbstractGroup#insertRepetition(Structure, int) 566 */ 567 public void insertGT1(GT1 structure, int rep) throws HL7Exception { 568 super.insertRepetition( "GT1", structure, rep); 569 } 570 571 572 /** 573 * Inserts a specific repetition of GT1 (GUARANTOR) 574 * @see AbstractGroup#insertRepetition(Structure, int) 575 */ 576 public GT1 insertGT1(int rep) throws HL7Exception { 577 return (GT1)super.insertRepetition("GT1", rep); 578 } 579 580 581 /** 582 * Removes a specific repetition of GT1 (GUARANTOR) 583 * @see AbstractGroup#removeRepetition(String, int) 584 */ 585 public GT1 removeGT1(int rep) throws HL7Exception { 586 return (GT1)super.removeRepetition("GT1", rep); 587 } 588 589 590 591 /** 592 * Returns 593 * the first repetition of 594 * INSURANCE (a Group object) - creates it if necessary 595 */ 596 public ADT_A14_INSURANCE getINSURANCE() { 597 return getTyped("INSURANCE", ADT_A14_INSURANCE.class); 598 } 599 600 601 /** 602 * Returns a specific repetition of 603 * INSURANCE (a Group object) - creates it if necessary 604 * 605 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 606 * @throws HL7Exception if the repetition requested is more than one 607 * greater than the number of existing repetitions. 608 */ 609 public ADT_A14_INSURANCE getINSURANCE(int rep) { 610 return getTyped("INSURANCE", rep, ADT_A14_INSURANCE.class); 611 } 612 613 /** 614 * Returns the number of existing repetitions of INSURANCE 615 */ 616 public int getINSURANCEReps() { 617 return getReps("INSURANCE"); 618 } 619 620 /** 621 * <p> 622 * Returns a non-modifiable List containing all current existing repetitions of INSURANCE. 623 * <p> 624 * <p> 625 * Note that unlike {@link #getINSURANCE()}, this method will not create any reps 626 * if none are already present, so an empty list may be returned. 627 * </p> 628 */ 629 public List<ADT_A14_INSURANCE> getINSURANCEAll() throws HL7Exception { 630 return getAllAsList("INSURANCE", ADT_A14_INSURANCE.class); 631 } 632 633 /** 634 * Inserts a specific repetition of INSURANCE (a Group object) 635 * @see AbstractGroup#insertRepetition(Structure, int) 636 */ 637 public void insertINSURANCE(ADT_A14_INSURANCE structure, int rep) throws HL7Exception { 638 super.insertRepetition( "INSURANCE", structure, rep); 639 } 640 641 642 /** 643 * Inserts a specific repetition of INSURANCE (a Group object) 644 * @see AbstractGroup#insertRepetition(Structure, int) 645 */ 646 public ADT_A14_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 647 return (ADT_A14_INSURANCE)super.insertRepetition("INSURANCE", rep); 648 } 649 650 651 /** 652 * Removes a specific repetition of INSURANCE (a Group object) 653 * @see AbstractGroup#removeRepetition(String, int) 654 */ 655 public ADT_A14_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 656 return (ADT_A14_INSURANCE)super.removeRepetition("INSURANCE", rep); 657 } 658 659 660 661 /** 662 * Returns 663 * ACC (ACCIDENT) - creates it if necessary 664 */ 665 public ACC getACC() { 666 return getTyped("ACC", ACC.class); 667 } 668 669 670 671 672 /** 673 * Returns 674 * UB1 (UB82 DATA) - creates it if necessary 675 */ 676 public UB1 getUB1() { 677 return getTyped("UB1", UB1.class); 678 } 679 680 681 682 683 /** 684 * Returns 685 * UB2 (UB92 DATA) - creates it if necessary 686 */ 687 public UB2 getUB2() { 688 return getTyped("UB2", UB2.class); 689 } 690 691 692 693 694} 695