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