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.v26.group; 35 36 import ca.uhn.hl7v2.model.v26.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 EHC_E01_PRODUCT_SERVICE_LINE_ITEM 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: PSL (Product/Service Line Item) <b> choice</b></li> 49 * <li>2: NTE (Notes and Comments) <b>optional repeating choice</b></li> 50 * <li>3: ADJ (Adjustment) <b>optional repeating choice</b></li> 51 * <li>4: AUT (Authorization Information) <b>optional choice</b></li> 52 * <li>5: LOC (Location Identification) <b>optional repeating choice</b></li> 53 * <li>6: ROL (Role) <b>optional repeating choice</b></li> 54 * </ul> 55 * <p> 56 * Note that this structure has "choice" elements. This means that one of the 57 * structures above marked as "choice" must be present, but no more than one. 58 * </p> 59 */ 60 //@SuppressWarnings("unused") 61 public class EHC_E01_PRODUCT_SERVICE_LINE_ITEM extends AbstractGroup { 62 63 /** 64 * Creates a new EHC_E01_PRODUCT_SERVICE_LINE_ITEM group 65 */ 66 public EHC_E01_PRODUCT_SERVICE_LINE_ITEM(Group parent, ModelClassFactory factory) { 67 super(parent, factory); 68 init(factory); 69 } 70 71 private void init(ModelClassFactory factory) { 72 try { 73 this.add(PSL.class, true, false, true); 74 this.add(NTE.class, false, true, true); 75 this.add(ADJ.class, false, true, true); 76 this.add(AUT.class, false, false, true); 77 this.add(LOC.class, false, true, true); 78 this.add(ROL.class, false, true, true); 79 } catch(HL7Exception e) { 80 log.error("Unexpected error creating EHC_E01_PRODUCT_SERVICE_LINE_ITEM - this is probably a bug in the source code generator.", e); 81 } 82 } 83 84 /** 85 * Returns "2.6" 86 */ 87 public String getVersion() { 88 return "2.6"; 89 } 90 91 92 93 /** 94 * Returns 95 * PSL (Product/Service Line Item) - creates it if necessary 96 */ 97 public PSL getPSL() { 98 PSL retVal = getTyped("PSL", PSL.class); 99 return retVal; 100 } 101 102 103 104 105 /** 106 * Returns 107 * the first repetition of 108 * NTE (Notes and Comments) - creates it if necessary 109 */ 110 public NTE getNTE() { 111 NTE retVal = getTyped("NTE", NTE.class); 112 return retVal; 113 } 114 115 116 /** 117 * Returns a specific repetition of 118 * NTE (Notes and Comments) - creates it if necessary 119 * 120 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 121 * @throws HL7Exception if the repetition requested is more than one 122 * greater than the number of existing repetitions. 123 */ 124 public NTE getNTE(int rep) { 125 NTE retVal = getTyped("NTE", rep, NTE.class); 126 return retVal; 127 } 128 129 /** 130 * Returns the number of existing repetitions of NTE 131 */ 132 public int getNTEReps() { 133 return getReps("NTE"); 134 } 135 136 /** 137 * <p> 138 * Returns a non-modifiable List containing all current existing repetitions of NTE. 139 * <p> 140 * <p> 141 * Note that unlike {@link #getNTE()}, this method will not create any reps 142 * if none are already present, so an empty list may be returned. 143 * </p> 144 */ 145 public java.util.List<NTE> getNTEAll() throws HL7Exception { 146 return getAllAsList("NTE", NTE.class); 147 } 148 149 /** 150 * Inserts a specific repetition of NTE (Notes and Comments) 151 * @see AbstractGroup#insertRepetition(Structure, int) 152 */ 153 public void insertNTE(NTE structure, int rep) throws HL7Exception { 154 super.insertRepetition("NTE", structure, rep); 155 } 156 157 158 /** 159 * Inserts a specific repetition of NTE (Notes and Comments) 160 * @see AbstractGroup#insertRepetition(Structure, int) 161 */ 162 public NTE insertNTE(int rep) throws HL7Exception { 163 return (NTE)super.insertRepetition("NTE", rep); 164 } 165 166 167 /** 168 * Removes a specific repetition of NTE (Notes and Comments) 169 * @see AbstractGroup#removeRepetition(String, int) 170 */ 171 public NTE removeNTE(int rep) throws HL7Exception { 172 return (NTE)super.removeRepetition("NTE", rep); 173 } 174 175 176 177 /** 178 * Returns 179 * the first repetition of 180 * ADJ (Adjustment) - creates it if necessary 181 */ 182 public ADJ getADJ() { 183 ADJ retVal = getTyped("ADJ", ADJ.class); 184 return retVal; 185 } 186 187 188 /** 189 * Returns a specific repetition of 190 * ADJ (Adjustment) - 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 ADJ getADJ(int rep) { 197 ADJ retVal = getTyped("ADJ", rep, ADJ.class); 198 return retVal; 199 } 200 201 /** 202 * Returns the number of existing repetitions of ADJ 203 */ 204 public int getADJReps() { 205 return getReps("ADJ"); 206 } 207 208 /** 209 * <p> 210 * Returns a non-modifiable List containing all current existing repetitions of ADJ. 211 * <p> 212 * <p> 213 * Note that unlike {@link #getADJ()}, 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 java.util.List<ADJ> getADJAll() throws HL7Exception { 218 return getAllAsList("ADJ", ADJ.class); 219 } 220 221 /** 222 * Inserts a specific repetition of ADJ (Adjustment) 223 * @see AbstractGroup#insertRepetition(Structure, int) 224 */ 225 public void insertADJ(ADJ structure, int rep) throws HL7Exception { 226 super.insertRepetition("ADJ", structure, rep); 227 } 228 229 230 /** 231 * Inserts a specific repetition of ADJ (Adjustment) 232 * @see AbstractGroup#insertRepetition(Structure, int) 233 */ 234 public ADJ insertADJ(int rep) throws HL7Exception { 235 return (ADJ)super.insertRepetition("ADJ", rep); 236 } 237 238 239 /** 240 * Removes a specific repetition of ADJ (Adjustment) 241 * @see AbstractGroup#removeRepetition(String, int) 242 */ 243 public ADJ removeADJ(int rep) throws HL7Exception { 244 return (ADJ)super.removeRepetition("ADJ", rep); 245 } 246 247 248 249 /** 250 * Returns 251 * AUT (Authorization Information) - creates it if necessary 252 */ 253 public AUT getAUT() { 254 AUT retVal = getTyped("AUT", AUT.class); 255 return retVal; 256 } 257 258 259 260 261 /** 262 * Returns 263 * the first repetition of 264 * LOC (Location Identification) - creates it if necessary 265 */ 266 public LOC getLOC() { 267 LOC retVal = getTyped("LOC", LOC.class); 268 return retVal; 269 } 270 271 272 /** 273 * Returns a specific repetition of 274 * LOC (Location Identification) - 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 LOC getLOC(int rep) { 281 LOC retVal = getTyped("LOC", rep, LOC.class); 282 return retVal; 283 } 284 285 /** 286 * Returns the number of existing repetitions of LOC 287 */ 288 public int getLOCReps() { 289 return getReps("LOC"); 290 } 291 292 /** 293 * <p> 294 * Returns a non-modifiable List containing all current existing repetitions of LOC. 295 * <p> 296 * <p> 297 * Note that unlike {@link #getLOC()}, 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 java.util.List<LOC> getLOCAll() throws HL7Exception { 302 return getAllAsList("LOC", LOC.class); 303 } 304 305 /** 306 * Inserts a specific repetition of LOC (Location Identification) 307 * @see AbstractGroup#insertRepetition(Structure, int) 308 */ 309 public void insertLOC(LOC structure, int rep) throws HL7Exception { 310 super.insertRepetition("LOC", structure, rep); 311 } 312 313 314 /** 315 * Inserts a specific repetition of LOC (Location Identification) 316 * @see AbstractGroup#insertRepetition(Structure, int) 317 */ 318 public LOC insertLOC(int rep) throws HL7Exception { 319 return (LOC)super.insertRepetition("LOC", rep); 320 } 321 322 323 /** 324 * Removes a specific repetition of LOC (Location Identification) 325 * @see AbstractGroup#removeRepetition(String, int) 326 */ 327 public LOC removeLOC(int rep) throws HL7Exception { 328 return (LOC)super.removeRepetition("LOC", rep); 329 } 330 331 332 333 /** 334 * Returns 335 * the first repetition of 336 * ROL (Role) - creates it if necessary 337 */ 338 public ROL getROL() { 339 ROL retVal = getTyped("ROL", ROL.class); 340 return retVal; 341 } 342 343 344 /** 345 * Returns a specific repetition of 346 * ROL (Role) - 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 ROL getROL(int rep) { 353 ROL retVal = getTyped("ROL", rep, ROL.class); 354 return retVal; 355 } 356 357 /** 358 * Returns the number of existing repetitions of ROL 359 */ 360 public int getROLReps() { 361 return getReps("ROL"); 362 } 363 364 /** 365 * <p> 366 * Returns a non-modifiable List containing all current existing repetitions of ROL. 367 * <p> 368 * <p> 369 * Note that unlike {@link #getROL()}, 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 java.util.List<ROL> getROLAll() throws HL7Exception { 374 return getAllAsList("ROL", ROL.class); 375 } 376 377 /** 378 * Inserts a specific repetition of ROL (Role) 379 * @see AbstractGroup#insertRepetition(Structure, int) 380 */ 381 public void insertROL(ROL structure, int rep) throws HL7Exception { 382 super.insertRepetition("ROL", structure, rep); 383 } 384 385 386 /** 387 * Inserts a specific repetition of ROL (Role) 388 * @see AbstractGroup#insertRepetition(Structure, int) 389 */ 390 public ROL insertROL(int rep) throws HL7Exception { 391 return (ROL)super.insertRepetition("ROL", rep); 392 } 393 394 395 /** 396 * Removes a specific repetition of ROL (Role) 397 * @see AbstractGroup#removeRepetition(String, int) 398 */ 399 public ROL removeROL(int rep) throws HL7Exception { 400 return (ROL)super.removeRepetition("ROL", rep); 401 } 402 403 404 405 } 406