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