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.v22.group; 035 036import ca.uhn.hl7v2.model.v22.segment.*; 037 038import ca.uhn.hl7v2.HL7Exception; 039import ca.uhn.hl7v2.parser.ModelClassFactory; 040import ca.uhn.hl7v2.model.*; 041 042/** 043 * <p>Represents a BAR_P01_VISIT group structure (a Group object). 044 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together. 045 * This Group contains the following elements: 046 * </p> 047 * <ul> 048 * <li>1: PV1 (PATIENT VISIT) <b>optional </b></li> 049 * <li>2: PV2 (PATIENT VISIT - additional information) <b>optional </b></li> 050 * <li>3: OBX (OBSERVATION RESULT) <b>optional repeating </b></li> 051 * <li>4: AL1 (PATIENT ALLERGY INFORMATION) <b>optional repeating </b></li> 052 * <li>5: DG1 (DIAGNOSIS) <b>optional repeating </b></li> 053 * <li>6: PR1 (PROCEDURES) <b>optional repeating </b></li> 054 * <li>7: GT1 (GUARANTOR) <b>optional repeating </b></li> 055 * <li>8: NK1 (NEXT OF KIN) <b>optional repeating </b></li> 056 * <li>9: BAR_P01_INSURANCE (a Group object) <b>optional repeating </b></li> 057 * <li>10: ACC (ACCIDENT) <b>optional </b></li> 058 * <li>11: UB1 (UB82 DATA) <b>optional </b></li> 059 * <li>12: UB2 (UB92 DATA) <b>optional </b></li> 060 * </ul> 061 */ 062//@SuppressWarnings("unused") 063public class BAR_P01_VISIT extends AbstractGroup { 064 065 /** 066 * Creates a new BAR_P01_VISIT group 067 */ 068 public BAR_P01_VISIT(Group parent, ModelClassFactory factory) { 069 super(parent, factory); 070 init(factory); 071 } 072 073 private void init(ModelClassFactory factory) { 074 try { 075 this.add(PV1.class, false, false, false); 076 this.add(PV2.class, false, false, false); 077 this.add(OBX.class, false, true, false); 078 this.add(AL1.class, false, true, false); 079 this.add(DG1.class, false, true, false); 080 this.add(PR1.class, false, true, false); 081 this.add(GT1.class, false, true, false); 082 this.add(NK1.class, false, true, false); 083 this.add(BAR_P01_INSURANCE.class, false, true, false); 084 this.add(ACC.class, false, false, false); 085 this.add(UB1.class, false, false, false); 086 this.add(UB2.class, false, false, false); 087 } catch(HL7Exception e) { 088 log.error("Unexpected error creating BAR_P01_VISIT - this is probably a bug in the source code generator.", e); 089 } 090 } 091 092 /** 093 * Returns "2.2" 094 */ 095 public String getVersion() { 096 return "2.2"; 097 } 098 099 100 101 /** 102 * Returns 103 * PV1 (PATIENT VISIT) - creates it if necessary 104 */ 105 public PV1 getPV1() { 106 PV1 retVal = getTyped("PV1", PV1.class); 107 return retVal; 108 } 109 110 111 112 113 /** 114 * Returns 115 * PV2 (PATIENT VISIT - additional information) - creates it if necessary 116 */ 117 public PV2 getPV2() { 118 PV2 retVal = getTyped("PV2", PV2.class); 119 return retVal; 120 } 121 122 123 124 125 /** 126 * Returns 127 * the first repetition of 128 * OBX (OBSERVATION RESULT) - creates it if necessary 129 */ 130 public OBX getOBX() { 131 OBX retVal = getTyped("OBX", OBX.class); 132 return retVal; 133 } 134 135 136 /** 137 * Returns a specific repetition of 138 * OBX (OBSERVATION RESULT) - creates it if necessary 139 * 140 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 141 * @throws HL7Exception if the repetition requested is more than one 142 * greater than the number of existing repetitions. 143 */ 144 public OBX getOBX(int rep) { 145 OBX retVal = getTyped("OBX", rep, OBX.class); 146 return retVal; 147 } 148 149 /** 150 * Returns the number of existing repetitions of OBX 151 */ 152 public int getOBXReps() { 153 return getReps("OBX"); 154 } 155 156 /** 157 * <p> 158 * Returns a non-modifiable List containing all current existing repetitions of OBX. 159 * <p> 160 * <p> 161 * Note that unlike {@link #getOBX()}, this method will not create any reps 162 * if none are already present, so an empty list may be returned. 163 * </p> 164 */ 165 public java.util.List<OBX> getOBXAll() throws HL7Exception { 166 return getAllAsList("OBX", OBX.class); 167 } 168 169 /** 170 * Inserts a specific repetition of OBX (OBSERVATION RESULT) 171 * @see AbstractGroup#insertRepetition(Structure, int) 172 */ 173 public void insertOBX(OBX structure, int rep) throws HL7Exception { 174 super.insertRepetition("OBX", structure, rep); 175 } 176 177 178 /** 179 * Inserts a specific repetition of OBX (OBSERVATION RESULT) 180 * @see AbstractGroup#insertRepetition(Structure, int) 181 */ 182 public OBX insertOBX(int rep) throws HL7Exception { 183 return (OBX)super.insertRepetition("OBX", rep); 184 } 185 186 187 /** 188 * Removes a specific repetition of OBX (OBSERVATION RESULT) 189 * @see AbstractGroup#removeRepetition(String, int) 190 */ 191 public OBX removeOBX(int rep) throws HL7Exception { 192 return (OBX)super.removeRepetition("OBX", rep); 193 } 194 195 196 197 /** 198 * Returns 199 * the first repetition of 200 * AL1 (PATIENT ALLERGY INFORMATION) - creates it if necessary 201 */ 202 public AL1 getAL1() { 203 AL1 retVal = getTyped("AL1", AL1.class); 204 return retVal; 205 } 206 207 208 /** 209 * Returns a specific repetition of 210 * AL1 (PATIENT ALLERGY INFORMATION) - creates it if necessary 211 * 212 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 213 * @throws HL7Exception if the repetition requested is more than one 214 * greater than the number of existing repetitions. 215 */ 216 public AL1 getAL1(int rep) { 217 AL1 retVal = getTyped("AL1", rep, AL1.class); 218 return retVal; 219 } 220 221 /** 222 * Returns the number of existing repetitions of AL1 223 */ 224 public int getAL1Reps() { 225 return getReps("AL1"); 226 } 227 228 /** 229 * <p> 230 * Returns a non-modifiable List containing all current existing repetitions of AL1. 231 * <p> 232 * <p> 233 * Note that unlike {@link #getAL1()}, this method will not create any reps 234 * if none are already present, so an empty list may be returned. 235 * </p> 236 */ 237 public java.util.List<AL1> getAL1All() throws HL7Exception { 238 return getAllAsList("AL1", AL1.class); 239 } 240 241 /** 242 * Inserts a specific repetition of AL1 (PATIENT ALLERGY INFORMATION) 243 * @see AbstractGroup#insertRepetition(Structure, int) 244 */ 245 public void insertAL1(AL1 structure, int rep) throws HL7Exception { 246 super.insertRepetition("AL1", structure, rep); 247 } 248 249 250 /** 251 * Inserts a specific repetition of AL1 (PATIENT ALLERGY INFORMATION) 252 * @see AbstractGroup#insertRepetition(Structure, int) 253 */ 254 public AL1 insertAL1(int rep) throws HL7Exception { 255 return (AL1)super.insertRepetition("AL1", rep); 256 } 257 258 259 /** 260 * Removes a specific repetition of AL1 (PATIENT ALLERGY INFORMATION) 261 * @see AbstractGroup#removeRepetition(String, int) 262 */ 263 public AL1 removeAL1(int rep) throws HL7Exception { 264 return (AL1)super.removeRepetition("AL1", rep); 265 } 266 267 268 269 /** 270 * Returns 271 * the first repetition of 272 * DG1 (DIAGNOSIS) - creates it if necessary 273 */ 274 public DG1 getDG1() { 275 DG1 retVal = getTyped("DG1", DG1.class); 276 return retVal; 277 } 278 279 280 /** 281 * Returns a specific repetition of 282 * DG1 (DIAGNOSIS) - creates it if necessary 283 * 284 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 285 * @throws HL7Exception if the repetition requested is more than one 286 * greater than the number of existing repetitions. 287 */ 288 public DG1 getDG1(int rep) { 289 DG1 retVal = getTyped("DG1", rep, DG1.class); 290 return retVal; 291 } 292 293 /** 294 * Returns the number of existing repetitions of DG1 295 */ 296 public int getDG1Reps() { 297 return getReps("DG1"); 298 } 299 300 /** 301 * <p> 302 * Returns a non-modifiable List containing all current existing repetitions of DG1. 303 * <p> 304 * <p> 305 * Note that unlike {@link #getDG1()}, this method will not create any reps 306 * if none are already present, so an empty list may be returned. 307 * </p> 308 */ 309 public java.util.List<DG1> getDG1All() throws HL7Exception { 310 return getAllAsList("DG1", DG1.class); 311 } 312 313 /** 314 * Inserts a specific repetition of DG1 (DIAGNOSIS) 315 * @see AbstractGroup#insertRepetition(Structure, int) 316 */ 317 public void insertDG1(DG1 structure, int rep) throws HL7Exception { 318 super.insertRepetition("DG1", structure, rep); 319 } 320 321 322 /** 323 * Inserts a specific repetition of DG1 (DIAGNOSIS) 324 * @see AbstractGroup#insertRepetition(Structure, int) 325 */ 326 public DG1 insertDG1(int rep) throws HL7Exception { 327 return (DG1)super.insertRepetition("DG1", rep); 328 } 329 330 331 /** 332 * Removes a specific repetition of DG1 (DIAGNOSIS) 333 * @see AbstractGroup#removeRepetition(String, int) 334 */ 335 public DG1 removeDG1(int rep) throws HL7Exception { 336 return (DG1)super.removeRepetition("DG1", rep); 337 } 338 339 340 341 /** 342 * Returns 343 * the first repetition of 344 * PR1 (PROCEDURES) - creates it if necessary 345 */ 346 public PR1 getPR1() { 347 PR1 retVal = getTyped("PR1", PR1.class); 348 return retVal; 349 } 350 351 352 /** 353 * Returns a specific repetition of 354 * PR1 (PROCEDURES) - creates it if necessary 355 * 356 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 357 * @throws HL7Exception if the repetition requested is more than one 358 * greater than the number of existing repetitions. 359 */ 360 public PR1 getPR1(int rep) { 361 PR1 retVal = getTyped("PR1", rep, PR1.class); 362 return retVal; 363 } 364 365 /** 366 * Returns the number of existing repetitions of PR1 367 */ 368 public int getPR1Reps() { 369 return getReps("PR1"); 370 } 371 372 /** 373 * <p> 374 * Returns a non-modifiable List containing all current existing repetitions of PR1. 375 * <p> 376 * <p> 377 * Note that unlike {@link #getPR1()}, this method will not create any reps 378 * if none are already present, so an empty list may be returned. 379 * </p> 380 */ 381 public java.util.List<PR1> getPR1All() throws HL7Exception { 382 return getAllAsList("PR1", PR1.class); 383 } 384 385 /** 386 * Inserts a specific repetition of PR1 (PROCEDURES) 387 * @see AbstractGroup#insertRepetition(Structure, int) 388 */ 389 public void insertPR1(PR1 structure, int rep) throws HL7Exception { 390 super.insertRepetition("PR1", structure, rep); 391 } 392 393 394 /** 395 * Inserts a specific repetition of PR1 (PROCEDURES) 396 * @see AbstractGroup#insertRepetition(Structure, int) 397 */ 398 public PR1 insertPR1(int rep) throws HL7Exception { 399 return (PR1)super.insertRepetition("PR1", rep); 400 } 401 402 403 /** 404 * Removes a specific repetition of PR1 (PROCEDURES) 405 * @see AbstractGroup#removeRepetition(String, int) 406 */ 407 public PR1 removePR1(int rep) throws HL7Exception { 408 return (PR1)super.removeRepetition("PR1", rep); 409 } 410 411 412 413 /** 414 * Returns 415 * the first repetition of 416 * GT1 (GUARANTOR) - creates it if necessary 417 */ 418 public GT1 getGT1() { 419 GT1 retVal = getTyped("GT1", GT1.class); 420 return retVal; 421 } 422 423 424 /** 425 * Returns a specific repetition of 426 * GT1 (GUARANTOR) - creates it if necessary 427 * 428 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 429 * @throws HL7Exception if the repetition requested is more than one 430 * greater than the number of existing repetitions. 431 */ 432 public GT1 getGT1(int rep) { 433 GT1 retVal = getTyped("GT1", rep, GT1.class); 434 return retVal; 435 } 436 437 /** 438 * Returns the number of existing repetitions of GT1 439 */ 440 public int getGT1Reps() { 441 return getReps("GT1"); 442 } 443 444 /** 445 * <p> 446 * Returns a non-modifiable List containing all current existing repetitions of GT1. 447 * <p> 448 * <p> 449 * Note that unlike {@link #getGT1()}, this method will not create any reps 450 * if none are already present, so an empty list may be returned. 451 * </p> 452 */ 453 public java.util.List<GT1> getGT1All() throws HL7Exception { 454 return getAllAsList("GT1", GT1.class); 455 } 456 457 /** 458 * Inserts a specific repetition of GT1 (GUARANTOR) 459 * @see AbstractGroup#insertRepetition(Structure, int) 460 */ 461 public void insertGT1(GT1 structure, int rep) throws HL7Exception { 462 super.insertRepetition("GT1", structure, rep); 463 } 464 465 466 /** 467 * Inserts a specific repetition of GT1 (GUARANTOR) 468 * @see AbstractGroup#insertRepetition(Structure, int) 469 */ 470 public GT1 insertGT1(int rep) throws HL7Exception { 471 return (GT1)super.insertRepetition("GT1", rep); 472 } 473 474 475 /** 476 * Removes a specific repetition of GT1 (GUARANTOR) 477 * @see AbstractGroup#removeRepetition(String, int) 478 */ 479 public GT1 removeGT1(int rep) throws HL7Exception { 480 return (GT1)super.removeRepetition("GT1", rep); 481 } 482 483 484 485 /** 486 * Returns 487 * the first repetition of 488 * NK1 (NEXT OF KIN) - creates it if necessary 489 */ 490 public NK1 getNK1() { 491 NK1 retVal = getTyped("NK1", NK1.class); 492 return retVal; 493 } 494 495 496 /** 497 * Returns a specific repetition of 498 * NK1 (NEXT OF KIN) - creates it if necessary 499 * 500 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 501 * @throws HL7Exception if the repetition requested is more than one 502 * greater than the number of existing repetitions. 503 */ 504 public NK1 getNK1(int rep) { 505 NK1 retVal = getTyped("NK1", rep, NK1.class); 506 return retVal; 507 } 508 509 /** 510 * Returns the number of existing repetitions of NK1 511 */ 512 public int getNK1Reps() { 513 return getReps("NK1"); 514 } 515 516 /** 517 * <p> 518 * Returns a non-modifiable List containing all current existing repetitions of NK1. 519 * <p> 520 * <p> 521 * Note that unlike {@link #getNK1()}, this method will not create any reps 522 * if none are already present, so an empty list may be returned. 523 * </p> 524 */ 525 public java.util.List<NK1> getNK1All() throws HL7Exception { 526 return getAllAsList("NK1", NK1.class); 527 } 528 529 /** 530 * Inserts a specific repetition of NK1 (NEXT OF KIN) 531 * @see AbstractGroup#insertRepetition(Structure, int) 532 */ 533 public void insertNK1(NK1 structure, int rep) throws HL7Exception { 534 super.insertRepetition("NK1", structure, rep); 535 } 536 537 538 /** 539 * Inserts a specific repetition of NK1 (NEXT OF KIN) 540 * @see AbstractGroup#insertRepetition(Structure, int) 541 */ 542 public NK1 insertNK1(int rep) throws HL7Exception { 543 return (NK1)super.insertRepetition("NK1", rep); 544 } 545 546 547 /** 548 * Removes a specific repetition of NK1 (NEXT OF KIN) 549 * @see AbstractGroup#removeRepetition(String, int) 550 */ 551 public NK1 removeNK1(int rep) throws HL7Exception { 552 return (NK1)super.removeRepetition("NK1", rep); 553 } 554 555 556 557 /** 558 * Returns 559 * the first repetition of 560 * INSURANCE (a Group object) - creates it if necessary 561 */ 562 public BAR_P01_INSURANCE getINSURANCE() { 563 BAR_P01_INSURANCE retVal = getTyped("INSURANCE", BAR_P01_INSURANCE.class); 564 return retVal; 565 } 566 567 568 /** 569 * Returns a specific repetition of 570 * INSURANCE (a Group object) - creates it if necessary 571 * 572 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 573 * @throws HL7Exception if the repetition requested is more than one 574 * greater than the number of existing repetitions. 575 */ 576 public BAR_P01_INSURANCE getINSURANCE(int rep) { 577 BAR_P01_INSURANCE retVal = getTyped("INSURANCE", rep, BAR_P01_INSURANCE.class); 578 return retVal; 579 } 580 581 /** 582 * Returns the number of existing repetitions of INSURANCE 583 */ 584 public int getINSURANCEReps() { 585 return getReps("INSURANCE"); 586 } 587 588 /** 589 * <p> 590 * Returns a non-modifiable List containing all current existing repetitions of INSURANCE. 591 * <p> 592 * <p> 593 * Note that unlike {@link #getINSURANCE()}, this method will not create any reps 594 * if none are already present, so an empty list may be returned. 595 * </p> 596 */ 597 public java.util.List<BAR_P01_INSURANCE> getINSURANCEAll() throws HL7Exception { 598 return getAllAsList("INSURANCE", BAR_P01_INSURANCE.class); 599 } 600 601 /** 602 * Inserts a specific repetition of INSURANCE (a Group object) 603 * @see AbstractGroup#insertRepetition(Structure, int) 604 */ 605 public void insertINSURANCE(BAR_P01_INSURANCE structure, int rep) throws HL7Exception { 606 super.insertRepetition("INSURANCE", structure, rep); 607 } 608 609 610 /** 611 * Inserts a specific repetition of INSURANCE (a Group object) 612 * @see AbstractGroup#insertRepetition(Structure, int) 613 */ 614 public BAR_P01_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 615 return (BAR_P01_INSURANCE)super.insertRepetition("INSURANCE", rep); 616 } 617 618 619 /** 620 * Removes a specific repetition of INSURANCE (a Group object) 621 * @see AbstractGroup#removeRepetition(String, int) 622 */ 623 public BAR_P01_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 624 return (BAR_P01_INSURANCE)super.removeRepetition("INSURANCE", rep); 625 } 626 627 628 629 /** 630 * Returns 631 * ACC (ACCIDENT) - creates it if necessary 632 */ 633 public ACC getACC() { 634 ACC retVal = getTyped("ACC", ACC.class); 635 return retVal; 636 } 637 638 639 640 641 /** 642 * Returns 643 * UB1 (UB82 DATA) - creates it if necessary 644 */ 645 public UB1 getUB1() { 646 UB1 retVal = getTyped("UB1", UB1.class); 647 return retVal; 648 } 649 650 651 652 653 /** 654 * Returns 655 * UB2 (UB92 DATA) - creates it if necessary 656 */ 657 public UB2 getUB2() { 658 UB2 retVal = getTyped("UB2", UB2.class); 659 return retVal; 660 } 661 662 663 664 665} 666