1 /* 2 * This class is an auto-generated source file for a HAPI 3 * HL7 v2.x standard structure class. 4 * 5 * For more information, visit: http://hl7api.sourceforge.net/ 6 * 7 * The contents of this file are subject to the Mozilla Public License Version 1.1 8 * (the "License"); you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 10 * Software distributed under the License is distributed on an "AS IS" basis, 11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 12 * specific language governing rights and limitations under the License. 13 * 14 * The Original Code is "[file_name]". Description: 15 * "[one_line_description]" 16 * 17 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 18 * 2012. All Rights Reserved. 19 * 20 * Contributor(s): ______________________________________. 21 * 22 * Alternatively, the contents of this file may be used under the terms of the 23 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are 24 * applicable instead of those above. If you wish to allow use of your version of this 25 * file only under the terms of the GPL and not to allow others to use your version 26 * of this file under the MPL, indicate your decision by deleting the provisions above 27 * and replace them with the notice and other provisions required by the GPL License. 28 * If you do not delete the provisions above, a recipient may use your version of 29 * this file under either the MPL or the GPL. 30 * 31 */ 32 33 34 package ca.uhn.hl7v2.model.v27.group; 35 36 import ca.uhn.hl7v2.model.v27.segment.*; 37 38 import ca.uhn.hl7v2.HL7Exception; 39 import ca.uhn.hl7v2.parser.ModelClassFactory; 40 import ca.uhn.hl7v2.model.*; 41 42 /** 43 * <p>Represents a RSP_K31_ORDER group structure (a Group object). 44 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together. 45 * This Group contains the following elements: 46 * </p> 47 * <ul> 48 * <li>1: ORC (Common Order) <b> </b></li> 49 * <li>2: RSP_K31_TIMING (a Group object) <b>optional repeating </b></li> 50 * <li>3: RSP_K31_ORDER_DETAIL (a Group object) <b>optional </b></li> 51 * <li>4: RSP_K31_ENCODING (a Group object) <b>optional </b></li> 52 * <li>5: RXD (Pharmacy/Treatment Dispense) <b> </b></li> 53 * <li>6: PRT (Participation Information) <b>optional repeating </b></li> 54 * <li>7: RXR (Pharmacy/Treatment Route) <b> repeating </b></li> 55 * <li>8: RXC (Pharmacy/Treatment Component Order) <b>optional repeating </b></li> 56 * <li>9: RSP_K31_OBSERVATION (a Group object) <b>optional repeating </b></li> 57 * </ul> 58 */ 59 //@SuppressWarnings("unused") 60 public class RSP_K31_ORDER extends AbstractGroup { 61 62 /** 63 * Creates a new RSP_K31_ORDER group 64 */ 65 public RSP_K31_ORDER(Group parent, ModelClassFactory factory) { 66 super(parent, factory); 67 init(factory); 68 } 69 70 private void init(ModelClassFactory factory) { 71 try { 72 this.add(ORC.class, true, false, false); 73 this.add(RSP_K31_TIMING.class, false, true, false); 74 this.add(RSP_K31_ORDER_DETAIL.class, false, false, false); 75 this.add(RSP_K31_ENCODING.class, false, false, false); 76 this.add(RXD.class, true, false, false); 77 this.add(PRT.class, false, true, false); 78 this.add(RXR.class, true, true, false); 79 this.add(RXC.class, false, true, false); 80 this.add(RSP_K31_OBSERVATION.class, false, true, false); 81 } catch(HL7Exception e) { 82 log.error("Unexpected error creating RSP_K31_ORDER - this is probably a bug in the source code generator.", e); 83 } 84 } 85 86 /** 87 * Returns "2.7" 88 */ 89 public String getVersion() { 90 return "2.7"; 91 } 92 93 94 95 /** 96 * Returns 97 * ORC (Common Order) - creates it if necessary 98 */ 99 public ORC getORC() { 100 ORC retVal = getTyped("ORC", ORC.class); 101 return retVal; 102 } 103 104 105 106 107 /** 108 * Returns 109 * the first repetition of 110 * TIMING (a Group object) - creates it if necessary 111 */ 112 public RSP_K31_TIMING getTIMING() { 113 RSP_K31_TIMING retVal = getTyped("TIMING", RSP_K31_TIMING.class); 114 return retVal; 115 } 116 117 118 /** 119 * Returns a specific repetition of 120 * TIMING (a Group object) - creates it if necessary 121 * 122 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 123 * @throws HL7Exception if the repetition requested is more than one 124 * greater than the number of existing repetitions. 125 */ 126 public RSP_K31_TIMING getTIMING(int rep) { 127 RSP_K31_TIMING retVal = getTyped("TIMING", rep, RSP_K31_TIMING.class); 128 return retVal; 129 } 130 131 /** 132 * Returns the number of existing repetitions of TIMING 133 */ 134 public int getTIMINGReps() { 135 return getReps("TIMING"); 136 } 137 138 /** 139 * <p> 140 * Returns a non-modifiable List containing all current existing repetitions of TIMING. 141 * <p> 142 * <p> 143 * Note that unlike {@link #getTIMING()}, this method will not create any reps 144 * if none are already present, so an empty list may be returned. 145 * </p> 146 */ 147 public java.util.List<RSP_K31_TIMING> getTIMINGAll() throws HL7Exception { 148 return getAllAsList("TIMING", RSP_K31_TIMING.class); 149 } 150 151 /** 152 * Inserts a specific repetition of TIMING (a Group object) 153 * @see AbstractGroup#insertRepetition(Structure, int) 154 */ 155 public void insertTIMING(RSP_K31_TIMING structure, int rep) throws HL7Exception { 156 super.insertRepetition("TIMING", structure, rep); 157 } 158 159 160 /** 161 * Inserts a specific repetition of TIMING (a Group object) 162 * @see AbstractGroup#insertRepetition(Structure, int) 163 */ 164 public RSP_K31_TIMING insertTIMING(int rep) throws HL7Exception { 165 return (RSP_K31_TIMING)super.insertRepetition("TIMING", rep); 166 } 167 168 169 /** 170 * Removes a specific repetition of TIMING (a Group object) 171 * @see AbstractGroup#removeRepetition(String, int) 172 */ 173 public RSP_K31_TIMING removeTIMING(int rep) throws HL7Exception { 174 return (RSP_K31_TIMING)super.removeRepetition("TIMING", rep); 175 } 176 177 178 179 /** 180 * Returns 181 * ORDER_DETAIL (a Group object) - creates it if necessary 182 */ 183 public RSP_K31_ORDER_DETAIL getORDER_DETAIL() { 184 RSP_K31_ORDER_DETAIL retVal = getTyped("ORDER_DETAIL", RSP_K31_ORDER_DETAIL.class); 185 return retVal; 186 } 187 188 189 190 191 /** 192 * Returns 193 * ENCODING (a Group object) - creates it if necessary 194 */ 195 public RSP_K31_ENCODING getENCODING() { 196 RSP_K31_ENCODING retVal = getTyped("ENCODING", RSP_K31_ENCODING.class); 197 return retVal; 198 } 199 200 201 202 203 /** 204 * Returns 205 * RXD (Pharmacy/Treatment Dispense) - creates it if necessary 206 */ 207 public RXD getRXD() { 208 RXD retVal = getTyped("RXD", RXD.class); 209 return retVal; 210 } 211 212 213 214 215 /** 216 * Returns 217 * the first repetition of 218 * PRT (Participation Information) - creates it if necessary 219 */ 220 public PRT getPRT() { 221 PRT retVal = getTyped("PRT", PRT.class); 222 return retVal; 223 } 224 225 226 /** 227 * Returns a specific repetition of 228 * PRT (Participation Information) - creates it if necessary 229 * 230 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 231 * @throws HL7Exception if the repetition requested is more than one 232 * greater than the number of existing repetitions. 233 */ 234 public PRT getPRT(int rep) { 235 PRT retVal = getTyped("PRT", rep, PRT.class); 236 return retVal; 237 } 238 239 /** 240 * Returns the number of existing repetitions of PRT 241 */ 242 public int getPRTReps() { 243 return getReps("PRT"); 244 } 245 246 /** 247 * <p> 248 * Returns a non-modifiable List containing all current existing repetitions of PRT. 249 * <p> 250 * <p> 251 * Note that unlike {@link #getPRT()}, this method will not create any reps 252 * if none are already present, so an empty list may be returned. 253 * </p> 254 */ 255 public java.util.List<PRT> getPRTAll() throws HL7Exception { 256 return getAllAsList("PRT", PRT.class); 257 } 258 259 /** 260 * Inserts a specific repetition of PRT (Participation Information) 261 * @see AbstractGroup#insertRepetition(Structure, int) 262 */ 263 public void insertPRT(PRT structure, int rep) throws HL7Exception { 264 super.insertRepetition("PRT", structure, rep); 265 } 266 267 268 /** 269 * Inserts a specific repetition of PRT (Participation Information) 270 * @see AbstractGroup#insertRepetition(Structure, int) 271 */ 272 public PRT insertPRT(int rep) throws HL7Exception { 273 return (PRT)super.insertRepetition("PRT", rep); 274 } 275 276 277 /** 278 * Removes a specific repetition of PRT (Participation Information) 279 * @see AbstractGroup#removeRepetition(String, int) 280 */ 281 public PRT removePRT(int rep) throws HL7Exception { 282 return (PRT)super.removeRepetition("PRT", rep); 283 } 284 285 286 287 /** 288 * Returns 289 * the first repetition of 290 * RXR (Pharmacy/Treatment Route) - creates it if necessary 291 */ 292 public RXR getRXR() { 293 RXR retVal = getTyped("RXR", RXR.class); 294 return retVal; 295 } 296 297 298 /** 299 * Returns a specific repetition of 300 * RXR (Pharmacy/Treatment Route) - creates it if necessary 301 * 302 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 303 * @throws HL7Exception if the repetition requested is more than one 304 * greater than the number of existing repetitions. 305 */ 306 public RXR getRXR(int rep) { 307 RXR retVal = getTyped("RXR", rep, RXR.class); 308 return retVal; 309 } 310 311 /** 312 * Returns the number of existing repetitions of RXR 313 */ 314 public int getRXRReps() { 315 return getReps("RXR"); 316 } 317 318 /** 319 * <p> 320 * Returns a non-modifiable List containing all current existing repetitions of RXR. 321 * <p> 322 * <p> 323 * Note that unlike {@link #getRXR()}, this method will not create any reps 324 * if none are already present, so an empty list may be returned. 325 * </p> 326 */ 327 public java.util.List<RXR> getRXRAll() throws HL7Exception { 328 return getAllAsList("RXR", RXR.class); 329 } 330 331 /** 332 * Inserts a specific repetition of RXR (Pharmacy/Treatment Route) 333 * @see AbstractGroup#insertRepetition(Structure, int) 334 */ 335 public void insertRXR(RXR structure, int rep) throws HL7Exception { 336 super.insertRepetition("RXR", structure, rep); 337 } 338 339 340 /** 341 * Inserts a specific repetition of RXR (Pharmacy/Treatment Route) 342 * @see AbstractGroup#insertRepetition(Structure, int) 343 */ 344 public RXR insertRXR(int rep) throws HL7Exception { 345 return (RXR)super.insertRepetition("RXR", rep); 346 } 347 348 349 /** 350 * Removes a specific repetition of RXR (Pharmacy/Treatment Route) 351 * @see AbstractGroup#removeRepetition(String, int) 352 */ 353 public RXR removeRXR(int rep) throws HL7Exception { 354 return (RXR)super.removeRepetition("RXR", rep); 355 } 356 357 358 359 /** 360 * Returns 361 * the first repetition of 362 * RXC (Pharmacy/Treatment Component Order) - creates it if necessary 363 */ 364 public RXC getRXC() { 365 RXC retVal = getTyped("RXC", RXC.class); 366 return retVal; 367 } 368 369 370 /** 371 * Returns a specific repetition of 372 * RXC (Pharmacy/Treatment Component Order) - creates it if necessary 373 * 374 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 375 * @throws HL7Exception if the repetition requested is more than one 376 * greater than the number of existing repetitions. 377 */ 378 public RXC getRXC(int rep) { 379 RXC retVal = getTyped("RXC", rep, RXC.class); 380 return retVal; 381 } 382 383 /** 384 * Returns the number of existing repetitions of RXC 385 */ 386 public int getRXCReps() { 387 return getReps("RXC"); 388 } 389 390 /** 391 * <p> 392 * Returns a non-modifiable List containing all current existing repetitions of RXC. 393 * <p> 394 * <p> 395 * Note that unlike {@link #getRXC()}, this method will not create any reps 396 * if none are already present, so an empty list may be returned. 397 * </p> 398 */ 399 public java.util.List<RXC> getRXCAll() throws HL7Exception { 400 return getAllAsList("RXC", RXC.class); 401 } 402 403 /** 404 * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order) 405 * @see AbstractGroup#insertRepetition(Structure, int) 406 */ 407 public void insertRXC(RXC structure, int rep) throws HL7Exception { 408 super.insertRepetition("RXC", structure, rep); 409 } 410 411 412 /** 413 * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order) 414 * @see AbstractGroup#insertRepetition(Structure, int) 415 */ 416 public RXC insertRXC(int rep) throws HL7Exception { 417 return (RXC)super.insertRepetition("RXC", rep); 418 } 419 420 421 /** 422 * Removes a specific repetition of RXC (Pharmacy/Treatment Component Order) 423 * @see AbstractGroup#removeRepetition(String, int) 424 */ 425 public RXC removeRXC(int rep) throws HL7Exception { 426 return (RXC)super.removeRepetition("RXC", rep); 427 } 428 429 430 431 /** 432 * Returns 433 * the first repetition of 434 * OBSERVATION (a Group object) - creates it if necessary 435 */ 436 public RSP_K31_OBSERVATION getOBSERVATION() { 437 RSP_K31_OBSERVATION retVal = getTyped("OBSERVATION", RSP_K31_OBSERVATION.class); 438 return retVal; 439 } 440 441 442 /** 443 * Returns a specific repetition of 444 * OBSERVATION (a Group object) - creates it if necessary 445 * 446 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 447 * @throws HL7Exception if the repetition requested is more than one 448 * greater than the number of existing repetitions. 449 */ 450 public RSP_K31_OBSERVATION getOBSERVATION(int rep) { 451 RSP_K31_OBSERVATION retVal = getTyped("OBSERVATION", rep, RSP_K31_OBSERVATION.class); 452 return retVal; 453 } 454 455 /** 456 * Returns the number of existing repetitions of OBSERVATION 457 */ 458 public int getOBSERVATIONReps() { 459 return getReps("OBSERVATION"); 460 } 461 462 /** 463 * <p> 464 * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION. 465 * <p> 466 * <p> 467 * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps 468 * if none are already present, so an empty list may be returned. 469 * </p> 470 */ 471 public java.util.List<RSP_K31_OBSERVATION> getOBSERVATIONAll() throws HL7Exception { 472 return getAllAsList("OBSERVATION", RSP_K31_OBSERVATION.class); 473 } 474 475 /** 476 * Inserts a specific repetition of OBSERVATION (a Group object) 477 * @see AbstractGroup#insertRepetition(Structure, int) 478 */ 479 public void insertOBSERVATION(RSP_K31_OBSERVATION structure, int rep) throws HL7Exception { 480 super.insertRepetition("OBSERVATION", structure, rep); 481 } 482 483 484 /** 485 * Inserts a specific repetition of OBSERVATION (a Group object) 486 * @see AbstractGroup#insertRepetition(Structure, int) 487 */ 488 public RSP_K31_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 489 return (RSP_K31_OBSERVATION)super.insertRepetition("OBSERVATION", rep); 490 } 491 492 493 /** 494 * Removes a specific repetition of OBSERVATION (a Group object) 495 * @see AbstractGroup#removeRepetition(String, int) 496 */ 497 public RSP_K31_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 498 return (RSP_K31_OBSERVATION)super.removeRepetition("OBSERVATION", rep); 499 } 500 501 502 503 } 504