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