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