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.group; 035 036import ca.uhn.hl7v2.model.v26.segment.*; 037 038import java.util.List; 039 040import ca.uhn.hl7v2.HL7Exception; 041import ca.uhn.hl7v2.parser.ModelClassFactory; 042import ca.uhn.hl7v2.model.*; 043 044/** 045 * <p>Represents a OPL_O37_ORDER group structure (a Group object). 046 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together. 047 * This Group contains the following elements: 048 * </p> 049 * <ul> 050 * <li>1: NK1 (Next of Kin / Associated Parties) <b> repeating</b></li> 051 * <li>2: OPL_O37_PATIENT (a Group object) <b>optional </b></li> 052 * <li>3: OPL_O37_SPECIMEN (a Group object) <b> repeating</b></li> 053 * <li>4: OPL_O37_PRIOR_RESULT (a Group object) <b>optional </b></li> 054 * <li>5: FT1 (Financial Transaction) <b>optional repeating</b></li> 055 * <li>6: CTI (Clinical Trial Identification) <b>optional repeating</b></li> 056 * <li>7: BLG (Billing) <b>optional </b></li> 057 * </ul> 058 */ 059@SuppressWarnings("unused") 060public class OPL_O37_ORDER extends AbstractGroup { 061 062 /** 063 * Creates a new OPL_O37_ORDER group 064 */ 065 public OPL_O37_ORDER(Group parent, ModelClassFactory factory) { 066 super(parent, factory); 067 init(factory); 068 } 069 070 private void init(ModelClassFactory factory) { 071 try { 072 this.add(NK1.class, true, true); 073 this.add(OPL_O37_PATIENT.class, false, false); 074 this.add(OPL_O37_SPECIMEN.class, true, true); 075 this.add(OPL_O37_PRIOR_RESULT.class, false, false); 076 this.add(FT1.class, false, true); 077 this.add(CTI.class, false, true); 078 this.add(BLG.class, false, false); 079 } catch(HL7Exception e) { 080 log.error("Unexpected error creating OPL_O37_ORDER - this is probably a bug in the source code generator.", e); 081 } 082 } 083 084 /** 085 * Returns "2.6" 086 */ 087 public String getVersion() { 088 return "2.6"; 089 } 090 091 092 093 /** 094 * Returns 095 * the first repetition of 096 * NK1 (Next of Kin / Associated Parties) - creates it if necessary 097 */ 098 public NK1 getNK1() { 099 NK1 retVal = getTyped("NK1", NK1.class); 100 return retVal; 101 } 102 103 104 /** 105 * Returns a specific repetition of 106 * NK1 (Next of Kin / Associated Parties) - creates it if necessary 107 * 108 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 109 * @throws HL7Exception if the repetition requested is more than one 110 * greater than the number of existing repetitions. 111 */ 112 public NK1 getNK1(int rep) { 113 NK1 retVal = getTyped("NK1", rep, NK1.class); 114 return retVal; 115 } 116 117 /** 118 * Returns the number of existing repetitions of NK1 119 */ 120 public int getNK1Reps() { 121 return getReps("NK1"); 122 } 123 124 /** 125 * <p> 126 * Returns a non-modifiable List containing all current existing repetitions of NK1. 127 * <p> 128 * <p> 129 * Note that unlike {@link #getNK1()}, this method will not create any reps 130 * if none are already present, so an empty list may be returned. 131 * </p> 132 */ 133 public List<NK1> getNK1All() throws HL7Exception { 134 return getAllAsList("NK1", NK1.class); 135 } 136 137 /** 138 * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties) 139 * @see AbstractGroup#insertRepetition(Structure, int) 140 */ 141 public void insertNK1(NK1 structure, int rep) throws HL7Exception { 142 super.insertRepetition("NK1", structure, rep); 143 } 144 145 146 /** 147 * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties) 148 * @see AbstractGroup#insertRepetition(Structure, int) 149 */ 150 public NK1 insertNK1(int rep) throws HL7Exception { 151 return (NK1)super.insertRepetition("NK1", rep); 152 } 153 154 155 /** 156 * Removes a specific repetition of NK1 (Next of Kin / Associated Parties) 157 * @see AbstractGroup#removeRepetition(String, int) 158 */ 159 public NK1 removeNK1(int rep) throws HL7Exception { 160 return (NK1)super.removeRepetition("NK1", rep); 161 } 162 163 164 165 /** 166 * Returns 167 * PATIENT (a Group object) - creates it if necessary 168 */ 169 public OPL_O37_PATIENT getPATIENT() { 170 OPL_O37_PATIENT retVal = getTyped("PATIENT", OPL_O37_PATIENT.class); 171 return retVal; 172 } 173 174 175 176 177 /** 178 * Returns 179 * the first repetition of 180 * SPECIMEN (a Group object) - creates it if necessary 181 */ 182 public OPL_O37_SPECIMEN getSPECIMEN() { 183 OPL_O37_SPECIMEN retVal = getTyped("SPECIMEN", OPL_O37_SPECIMEN.class); 184 return retVal; 185 } 186 187 188 /** 189 * Returns a specific repetition of 190 * SPECIMEN (a Group object) - creates it if necessary 191 * 192 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 193 * @throws HL7Exception if the repetition requested is more than one 194 * greater than the number of existing repetitions. 195 */ 196 public OPL_O37_SPECIMEN getSPECIMEN(int rep) { 197 OPL_O37_SPECIMEN retVal = getTyped("SPECIMEN", rep, OPL_O37_SPECIMEN.class); 198 return retVal; 199 } 200 201 /** 202 * Returns the number of existing repetitions of SPECIMEN 203 */ 204 public int getSPECIMENReps() { 205 return getReps("SPECIMEN"); 206 } 207 208 /** 209 * <p> 210 * Returns a non-modifiable List containing all current existing repetitions of SPECIMEN. 211 * <p> 212 * <p> 213 * Note that unlike {@link #getSPECIMEN()}, this method will not create any reps 214 * if none are already present, so an empty list may be returned. 215 * </p> 216 */ 217 public List<OPL_O37_SPECIMEN> getSPECIMENAll() throws HL7Exception { 218 return getAllAsList("SPECIMEN", OPL_O37_SPECIMEN.class); 219 } 220 221 /** 222 * Inserts a specific repetition of SPECIMEN (a Group object) 223 * @see AbstractGroup#insertRepetition(Structure, int) 224 */ 225 public void insertSPECIMEN(OPL_O37_SPECIMEN structure, int rep) throws HL7Exception { 226 super.insertRepetition("SPECIMEN", structure, rep); 227 } 228 229 230 /** 231 * Inserts a specific repetition of SPECIMEN (a Group object) 232 * @see AbstractGroup#insertRepetition(Structure, int) 233 */ 234 public OPL_O37_SPECIMEN insertSPECIMEN(int rep) throws HL7Exception { 235 return (OPL_O37_SPECIMEN)super.insertRepetition("SPECIMEN", rep); 236 } 237 238 239 /** 240 * Removes a specific repetition of SPECIMEN (a Group object) 241 * @see AbstractGroup#removeRepetition(String, int) 242 */ 243 public OPL_O37_SPECIMEN removeSPECIMEN(int rep) throws HL7Exception { 244 return (OPL_O37_SPECIMEN)super.removeRepetition("SPECIMEN", rep); 245 } 246 247 248 249 /** 250 * Returns 251 * PRIOR_RESULT (a Group object) - creates it if necessary 252 */ 253 public OPL_O37_PRIOR_RESULT getPRIOR_RESULT() { 254 OPL_O37_PRIOR_RESULT retVal = getTyped("PRIOR_RESULT", OPL_O37_PRIOR_RESULT.class); 255 return retVal; 256 } 257 258 259 260 261 /** 262 * Returns 263 * the first repetition of 264 * FT1 (Financial Transaction) - creates it if necessary 265 */ 266 public FT1 getFT1() { 267 FT1 retVal = getTyped("FT1", FT1.class); 268 return retVal; 269 } 270 271 272 /** 273 * Returns a specific repetition of 274 * FT1 (Financial Transaction) - creates it if necessary 275 * 276 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 277 * @throws HL7Exception if the repetition requested is more than one 278 * greater than the number of existing repetitions. 279 */ 280 public FT1 getFT1(int rep) { 281 FT1 retVal = getTyped("FT1", rep, FT1.class); 282 return retVal; 283 } 284 285 /** 286 * Returns the number of existing repetitions of FT1 287 */ 288 public int getFT1Reps() { 289 return getReps("FT1"); 290 } 291 292 /** 293 * <p> 294 * Returns a non-modifiable List containing all current existing repetitions of FT1. 295 * <p> 296 * <p> 297 * Note that unlike {@link #getFT1()}, this method will not create any reps 298 * if none are already present, so an empty list may be returned. 299 * </p> 300 */ 301 public List<FT1> getFT1All() throws HL7Exception { 302 return getAllAsList("FT1", FT1.class); 303 } 304 305 /** 306 * Inserts a specific repetition of FT1 (Financial Transaction) 307 * @see AbstractGroup#insertRepetition(Structure, int) 308 */ 309 public void insertFT1(FT1 structure, int rep) throws HL7Exception { 310 super.insertRepetition("FT1", structure, rep); 311 } 312 313 314 /** 315 * Inserts a specific repetition of FT1 (Financial Transaction) 316 * @see AbstractGroup#insertRepetition(Structure, int) 317 */ 318 public FT1 insertFT1(int rep) throws HL7Exception { 319 return (FT1)super.insertRepetition("FT1", rep); 320 } 321 322 323 /** 324 * Removes a specific repetition of FT1 (Financial Transaction) 325 * @see AbstractGroup#removeRepetition(String, int) 326 */ 327 public FT1 removeFT1(int rep) throws HL7Exception { 328 return (FT1)super.removeRepetition("FT1", rep); 329 } 330 331 332 333 /** 334 * Returns 335 * the first repetition of 336 * CTI (Clinical Trial Identification) - creates it if necessary 337 */ 338 public CTI getCTI() { 339 CTI retVal = getTyped("CTI", CTI.class); 340 return retVal; 341 } 342 343 344 /** 345 * Returns a specific repetition of 346 * CTI (Clinical Trial Identification) - creates it if necessary 347 * 348 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 349 * @throws HL7Exception if the repetition requested is more than one 350 * greater than the number of existing repetitions. 351 */ 352 public CTI getCTI(int rep) { 353 CTI retVal = getTyped("CTI", rep, CTI.class); 354 return retVal; 355 } 356 357 /** 358 * Returns the number of existing repetitions of CTI 359 */ 360 public int getCTIReps() { 361 return getReps("CTI"); 362 } 363 364 /** 365 * <p> 366 * Returns a non-modifiable List containing all current existing repetitions of CTI. 367 * <p> 368 * <p> 369 * Note that unlike {@link #getCTI()}, this method will not create any reps 370 * if none are already present, so an empty list may be returned. 371 * </p> 372 */ 373 public List<CTI> getCTIAll() throws HL7Exception { 374 return getAllAsList("CTI", CTI.class); 375 } 376 377 /** 378 * Inserts a specific repetition of CTI (Clinical Trial Identification) 379 * @see AbstractGroup#insertRepetition(Structure, int) 380 */ 381 public void insertCTI(CTI structure, int rep) throws HL7Exception { 382 super.insertRepetition("CTI", structure, rep); 383 } 384 385 386 /** 387 * Inserts a specific repetition of CTI (Clinical Trial Identification) 388 * @see AbstractGroup#insertRepetition(Structure, int) 389 */ 390 public CTI insertCTI(int rep) throws HL7Exception { 391 return (CTI)super.insertRepetition("CTI", rep); 392 } 393 394 395 /** 396 * Removes a specific repetition of CTI (Clinical Trial Identification) 397 * @see AbstractGroup#removeRepetition(String, int) 398 */ 399 public CTI removeCTI(int rep) throws HL7Exception { 400 return (CTI)super.removeRepetition("CTI", rep); 401 } 402 403 404 405 /** 406 * Returns 407 * BLG (Billing) - creates it if necessary 408 */ 409 public BLG getBLG() { 410 BLG retVal = getTyped("BLG", BLG.class); 411 return retVal; 412 } 413 414 415 416 417} 418