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 RDR_RDR message structure (see chapter 4.13.17). This structure contains the 048 * following elements: </p> 049 * <ul> 050 * <li>1: MSH (Message Header) <b> </b></li> 051 * <li>2: MSA (Message Acknowledgment) <b> </b></li> 052 * <li>3: ERR (Error) <b>optional repeating</b></li> 053 * <li>4: SFT (Software Segment) <b>optional repeating</b></li> 054 * <li>5: SFT (Software Segment) <b>optional </b></li> 055 * <li>6: UAC (User Authentication Credential Segment) <b>optional </b></li> 056 * <li>7: RDR_RDR_DEFINITION (a Group object) <b> repeating</b></li> 057 * <li>8: RXC (Pharmacy/Treatment Component Order) <b>optional repeating</b></li> 058 * <li>9: DSC (Continuation Pointer) <b>optional </b></li> 059 * <li>10: RXD (Pharmacy/Treatment Dispense) <b> </b></li> 060 * <li>11: RXR (Pharmacy/Treatment Route) <b> repeating</b></li> 061 * <li>12: RXC (Pharmacy/Treatment Component Order) <b>optional repeating</b></li> 062 * <li>13: DSC (Continuation Pointer) <b>optional </b></li> 063 * </ul> 064 */ 065@SuppressWarnings("unused") 066public class RDR_RDR extends AbstractMessage { 067 068 /** 069 * Creates a new RDR_RDR message with DefaultModelClassFactory. 070 */ 071 public RDR_RDR() { 072 this(new DefaultModelClassFactory()); 073 } 074 075 /** 076 * Creates a new RDR_RDR message with custom ModelClassFactory. 077 */ 078 public RDR_RDR(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(MSA.class, true, false); 087 this.add(ERR.class, false, true); 088 this.add(SFT.class, false, true); 089 this.add(SFT.class, false, false); 090 this.add(UAC.class, false, false); 091 this.add(RDR_RDR_DEFINITION.class, true, true); 092 this.add(RXC.class, false, true); 093 this.add(DSC.class, false, false); 094 this.add(RXD.class, true, false); 095 this.add(RXR.class, true, true); 096 this.add(RXC.class, false, true); 097 this.add(DSC.class, false, false); 098 } catch(HL7Exception e) { 099 log.error("Unexpected error creating RDR_RDR - this is probably a bug in the source code generator.", e); 100 } 101 } 102 103 /** 104 * Returns "2.6" 105 */ 106 public String getVersion() { 107 return "2.6"; 108 } 109 110 111 112 /** 113 * Returns 114 * MSH (Message Header) - creates it if necessary 115 */ 116 public MSH getMSH() { 117 return getTyped("MSH", MSH.class); 118 } 119 120 121 122 123 /** 124 * Returns 125 * MSA (Message Acknowledgment) - creates it if necessary 126 */ 127 public MSA getMSA() { 128 return getTyped("MSA", MSA.class); 129 } 130 131 132 133 134 /** 135 * Returns 136 * the first repetition of 137 * ERR (Error) - creates it if necessary 138 */ 139 public ERR getERR() { 140 return getTyped("ERR", ERR.class); 141 } 142 143 144 /** 145 * Returns a specific repetition of 146 * ERR (Error) - creates it if necessary 147 * 148 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 149 * @throws HL7Exception if the repetition requested is more than one 150 * greater than the number of existing repetitions. 151 */ 152 public ERR getERR(int rep) { 153 return getTyped("ERR", rep, ERR.class); 154 } 155 156 /** 157 * Returns the number of existing repetitions of ERR 158 */ 159 public int getERRReps() { 160 return getReps("ERR"); 161 } 162 163 /** 164 * <p> 165 * Returns a non-modifiable List containing all current existing repetitions of ERR. 166 * <p> 167 * <p> 168 * Note that unlike {@link #getERR()}, this method will not create any reps 169 * if none are already present, so an empty list may be returned. 170 * </p> 171 */ 172 public List<ERR> getERRAll() throws HL7Exception { 173 return getAllAsList("ERR", ERR.class); 174 } 175 176 /** 177 * Inserts a specific repetition of ERR (Error) 178 * @see AbstractGroup#insertRepetition(Structure, int) 179 */ 180 public void insertERR(ERR structure, int rep) throws HL7Exception { 181 super.insertRepetition( "ERR", structure, rep); 182 } 183 184 185 /** 186 * Inserts a specific repetition of ERR (Error) 187 * @see AbstractGroup#insertRepetition(Structure, int) 188 */ 189 public ERR insertERR(int rep) throws HL7Exception { 190 return (ERR)super.insertRepetition("ERR", rep); 191 } 192 193 194 /** 195 * Removes a specific repetition of ERR (Error) 196 * @see AbstractGroup#removeRepetition(String, int) 197 */ 198 public ERR removeERR(int rep) throws HL7Exception { 199 return (ERR)super.removeRepetition("ERR", rep); 200 } 201 202 203 204 /** 205 * Returns 206 * the first repetition of 207 * SFT (Software Segment) - creates it if necessary 208 */ 209 public SFT getSFT() { 210 return getTyped("SFT", SFT.class); 211 } 212 213 214 /** 215 * Returns a specific repetition of 216 * SFT (Software Segment) - creates it if necessary 217 * 218 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 219 * @throws HL7Exception if the repetition requested is more than one 220 * greater than the number of existing repetitions. 221 */ 222 public SFT getSFT(int rep) { 223 return getTyped("SFT", rep, SFT.class); 224 } 225 226 /** 227 * Returns the number of existing repetitions of SFT 228 */ 229 public int getSFTReps() { 230 return getReps("SFT"); 231 } 232 233 /** 234 * <p> 235 * Returns a non-modifiable List containing all current existing repetitions of SFT. 236 * <p> 237 * <p> 238 * Note that unlike {@link #getSFT()}, this method will not create any reps 239 * if none are already present, so an empty list may be returned. 240 * </p> 241 */ 242 public List<SFT> getSFTAll() throws HL7Exception { 243 return getAllAsList("SFT", SFT.class); 244 } 245 246 /** 247 * Inserts a specific repetition of SFT (Software Segment) 248 * @see AbstractGroup#insertRepetition(Structure, int) 249 */ 250 public void insertSFT(SFT structure, int rep) throws HL7Exception { 251 super.insertRepetition( "SFT", structure, rep); 252 } 253 254 255 /** 256 * Inserts a specific repetition of SFT (Software Segment) 257 * @see AbstractGroup#insertRepetition(Structure, int) 258 */ 259 public SFT insertSFT(int rep) throws HL7Exception { 260 return (SFT)super.insertRepetition("SFT", rep); 261 } 262 263 264 /** 265 * Removes a specific repetition of SFT (Software Segment) 266 * @see AbstractGroup#removeRepetition(String, int) 267 */ 268 public SFT removeSFT(int rep) throws HL7Exception { 269 return (SFT)super.removeRepetition("SFT", rep); 270 } 271 272 273 274 /** 275 * Returns 276 * SFT2 (Software Segment) - creates it if necessary 277 */ 278 public SFT getSFT2() { 279 return getTyped("SFT2", SFT.class); 280 } 281 282 283 284 285 /** 286 * Returns 287 * UAC (User Authentication Credential Segment) - creates it if necessary 288 */ 289 public UAC getUAC() { 290 return getTyped("UAC", UAC.class); 291 } 292 293 294 295 296 /** 297 * Returns 298 * the first repetition of 299 * DEFINITION (a Group object) - creates it if necessary 300 */ 301 public RDR_RDR_DEFINITION getDEFINITION() { 302 return getTyped("DEFINITION", RDR_RDR_DEFINITION.class); 303 } 304 305 306 /** 307 * Returns a specific repetition of 308 * DEFINITION (a Group object) - creates it if necessary 309 * 310 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 311 * @throws HL7Exception if the repetition requested is more than one 312 * greater than the number of existing repetitions. 313 */ 314 public RDR_RDR_DEFINITION getDEFINITION(int rep) { 315 return getTyped("DEFINITION", rep, RDR_RDR_DEFINITION.class); 316 } 317 318 /** 319 * Returns the number of existing repetitions of DEFINITION 320 */ 321 public int getDEFINITIONReps() { 322 return getReps("DEFINITION"); 323 } 324 325 /** 326 * <p> 327 * Returns a non-modifiable List containing all current existing repetitions of DEFINITION. 328 * <p> 329 * <p> 330 * Note that unlike {@link #getDEFINITION()}, this method will not create any reps 331 * if none are already present, so an empty list may be returned. 332 * </p> 333 */ 334 public List<RDR_RDR_DEFINITION> getDEFINITIONAll() throws HL7Exception { 335 return getAllAsList("DEFINITION", RDR_RDR_DEFINITION.class); 336 } 337 338 /** 339 * Inserts a specific repetition of DEFINITION (a Group object) 340 * @see AbstractGroup#insertRepetition(Structure, int) 341 */ 342 public void insertDEFINITION(RDR_RDR_DEFINITION structure, int rep) throws HL7Exception { 343 super.insertRepetition( "DEFINITION", structure, rep); 344 } 345 346 347 /** 348 * Inserts a specific repetition of DEFINITION (a Group object) 349 * @see AbstractGroup#insertRepetition(Structure, int) 350 */ 351 public RDR_RDR_DEFINITION insertDEFINITION(int rep) throws HL7Exception { 352 return (RDR_RDR_DEFINITION)super.insertRepetition("DEFINITION", rep); 353 } 354 355 356 /** 357 * Removes a specific repetition of DEFINITION (a Group object) 358 * @see AbstractGroup#removeRepetition(String, int) 359 */ 360 public RDR_RDR_DEFINITION removeDEFINITION(int rep) throws HL7Exception { 361 return (RDR_RDR_DEFINITION)super.removeRepetition("DEFINITION", rep); 362 } 363 364 365 366 /** 367 * Returns 368 * the first repetition of 369 * RXC (Pharmacy/Treatment Component Order) - creates it if necessary 370 */ 371 public RXC getRXC() { 372 return getTyped("RXC", RXC.class); 373 } 374 375 376 /** 377 * Returns a specific repetition of 378 * RXC (Pharmacy/Treatment Component Order) - creates it if necessary 379 * 380 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 381 * @throws HL7Exception if the repetition requested is more than one 382 * greater than the number of existing repetitions. 383 */ 384 public RXC getRXC(int rep) { 385 return getTyped("RXC", rep, RXC.class); 386 } 387 388 /** 389 * Returns the number of existing repetitions of RXC 390 */ 391 public int getRXCReps() { 392 return getReps("RXC"); 393 } 394 395 /** 396 * <p> 397 * Returns a non-modifiable List containing all current existing repetitions of RXC. 398 * <p> 399 * <p> 400 * Note that unlike {@link #getRXC()}, this method will not create any reps 401 * if none are already present, so an empty list may be returned. 402 * </p> 403 */ 404 public List<RXC> getRXCAll() throws HL7Exception { 405 return getAllAsList("RXC", RXC.class); 406 } 407 408 /** 409 * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order) 410 * @see AbstractGroup#insertRepetition(Structure, int) 411 */ 412 public void insertRXC(RXC structure, int rep) throws HL7Exception { 413 super.insertRepetition( "RXC", structure, rep); 414 } 415 416 417 /** 418 * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order) 419 * @see AbstractGroup#insertRepetition(Structure, int) 420 */ 421 public RXC insertRXC(int rep) throws HL7Exception { 422 return (RXC)super.insertRepetition("RXC", rep); 423 } 424 425 426 /** 427 * Removes a specific repetition of RXC (Pharmacy/Treatment Component Order) 428 * @see AbstractGroup#removeRepetition(String, int) 429 */ 430 public RXC removeRXC(int rep) throws HL7Exception { 431 return (RXC)super.removeRepetition("RXC", rep); 432 } 433 434 435 436 /** 437 * Returns 438 * DSC (Continuation Pointer) - creates it if necessary 439 */ 440 public DSC getDSC() { 441 return getTyped("DSC", DSC.class); 442 } 443 444 445 446 447 /** 448 * Returns 449 * RXD (Pharmacy/Treatment Dispense) - creates it if necessary 450 */ 451 public RXD getRXD() { 452 return getTyped("RXD", RXD.class); 453 } 454 455 456 457 458 /** 459 * Returns 460 * the first repetition of 461 * RXR (Pharmacy/Treatment Route) - creates it if necessary 462 */ 463 public RXR getRXR() { 464 return getTyped("RXR", RXR.class); 465 } 466 467 468 /** 469 * Returns a specific repetition of 470 * RXR (Pharmacy/Treatment Route) - creates it if necessary 471 * 472 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 473 * @throws HL7Exception if the repetition requested is more than one 474 * greater than the number of existing repetitions. 475 */ 476 public RXR getRXR(int rep) { 477 return getTyped("RXR", rep, RXR.class); 478 } 479 480 /** 481 * Returns the number of existing repetitions of RXR 482 */ 483 public int getRXRReps() { 484 return getReps("RXR"); 485 } 486 487 /** 488 * <p> 489 * Returns a non-modifiable List containing all current existing repetitions of RXR. 490 * <p> 491 * <p> 492 * Note that unlike {@link #getRXR()}, this method will not create any reps 493 * if none are already present, so an empty list may be returned. 494 * </p> 495 */ 496 public List<RXR> getRXRAll() throws HL7Exception { 497 return getAllAsList("RXR", RXR.class); 498 } 499 500 /** 501 * Inserts a specific repetition of RXR (Pharmacy/Treatment Route) 502 * @see AbstractGroup#insertRepetition(Structure, int) 503 */ 504 public void insertRXR(RXR structure, int rep) throws HL7Exception { 505 super.insertRepetition( "RXR", structure, rep); 506 } 507 508 509 /** 510 * Inserts a specific repetition of RXR (Pharmacy/Treatment Route) 511 * @see AbstractGroup#insertRepetition(Structure, int) 512 */ 513 public RXR insertRXR(int rep) throws HL7Exception { 514 return (RXR)super.insertRepetition("RXR", rep); 515 } 516 517 518 /** 519 * Removes a specific repetition of RXR (Pharmacy/Treatment Route) 520 * @see AbstractGroup#removeRepetition(String, int) 521 */ 522 public RXR removeRXR(int rep) throws HL7Exception { 523 return (RXR)super.removeRepetition("RXR", rep); 524 } 525 526 527 528 /** 529 * Returns 530 * the first repetition of 531 * RXC2 (Pharmacy/Treatment Component Order) - creates it if necessary 532 */ 533 public RXC getRXC2() { 534 return getTyped("RXC2", RXC.class); 535 } 536 537 538 /** 539 * Returns a specific repetition of 540 * RXC2 (Pharmacy/Treatment Component Order) - creates it if necessary 541 * 542 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 543 * @throws HL7Exception if the repetition requested is more than one 544 * greater than the number of existing repetitions. 545 */ 546 public RXC getRXC2(int rep) { 547 return getTyped("RXC2", rep, RXC.class); 548 } 549 550 /** 551 * Returns the number of existing repetitions of RXC2 552 */ 553 public int getRXC2Reps() { 554 return getReps("RXC2"); 555 } 556 557 /** 558 * <p> 559 * Returns a non-modifiable List containing all current existing repetitions of RXC2. 560 * <p> 561 * <p> 562 * Note that unlike {@link #getRXC2()}, this method will not create any reps 563 * if none are already present, so an empty list may be returned. 564 * </p> 565 */ 566 public List<RXC> getRXC2All() throws HL7Exception { 567 return getAllAsList("RXC2", RXC.class); 568 } 569 570 /** 571 * Inserts a specific repetition of RXC2 (Pharmacy/Treatment Component Order) 572 * @see AbstractGroup#insertRepetition(Structure, int) 573 */ 574 public void insertRXC2(RXC structure, int rep) throws HL7Exception { 575 super.insertRepetition( "RXC2", structure, rep); 576 } 577 578 579 /** 580 * Inserts a specific repetition of RXC2 (Pharmacy/Treatment Component Order) 581 * @see AbstractGroup#insertRepetition(Structure, int) 582 */ 583 public RXC insertRXC2(int rep) throws HL7Exception { 584 return (RXC)super.insertRepetition("RXC2", rep); 585 } 586 587 588 /** 589 * Removes a specific repetition of RXC2 (Pharmacy/Treatment Component Order) 590 * @see AbstractGroup#removeRepetition(String, int) 591 */ 592 public RXC removeRXC2(int rep) throws HL7Exception { 593 return (RXC)super.removeRepetition("RXC2", rep); 594 } 595 596 597 598 /** 599 * Returns 600 * DSC2 (Continuation Pointer) - creates it if necessary 601 */ 602 public DSC getDSC2() { 603 return getTyped("DSC2", DSC.class); 604 } 605 606 607 608 609} 610