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