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