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 "[file_name]". Description: 15 * "[one_line_description]" 16 * 17 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 18 * 2012. 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 34 package ca.uhn.hl7v2.model.v26.message; 35 36 import ca.uhn.hl7v2.model.v26.group.*; 37 import ca.uhn.hl7v2.model.v26.segment.*; 38 39 import ca.uhn.hl7v2.HL7Exception; 40 import ca.uhn.hl7v2.parser.ModelClassFactory; 41 import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 42 import ca.uhn.hl7v2.model.*; 43 44 45 /** 46 * <p>Represents a ORU_R30 message structure (see chapter 7.3.4). This structure contains the 47 * following elements: </p> 48 * <ul> 49 * <li>1: MSH (Message Header) <b> </b> </li> 50 * <li>2: SFT (Software Segment) <b>optional repeating</b> </li> 51 * <li>3: UAC (User Authentication Credential Segment) <b>optional </b> </li> 52 * <li>4: PID (Patient Identification) <b> </b> </li> 53 * <li>5: PD1 (Patient Additional Demographic) <b>optional </b> </li> 54 * <li>6: OBX (Observation/Result) <b>optional repeating</b> </li> 55 * <li>7: ORU_R30_VISIT (a Group object) <b>optional </b> </li> 56 * <li>8: ORC (Common Order) <b> </b> </li> 57 * <li>9: OBR (Observation Request) <b> </b> </li> 58 * <li>10: NTE (Notes and Comments) <b>optional repeating</b> </li> 59 * <li>11: ROL (Role) <b>optional repeating</b> </li> 60 * <li>12: ORU_R30_TIMING_QTY (a Group object) <b>optional repeating</b> </li> 61 * <li>13: ORU_R30_OBSERVATION (a Group object) <b> repeating</b> </li> 62 * </ul> 63 */ 64 //@SuppressWarnings("unused") 65 public class ORU_R30 extends AbstractMessage { 66 67 /** 68 * Creates a new ORU_R30 message with DefaultModelClassFactory. 69 */ 70 public ORU_R30() { 71 this(new DefaultModelClassFactory()); 72 } 73 74 /** 75 * Creates a new ORU_R30 message with custom ModelClassFactory. 76 */ 77 public ORU_R30(ModelClassFactory factory) { 78 super(factory); 79 init(factory); 80 } 81 82 private void init(ModelClassFactory factory) { 83 try { 84 this.add(MSH.class, true, false); 85 this.add(SFT.class, false, true); 86 this.add(UAC.class, false, false); 87 this.add(PID.class, true, false); 88 this.add(PD1.class, false, false); 89 this.add(OBX.class, false, true); 90 this.add(ORU_R30_VISIT.class, false, false); 91 this.add(ORC.class, true, false); 92 this.add(OBR.class, true, false); 93 this.add(NTE.class, false, true); 94 this.add(ROL.class, false, true); 95 this.add(ORU_R30_TIMING_QTY.class, false, true); 96 this.add(ORU_R30_OBSERVATION.class, true, true); 97 } catch(HL7Exception e) { 98 log.error("Unexpected error creating ORU_R30 - this is probably a bug in the source code generator.", e); 99 } 100 } 101 102 103 /** 104 * Returns "2.6" 105 */ 106 public String getVersion() { 107 return "2.6"; 108 } 109 110 111 112 113 /** 114 * <p> 115 * Returns 116 * MSH (Message Header) - creates it if necessary 117 * </p> 118 * 119 * 120 */ 121 public MSH getMSH() { 122 return getTyped("MSH", MSH.class); 123 } 124 125 126 127 128 129 /** 130 * <p> 131 * Returns 132 * the first repetition of 133 * SFT (Software Segment) - creates it if necessary 134 * </p> 135 * 136 * 137 */ 138 public SFT getSFT() { 139 return getTyped("SFT", SFT.class); 140 } 141 142 143 /** 144 * <p> 145 * Returns a specific repetition of 146 * SFT (Software Segment) - creates it if necessary 147 * </p> 148 * 149 * 150 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 151 * @throws HL7Exception if the repetition requested is more than one 152 * greater than the number of existing repetitions. 153 */ 154 public SFT getSFT(int rep) { 155 return getTyped("SFT", rep, SFT.class); 156 } 157 158 /** 159 * <p> 160 * Returns the number of existing repetitions of SFT 161 * </p> 162 * 163 */ 164 public int getSFTReps() { 165 return getReps("SFT"); 166 } 167 168 /** 169 * <p> 170 * Returns a non-modifiable List containing all current existing repetitions of SFT. 171 * <p> 172 * <p> 173 * Note that unlike {@link #getSFT()}, this method will not create any reps 174 * if none are already present, so an empty list may be returned. 175 * </p> 176 * 177 */ 178 public java.util.List<SFT> getSFTAll() throws HL7Exception { 179 return getAllAsList("SFT", SFT.class); 180 } 181 182 /** 183 * <p> 184 * Inserts a specific repetition of SFT (Software Segment) 185 * </p> 186 * 187 * 188 * @see AbstractGroup#insertRepetition(Structure, int) 189 */ 190 public void insertSFT(SFT structure, int rep) throws HL7Exception { 191 super.insertRepetition( "SFT", structure, rep); 192 } 193 194 195 /** 196 * <p> 197 * Inserts a specific repetition of SFT (Software Segment) 198 * </p> 199 * 200 * 201 * @see AbstractGroup#insertRepetition(Structure, int) 202 */ 203 public SFT insertSFT(int rep) throws HL7Exception { 204 return (SFT)super.insertRepetition("SFT", rep); 205 } 206 207 208 /** 209 * <p> 210 * Removes a specific repetition of SFT (Software Segment) 211 * </p> 212 * 213 * 214 * @see AbstractGroup#removeRepetition(String, int) 215 */ 216 public SFT removeSFT(int rep) throws HL7Exception { 217 return (SFT)super.removeRepetition("SFT", rep); 218 } 219 220 221 222 223 /** 224 * <p> 225 * Returns 226 * UAC (User Authentication Credential Segment) - creates it if necessary 227 * </p> 228 * 229 * 230 */ 231 public UAC getUAC() { 232 return getTyped("UAC", UAC.class); 233 } 234 235 236 237 238 239 /** 240 * <p> 241 * Returns 242 * PID (Patient Identification) - creates it if necessary 243 * </p> 244 * 245 * 246 */ 247 public PID getPID() { 248 return getTyped("PID", PID.class); 249 } 250 251 252 253 254 255 /** 256 * <p> 257 * Returns 258 * PD1 (Patient Additional Demographic) - creates it if necessary 259 * </p> 260 * 261 * 262 */ 263 public PD1 getPD1() { 264 return getTyped("PD1", PD1.class); 265 } 266 267 268 269 270 271 /** 272 * <p> 273 * Returns 274 * the first repetition of 275 * OBX (Observation/Result) - creates it if necessary 276 * </p> 277 * 278 * 279 */ 280 public OBX getOBX() { 281 return getTyped("OBX", OBX.class); 282 } 283 284 285 /** 286 * <p> 287 * Returns a specific repetition of 288 * OBX (Observation/Result) - creates it if necessary 289 * </p> 290 * 291 * 292 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 293 * @throws HL7Exception if the repetition requested is more than one 294 * greater than the number of existing repetitions. 295 */ 296 public OBX getOBX(int rep) { 297 return getTyped("OBX", rep, OBX.class); 298 } 299 300 /** 301 * <p> 302 * Returns the number of existing repetitions of OBX 303 * </p> 304 * 305 */ 306 public int getOBXReps() { 307 return getReps("OBX"); 308 } 309 310 /** 311 * <p> 312 * Returns a non-modifiable List containing all current existing repetitions of OBX. 313 * <p> 314 * <p> 315 * Note that unlike {@link #getOBX()}, this method will not create any reps 316 * if none are already present, so an empty list may be returned. 317 * </p> 318 * 319 */ 320 public java.util.List<OBX> getOBXAll() throws HL7Exception { 321 return getAllAsList("OBX", OBX.class); 322 } 323 324 /** 325 * <p> 326 * Inserts a specific repetition of OBX (Observation/Result) 327 * </p> 328 * 329 * 330 * @see AbstractGroup#insertRepetition(Structure, int) 331 */ 332 public void insertOBX(OBX structure, int rep) throws HL7Exception { 333 super.insertRepetition( "OBX", structure, rep); 334 } 335 336 337 /** 338 * <p> 339 * Inserts a specific repetition of OBX (Observation/Result) 340 * </p> 341 * 342 * 343 * @see AbstractGroup#insertRepetition(Structure, int) 344 */ 345 public OBX insertOBX(int rep) throws HL7Exception { 346 return (OBX)super.insertRepetition("OBX", rep); 347 } 348 349 350 /** 351 * <p> 352 * Removes a specific repetition of OBX (Observation/Result) 353 * </p> 354 * 355 * 356 * @see AbstractGroup#removeRepetition(String, int) 357 */ 358 public OBX removeOBX(int rep) throws HL7Exception { 359 return (OBX)super.removeRepetition("OBX", rep); 360 } 361 362 363 364 365 /** 366 * <p> 367 * Returns 368 * VISIT (a Group object) - creates it if necessary 369 * </p> 370 * 371 * 372 */ 373 public ORU_R30_VISIT getVISIT() { 374 return getTyped("VISIT", ORU_R30_VISIT.class); 375 } 376 377 378 379 380 381 /** 382 * <p> 383 * Returns 384 * ORC (Common Order) - creates it if necessary 385 * </p> 386 * 387 * 388 */ 389 public ORC getORC() { 390 return getTyped("ORC", ORC.class); 391 } 392 393 394 395 396 397 /** 398 * <p> 399 * Returns 400 * OBR (Observation Request) - creates it if necessary 401 * </p> 402 * 403 * 404 */ 405 public OBR getOBR() { 406 return getTyped("OBR", OBR.class); 407 } 408 409 410 411 412 413 /** 414 * <p> 415 * Returns 416 * the first repetition of 417 * NTE (Notes and Comments) - creates it if necessary 418 * </p> 419 * 420 * 421 */ 422 public NTE getNTE() { 423 return getTyped("NTE", NTE.class); 424 } 425 426 427 /** 428 * <p> 429 * Returns a specific repetition of 430 * NTE (Notes and Comments) - creates it if necessary 431 * </p> 432 * 433 * 434 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 435 * @throws HL7Exception if the repetition requested is more than one 436 * greater than the number of existing repetitions. 437 */ 438 public NTE getNTE(int rep) { 439 return getTyped("NTE", rep, NTE.class); 440 } 441 442 /** 443 * <p> 444 * Returns the number of existing repetitions of NTE 445 * </p> 446 * 447 */ 448 public int getNTEReps() { 449 return getReps("NTE"); 450 } 451 452 /** 453 * <p> 454 * Returns a non-modifiable List containing all current existing repetitions of NTE. 455 * <p> 456 * <p> 457 * Note that unlike {@link #getNTE()}, this method will not create any reps 458 * if none are already present, so an empty list may be returned. 459 * </p> 460 * 461 */ 462 public java.util.List<NTE> getNTEAll() throws HL7Exception { 463 return getAllAsList("NTE", NTE.class); 464 } 465 466 /** 467 * <p> 468 * Inserts a specific repetition of NTE (Notes and Comments) 469 * </p> 470 * 471 * 472 * @see AbstractGroup#insertRepetition(Structure, int) 473 */ 474 public void insertNTE(NTE structure, int rep) throws HL7Exception { 475 super.insertRepetition( "NTE", structure, rep); 476 } 477 478 479 /** 480 * <p> 481 * Inserts a specific repetition of NTE (Notes and Comments) 482 * </p> 483 * 484 * 485 * @see AbstractGroup#insertRepetition(Structure, int) 486 */ 487 public NTE insertNTE(int rep) throws HL7Exception { 488 return (NTE)super.insertRepetition("NTE", rep); 489 } 490 491 492 /** 493 * <p> 494 * Removes a specific repetition of NTE (Notes and Comments) 495 * </p> 496 * 497 * 498 * @see AbstractGroup#removeRepetition(String, int) 499 */ 500 public NTE removeNTE(int rep) throws HL7Exception { 501 return (NTE)super.removeRepetition("NTE", rep); 502 } 503 504 505 506 507 /** 508 * <p> 509 * Returns 510 * the first repetition of 511 * ROL (Role) - creates it if necessary 512 * </p> 513 * 514 * 515 */ 516 public ROL getROL() { 517 return getTyped("ROL", ROL.class); 518 } 519 520 521 /** 522 * <p> 523 * Returns a specific repetition of 524 * ROL (Role) - creates it if necessary 525 * </p> 526 * 527 * 528 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 529 * @throws HL7Exception if the repetition requested is more than one 530 * greater than the number of existing repetitions. 531 */ 532 public ROL getROL(int rep) { 533 return getTyped("ROL", rep, ROL.class); 534 } 535 536 /** 537 * <p> 538 * Returns the number of existing repetitions of ROL 539 * </p> 540 * 541 */ 542 public int getROLReps() { 543 return getReps("ROL"); 544 } 545 546 /** 547 * <p> 548 * Returns a non-modifiable List containing all current existing repetitions of ROL. 549 * <p> 550 * <p> 551 * Note that unlike {@link #getROL()}, this method will not create any reps 552 * if none are already present, so an empty list may be returned. 553 * </p> 554 * 555 */ 556 public java.util.List<ROL> getROLAll() throws HL7Exception { 557 return getAllAsList("ROL", ROL.class); 558 } 559 560 /** 561 * <p> 562 * Inserts a specific repetition of ROL (Role) 563 * </p> 564 * 565 * 566 * @see AbstractGroup#insertRepetition(Structure, int) 567 */ 568 public void insertROL(ROL structure, int rep) throws HL7Exception { 569 super.insertRepetition( "ROL", structure, rep); 570 } 571 572 573 /** 574 * <p> 575 * Inserts a specific repetition of ROL (Role) 576 * </p> 577 * 578 * 579 * @see AbstractGroup#insertRepetition(Structure, int) 580 */ 581 public ROL insertROL(int rep) throws HL7Exception { 582 return (ROL)super.insertRepetition("ROL", rep); 583 } 584 585 586 /** 587 * <p> 588 * Removes a specific repetition of ROL (Role) 589 * </p> 590 * 591 * 592 * @see AbstractGroup#removeRepetition(String, int) 593 */ 594 public ROL removeROL(int rep) throws HL7Exception { 595 return (ROL)super.removeRepetition("ROL", rep); 596 } 597 598 599 600 601 /** 602 * <p> 603 * Returns 604 * the first repetition of 605 * TIMING_QTY (a Group object) - creates it if necessary 606 * </p> 607 * 608 * 609 */ 610 public ORU_R30_TIMING_QTY getTIMING_QTY() { 611 return getTyped("TIMING_QTY", ORU_R30_TIMING_QTY.class); 612 } 613 614 615 /** 616 * <p> 617 * Returns a specific repetition of 618 * TIMING_QTY (a Group object) - creates it if necessary 619 * </p> 620 * 621 * 622 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 623 * @throws HL7Exception if the repetition requested is more than one 624 * greater than the number of existing repetitions. 625 */ 626 public ORU_R30_TIMING_QTY getTIMING_QTY(int rep) { 627 return getTyped("TIMING_QTY", rep, ORU_R30_TIMING_QTY.class); 628 } 629 630 /** 631 * <p> 632 * Returns the number of existing repetitions of TIMING_QTY 633 * </p> 634 * 635 */ 636 public int getTIMING_QTYReps() { 637 return getReps("TIMING_QTY"); 638 } 639 640 /** 641 * <p> 642 * Returns a non-modifiable List containing all current existing repetitions of TIMING_QTY. 643 * <p> 644 * <p> 645 * Note that unlike {@link #getTIMING_QTY()}, this method will not create any reps 646 * if none are already present, so an empty list may be returned. 647 * </p> 648 * 649 */ 650 public java.util.List<ORU_R30_TIMING_QTY> getTIMING_QTYAll() throws HL7Exception { 651 return getAllAsList("TIMING_QTY", ORU_R30_TIMING_QTY.class); 652 } 653 654 /** 655 * <p> 656 * Inserts a specific repetition of TIMING_QTY (a Group object) 657 * </p> 658 * 659 * 660 * @see AbstractGroup#insertRepetition(Structure, int) 661 */ 662 public void insertTIMING_QTY(ORU_R30_TIMING_QTY structure, int rep) throws HL7Exception { 663 super.insertRepetition( "TIMING_QTY", structure, rep); 664 } 665 666 667 /** 668 * <p> 669 * Inserts a specific repetition of TIMING_QTY (a Group object) 670 * </p> 671 * 672 * 673 * @see AbstractGroup#insertRepetition(Structure, int) 674 */ 675 public ORU_R30_TIMING_QTY insertTIMING_QTY(int rep) throws HL7Exception { 676 return (ORU_R30_TIMING_QTY)super.insertRepetition("TIMING_QTY", rep); 677 } 678 679 680 /** 681 * <p> 682 * Removes a specific repetition of TIMING_QTY (a Group object) 683 * </p> 684 * 685 * 686 * @see AbstractGroup#removeRepetition(String, int) 687 */ 688 public ORU_R30_TIMING_QTY removeTIMING_QTY(int rep) throws HL7Exception { 689 return (ORU_R30_TIMING_QTY)super.removeRepetition("TIMING_QTY", rep); 690 } 691 692 693 694 695 /** 696 * <p> 697 * Returns 698 * the first repetition of 699 * OBSERVATION (a Group object) - creates it if necessary 700 * </p> 701 * 702 * 703 */ 704 public ORU_R30_OBSERVATION getOBSERVATION() { 705 return getTyped("OBSERVATION", ORU_R30_OBSERVATION.class); 706 } 707 708 709 /** 710 * <p> 711 * Returns a specific repetition of 712 * OBSERVATION (a Group object) - creates it if necessary 713 * </p> 714 * 715 * 716 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 717 * @throws HL7Exception if the repetition requested is more than one 718 * greater than the number of existing repetitions. 719 */ 720 public ORU_R30_OBSERVATION getOBSERVATION(int rep) { 721 return getTyped("OBSERVATION", rep, ORU_R30_OBSERVATION.class); 722 } 723 724 /** 725 * <p> 726 * Returns the number of existing repetitions of OBSERVATION 727 * </p> 728 * 729 */ 730 public int getOBSERVATIONReps() { 731 return getReps("OBSERVATION"); 732 } 733 734 /** 735 * <p> 736 * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION. 737 * <p> 738 * <p> 739 * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps 740 * if none are already present, so an empty list may be returned. 741 * </p> 742 * 743 */ 744 public java.util.List<ORU_R30_OBSERVATION> getOBSERVATIONAll() throws HL7Exception { 745 return getAllAsList("OBSERVATION", ORU_R30_OBSERVATION.class); 746 } 747 748 /** 749 * <p> 750 * Inserts a specific repetition of OBSERVATION (a Group object) 751 * </p> 752 * 753 * 754 * @see AbstractGroup#insertRepetition(Structure, int) 755 */ 756 public void insertOBSERVATION(ORU_R30_OBSERVATION structure, int rep) throws HL7Exception { 757 super.insertRepetition( "OBSERVATION", structure, rep); 758 } 759 760 761 /** 762 * <p> 763 * Inserts a specific repetition of OBSERVATION (a Group object) 764 * </p> 765 * 766 * 767 * @see AbstractGroup#insertRepetition(Structure, int) 768 */ 769 public ORU_R30_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 770 return (ORU_R30_OBSERVATION)super.insertRepetition("OBSERVATION", rep); 771 } 772 773 774 /** 775 * <p> 776 * Removes a specific repetition of OBSERVATION (a Group object) 777 * </p> 778 * 779 * 780 * @see AbstractGroup#removeRepetition(String, int) 781 */ 782 public ORU_R30_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 783 return (ORU_R30_OBSERVATION)super.removeRepetition("OBSERVATION", rep); 784 } 785 786 787 788 } 789