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.v251.message; 035 036import ca.uhn.hl7v2.model.v251.group.*; 037import ca.uhn.hl7v2.model.v251.segment.*; 038 039import ca.uhn.hl7v2.HL7Exception; 040import ca.uhn.hl7v2.parser.ModelClassFactory; 041import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 042import ca.uhn.hl7v2.model.*; 043 044 045/** 046 * <p>Represents a RCI_I05 message structure (see chapter 11.3.5). This structure contains the 047 * following elements: </p> 048 * <ul> 049 * <li>1: MSH (Message Header) <b> </b> </li> 050 * <li>2: SFT (Software Segment) <b>optional repeating</b> </li> 051 * <li>3: MSA (Message Acknowledgment) <b> </b> </li> 052 * <li>4: QRD (Original-Style Query Definition) <b> </b> </li> 053 * <li>5: QRF (Original style query filter) <b>optional </b> </li> 054 * <li>6: RCI_I05_PROVIDER (a Group object) <b> repeating</b> </li> 055 * <li>7: PID (Patient Identification) <b> </b> </li> 056 * <li>8: DG1 (Diagnosis) <b>optional repeating</b> </li> 057 * <li>9: DRG (Diagnosis Related Group) <b>optional repeating</b> </li> 058 * <li>10: AL1 (Patient Allergy Information) <b>optional repeating</b> </li> 059 * <li>11: RCI_I05_OBSERVATION (a Group object) <b>optional repeating</b> </li> 060 * <li>12: NTE (Notes and Comments) <b>optional repeating</b> </li> 061 * </ul> 062 */ 063//@SuppressWarnings("unused") 064public class RCI_I05 extends AbstractMessage { 065 066 /** 067 * Creates a new RCI_I05 message with DefaultModelClassFactory. 068 */ 069 public RCI_I05() { 070 this(new DefaultModelClassFactory()); 071 } 072 073 /** 074 * Creates a new RCI_I05 message with custom ModelClassFactory. 075 */ 076 public RCI_I05(ModelClassFactory factory) { 077 super(factory); 078 init(factory); 079 } 080 081 private void init(ModelClassFactory factory) { 082 try { 083 this.add(MSH.class, true, false); 084 this.add(SFT.class, false, true); 085 this.add(MSA.class, true, false); 086 this.add(QRD.class, true, false); 087 this.add(QRF.class, false, false); 088 this.add(RCI_I05_PROVIDER.class, true, true); 089 this.add(PID.class, true, false); 090 this.add(DG1.class, false, true); 091 this.add(DRG.class, false, true); 092 this.add(AL1.class, false, true); 093 this.add(RCI_I05_OBSERVATION.class, false, true); 094 this.add(NTE.class, false, true); 095 } catch(HL7Exception e) { 096 log.error("Unexpected error creating RCI_I05 - this is probably a bug in the source code generator.", e); 097 } 098 } 099 100 101 /** 102 * Returns "2.5.1" 103 */ 104 public String getVersion() { 105 return "2.5.1"; 106 } 107 108 109 110 111 /** 112 * <p> 113 * Returns 114 * MSH (Message Header) - creates it if necessary 115 * </p> 116 * 117 * 118 */ 119 public MSH getMSH() { 120 return getTyped("MSH", MSH.class); 121 } 122 123 124 125 126 127 /** 128 * <p> 129 * Returns 130 * the first repetition of 131 * SFT (Software Segment) - creates it if necessary 132 * </p> 133 * 134 * 135 */ 136 public SFT getSFT() { 137 return getTyped("SFT", SFT.class); 138 } 139 140 141 /** 142 * <p> 143 * Returns a specific repetition of 144 * SFT (Software Segment) - creates it if necessary 145 * </p> 146 * 147 * 148 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 149 * @throws HL7Exception if the repetition requested is more than one 150 * greater than the number of existing repetitions. 151 */ 152 public SFT getSFT(int rep) { 153 return getTyped("SFT", rep, SFT.class); 154 } 155 156 /** 157 * <p> 158 * Returns the number of existing repetitions of SFT 159 * </p> 160 * 161 */ 162 public int getSFTReps() { 163 return getReps("SFT"); 164 } 165 166 /** 167 * <p> 168 * Returns a non-modifiable List containing all current existing repetitions of SFT. 169 * <p> 170 * <p> 171 * Note that unlike {@link #getSFT()}, this method will not create any reps 172 * if none are already present, so an empty list may be returned. 173 * </p> 174 * 175 */ 176 public java.util.List<SFT> getSFTAll() throws HL7Exception { 177 return getAllAsList("SFT", SFT.class); 178 } 179 180 /** 181 * <p> 182 * Inserts a specific repetition of SFT (Software Segment) 183 * </p> 184 * 185 * 186 * @see AbstractGroup#insertRepetition(Structure, int) 187 */ 188 public void insertSFT(SFT structure, int rep) throws HL7Exception { 189 super.insertRepetition( "SFT", structure, rep); 190 } 191 192 193 /** 194 * <p> 195 * Inserts a specific repetition of SFT (Software Segment) 196 * </p> 197 * 198 * 199 * @see AbstractGroup#insertRepetition(Structure, int) 200 */ 201 public SFT insertSFT(int rep) throws HL7Exception { 202 return (SFT)super.insertRepetition("SFT", rep); 203 } 204 205 206 /** 207 * <p> 208 * Removes a specific repetition of SFT (Software Segment) 209 * </p> 210 * 211 * 212 * @see AbstractGroup#removeRepetition(String, int) 213 */ 214 public SFT removeSFT(int rep) throws HL7Exception { 215 return (SFT)super.removeRepetition("SFT", rep); 216 } 217 218 219 220 221 /** 222 * <p> 223 * Returns 224 * MSA (Message Acknowledgment) - creates it if necessary 225 * </p> 226 * 227 * 228 */ 229 public MSA getMSA() { 230 return getTyped("MSA", MSA.class); 231 } 232 233 234 235 236 237 /** 238 * <p> 239 * Returns 240 * QRD (Original-Style Query Definition) - creates it if necessary 241 * </p> 242 * 243 * 244 */ 245 public QRD getQRD() { 246 return getTyped("QRD", QRD.class); 247 } 248 249 250 251 252 253 /** 254 * <p> 255 * Returns 256 * QRF (Original style query filter) - creates it if necessary 257 * </p> 258 * 259 * 260 */ 261 public QRF getQRF() { 262 return getTyped("QRF", QRF.class); 263 } 264 265 266 267 268 269 /** 270 * <p> 271 * Returns 272 * the first repetition of 273 * PROVIDER (a Group object) - creates it if necessary 274 * </p> 275 * 276 * 277 */ 278 public RCI_I05_PROVIDER getPROVIDER() { 279 return getTyped("PROVIDER", RCI_I05_PROVIDER.class); 280 } 281 282 283 /** 284 * <p> 285 * Returns a specific repetition of 286 * PROVIDER (a Group object) - creates it if necessary 287 * </p> 288 * 289 * 290 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 291 * @throws HL7Exception if the repetition requested is more than one 292 * greater than the number of existing repetitions. 293 */ 294 public RCI_I05_PROVIDER getPROVIDER(int rep) { 295 return getTyped("PROVIDER", rep, RCI_I05_PROVIDER.class); 296 } 297 298 /** 299 * <p> 300 * Returns the number of existing repetitions of PROVIDER 301 * </p> 302 * 303 */ 304 public int getPROVIDERReps() { 305 return getReps("PROVIDER"); 306 } 307 308 /** 309 * <p> 310 * Returns a non-modifiable List containing all current existing repetitions of PROVIDER. 311 * <p> 312 * <p> 313 * Note that unlike {@link #getPROVIDER()}, this method will not create any reps 314 * if none are already present, so an empty list may be returned. 315 * </p> 316 * 317 */ 318 public java.util.List<RCI_I05_PROVIDER> getPROVIDERAll() throws HL7Exception { 319 return getAllAsList("PROVIDER", RCI_I05_PROVIDER.class); 320 } 321 322 /** 323 * <p> 324 * Inserts a specific repetition of PROVIDER (a Group object) 325 * </p> 326 * 327 * 328 * @see AbstractGroup#insertRepetition(Structure, int) 329 */ 330 public void insertPROVIDER(RCI_I05_PROVIDER structure, int rep) throws HL7Exception { 331 super.insertRepetition( "PROVIDER", structure, rep); 332 } 333 334 335 /** 336 * <p> 337 * Inserts a specific repetition of PROVIDER (a Group object) 338 * </p> 339 * 340 * 341 * @see AbstractGroup#insertRepetition(Structure, int) 342 */ 343 public RCI_I05_PROVIDER insertPROVIDER(int rep) throws HL7Exception { 344 return (RCI_I05_PROVIDER)super.insertRepetition("PROVIDER", rep); 345 } 346 347 348 /** 349 * <p> 350 * Removes a specific repetition of PROVIDER (a Group object) 351 * </p> 352 * 353 * 354 * @see AbstractGroup#removeRepetition(String, int) 355 */ 356 public RCI_I05_PROVIDER removePROVIDER(int rep) throws HL7Exception { 357 return (RCI_I05_PROVIDER)super.removeRepetition("PROVIDER", rep); 358 } 359 360 361 362 363 /** 364 * <p> 365 * Returns 366 * PID (Patient Identification) - creates it if necessary 367 * </p> 368 * 369 * 370 */ 371 public PID getPID() { 372 return getTyped("PID", PID.class); 373 } 374 375 376 377 378 379 /** 380 * <p> 381 * Returns 382 * the first repetition of 383 * DG1 (Diagnosis) - creates it if necessary 384 * </p> 385 * 386 * 387 */ 388 public DG1 getDG1() { 389 return getTyped("DG1", DG1.class); 390 } 391 392 393 /** 394 * <p> 395 * Returns a specific repetition of 396 * DG1 (Diagnosis) - creates it if necessary 397 * </p> 398 * 399 * 400 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 401 * @throws HL7Exception if the repetition requested is more than one 402 * greater than the number of existing repetitions. 403 */ 404 public DG1 getDG1(int rep) { 405 return getTyped("DG1", rep, DG1.class); 406 } 407 408 /** 409 * <p> 410 * Returns the number of existing repetitions of DG1 411 * </p> 412 * 413 */ 414 public int getDG1Reps() { 415 return getReps("DG1"); 416 } 417 418 /** 419 * <p> 420 * Returns a non-modifiable List containing all current existing repetitions of DG1. 421 * <p> 422 * <p> 423 * Note that unlike {@link #getDG1()}, this method will not create any reps 424 * if none are already present, so an empty list may be returned. 425 * </p> 426 * 427 */ 428 public java.util.List<DG1> getDG1All() throws HL7Exception { 429 return getAllAsList("DG1", DG1.class); 430 } 431 432 /** 433 * <p> 434 * Inserts a specific repetition of DG1 (Diagnosis) 435 * </p> 436 * 437 * 438 * @see AbstractGroup#insertRepetition(Structure, int) 439 */ 440 public void insertDG1(DG1 structure, int rep) throws HL7Exception { 441 super.insertRepetition( "DG1", structure, rep); 442 } 443 444 445 /** 446 * <p> 447 * Inserts a specific repetition of DG1 (Diagnosis) 448 * </p> 449 * 450 * 451 * @see AbstractGroup#insertRepetition(Structure, int) 452 */ 453 public DG1 insertDG1(int rep) throws HL7Exception { 454 return (DG1)super.insertRepetition("DG1", rep); 455 } 456 457 458 /** 459 * <p> 460 * Removes a specific repetition of DG1 (Diagnosis) 461 * </p> 462 * 463 * 464 * @see AbstractGroup#removeRepetition(String, int) 465 */ 466 public DG1 removeDG1(int rep) throws HL7Exception { 467 return (DG1)super.removeRepetition("DG1", rep); 468 } 469 470 471 472 473 /** 474 * <p> 475 * Returns 476 * the first repetition of 477 * DRG (Diagnosis Related Group) - creates it if necessary 478 * </p> 479 * 480 * 481 */ 482 public DRG getDRG() { 483 return getTyped("DRG", DRG.class); 484 } 485 486 487 /** 488 * <p> 489 * Returns a specific repetition of 490 * DRG (Diagnosis Related Group) - creates it if necessary 491 * </p> 492 * 493 * 494 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 495 * @throws HL7Exception if the repetition requested is more than one 496 * greater than the number of existing repetitions. 497 */ 498 public DRG getDRG(int rep) { 499 return getTyped("DRG", rep, DRG.class); 500 } 501 502 /** 503 * <p> 504 * Returns the number of existing repetitions of DRG 505 * </p> 506 * 507 */ 508 public int getDRGReps() { 509 return getReps("DRG"); 510 } 511 512 /** 513 * <p> 514 * Returns a non-modifiable List containing all current existing repetitions of DRG. 515 * <p> 516 * <p> 517 * Note that unlike {@link #getDRG()}, this method will not create any reps 518 * if none are already present, so an empty list may be returned. 519 * </p> 520 * 521 */ 522 public java.util.List<DRG> getDRGAll() throws HL7Exception { 523 return getAllAsList("DRG", DRG.class); 524 } 525 526 /** 527 * <p> 528 * Inserts a specific repetition of DRG (Diagnosis Related Group) 529 * </p> 530 * 531 * 532 * @see AbstractGroup#insertRepetition(Structure, int) 533 */ 534 public void insertDRG(DRG structure, int rep) throws HL7Exception { 535 super.insertRepetition( "DRG", structure, rep); 536 } 537 538 539 /** 540 * <p> 541 * Inserts a specific repetition of DRG (Diagnosis Related Group) 542 * </p> 543 * 544 * 545 * @see AbstractGroup#insertRepetition(Structure, int) 546 */ 547 public DRG insertDRG(int rep) throws HL7Exception { 548 return (DRG)super.insertRepetition("DRG", rep); 549 } 550 551 552 /** 553 * <p> 554 * Removes a specific repetition of DRG (Diagnosis Related Group) 555 * </p> 556 * 557 * 558 * @see AbstractGroup#removeRepetition(String, int) 559 */ 560 public DRG removeDRG(int rep) throws HL7Exception { 561 return (DRG)super.removeRepetition("DRG", rep); 562 } 563 564 565 566 567 /** 568 * <p> 569 * Returns 570 * the first repetition of 571 * AL1 (Patient Allergy Information) - creates it if necessary 572 * </p> 573 * 574 * 575 */ 576 public AL1 getAL1() { 577 return getTyped("AL1", AL1.class); 578 } 579 580 581 /** 582 * <p> 583 * Returns a specific repetition of 584 * AL1 (Patient Allergy Information) - creates it if necessary 585 * </p> 586 * 587 * 588 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 589 * @throws HL7Exception if the repetition requested is more than one 590 * greater than the number of existing repetitions. 591 */ 592 public AL1 getAL1(int rep) { 593 return getTyped("AL1", rep, AL1.class); 594 } 595 596 /** 597 * <p> 598 * Returns the number of existing repetitions of AL1 599 * </p> 600 * 601 */ 602 public int getAL1Reps() { 603 return getReps("AL1"); 604 } 605 606 /** 607 * <p> 608 * Returns a non-modifiable List containing all current existing repetitions of AL1. 609 * <p> 610 * <p> 611 * Note that unlike {@link #getAL1()}, this method will not create any reps 612 * if none are already present, so an empty list may be returned. 613 * </p> 614 * 615 */ 616 public java.util.List<AL1> getAL1All() throws HL7Exception { 617 return getAllAsList("AL1", AL1.class); 618 } 619 620 /** 621 * <p> 622 * Inserts a specific repetition of AL1 (Patient Allergy Information) 623 * </p> 624 * 625 * 626 * @see AbstractGroup#insertRepetition(Structure, int) 627 */ 628 public void insertAL1(AL1 structure, int rep) throws HL7Exception { 629 super.insertRepetition( "AL1", structure, rep); 630 } 631 632 633 /** 634 * <p> 635 * Inserts a specific repetition of AL1 (Patient Allergy Information) 636 * </p> 637 * 638 * 639 * @see AbstractGroup#insertRepetition(Structure, int) 640 */ 641 public AL1 insertAL1(int rep) throws HL7Exception { 642 return (AL1)super.insertRepetition("AL1", rep); 643 } 644 645 646 /** 647 * <p> 648 * Removes a specific repetition of AL1 (Patient Allergy Information) 649 * </p> 650 * 651 * 652 * @see AbstractGroup#removeRepetition(String, int) 653 */ 654 public AL1 removeAL1(int rep) throws HL7Exception { 655 return (AL1)super.removeRepetition("AL1", rep); 656 } 657 658 659 660 661 /** 662 * <p> 663 * Returns 664 * the first repetition of 665 * OBSERVATION (a Group object) - creates it if necessary 666 * </p> 667 * 668 * 669 */ 670 public RCI_I05_OBSERVATION getOBSERVATION() { 671 return getTyped("OBSERVATION", RCI_I05_OBSERVATION.class); 672 } 673 674 675 /** 676 * <p> 677 * Returns a specific repetition of 678 * OBSERVATION (a Group object) - creates it if necessary 679 * </p> 680 * 681 * 682 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 683 * @throws HL7Exception if the repetition requested is more than one 684 * greater than the number of existing repetitions. 685 */ 686 public RCI_I05_OBSERVATION getOBSERVATION(int rep) { 687 return getTyped("OBSERVATION", rep, RCI_I05_OBSERVATION.class); 688 } 689 690 /** 691 * <p> 692 * Returns the number of existing repetitions of OBSERVATION 693 * </p> 694 * 695 */ 696 public int getOBSERVATIONReps() { 697 return getReps("OBSERVATION"); 698 } 699 700 /** 701 * <p> 702 * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION. 703 * <p> 704 * <p> 705 * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps 706 * if none are already present, so an empty list may be returned. 707 * </p> 708 * 709 */ 710 public java.util.List<RCI_I05_OBSERVATION> getOBSERVATIONAll() throws HL7Exception { 711 return getAllAsList("OBSERVATION", RCI_I05_OBSERVATION.class); 712 } 713 714 /** 715 * <p> 716 * Inserts a specific repetition of OBSERVATION (a Group object) 717 * </p> 718 * 719 * 720 * @see AbstractGroup#insertRepetition(Structure, int) 721 */ 722 public void insertOBSERVATION(RCI_I05_OBSERVATION structure, int rep) throws HL7Exception { 723 super.insertRepetition( "OBSERVATION", structure, rep); 724 } 725 726 727 /** 728 * <p> 729 * Inserts a specific repetition of OBSERVATION (a Group object) 730 * </p> 731 * 732 * 733 * @see AbstractGroup#insertRepetition(Structure, int) 734 */ 735 public RCI_I05_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 736 return (RCI_I05_OBSERVATION)super.insertRepetition("OBSERVATION", rep); 737 } 738 739 740 /** 741 * <p> 742 * Removes a specific repetition of OBSERVATION (a Group object) 743 * </p> 744 * 745 * 746 * @see AbstractGroup#removeRepetition(String, int) 747 */ 748 public RCI_I05_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 749 return (RCI_I05_OBSERVATION)super.removeRepetition("OBSERVATION", rep); 750 } 751 752 753 754 755 /** 756 * <p> 757 * Returns 758 * the first repetition of 759 * NTE (Notes and Comments) - creates it if necessary 760 * </p> 761 * 762 * 763 */ 764 public NTE getNTE() { 765 return getTyped("NTE", NTE.class); 766 } 767 768 769 /** 770 * <p> 771 * Returns a specific repetition of 772 * NTE (Notes and Comments) - creates it if necessary 773 * </p> 774 * 775 * 776 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 777 * @throws HL7Exception if the repetition requested is more than one 778 * greater than the number of existing repetitions. 779 */ 780 public NTE getNTE(int rep) { 781 return getTyped("NTE", rep, NTE.class); 782 } 783 784 /** 785 * <p> 786 * Returns the number of existing repetitions of NTE 787 * </p> 788 * 789 */ 790 public int getNTEReps() { 791 return getReps("NTE"); 792 } 793 794 /** 795 * <p> 796 * Returns a non-modifiable List containing all current existing repetitions of NTE. 797 * <p> 798 * <p> 799 * Note that unlike {@link #getNTE()}, this method will not create any reps 800 * if none are already present, so an empty list may be returned. 801 * </p> 802 * 803 */ 804 public java.util.List<NTE> getNTEAll() throws HL7Exception { 805 return getAllAsList("NTE", NTE.class); 806 } 807 808 /** 809 * <p> 810 * Inserts a specific repetition of NTE (Notes and Comments) 811 * </p> 812 * 813 * 814 * @see AbstractGroup#insertRepetition(Structure, int) 815 */ 816 public void insertNTE(NTE structure, int rep) throws HL7Exception { 817 super.insertRepetition( "NTE", structure, rep); 818 } 819 820 821 /** 822 * <p> 823 * Inserts a specific repetition of NTE (Notes and Comments) 824 * </p> 825 * 826 * 827 * @see AbstractGroup#insertRepetition(Structure, int) 828 */ 829 public NTE insertNTE(int rep) throws HL7Exception { 830 return (NTE)super.insertRepetition("NTE", rep); 831 } 832 833 834 /** 835 * <p> 836 * Removes a specific repetition of NTE (Notes and Comments) 837 * </p> 838 * 839 * 840 * @see AbstractGroup#removeRepetition(String, int) 841 */ 842 public NTE removeNTE(int rep) throws HL7Exception { 843 return (NTE)super.removeRepetition("NTE", rep); 844 } 845 846 847 848} 849