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.v28.group;
035
036import ca.uhn.hl7v2.model.v28.segment.*;
037
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.model.*;
041
042/**
043 * <p>Represents a EHC_E01_PRODUCT_SERVICE_LINE_ITEM group structure (a Group object).
044 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
045 * This Group contains the following elements:  
046 * </p>
047 * <ul>
048                         * <li>1: PSL (Product/Service Line Item) <b>  choice</b></li>
049                         * <li>2: NTE (Notes and Comments) <b>optional repeating choice</b></li>
050                         * <li>3: ADJ (Adjustment) <b>optional repeating choice</b></li>
051                         * <li>4: AUT (Authorization Information) <b>optional  choice</b></li>
052                         * <li>5: LOC (Location Identification) <b>optional repeating choice</b></li>
053                         * <li>6: PRT (Participation Information) <b>optional repeating choice</b></li>
054                         * <li>7: ROL (Role) <b>optional repeating choice</b></li>
055 * </ul>
056 * <p>
057 * Note that this structure has "choice" elements. This means that one of the 
058 * structures above marked as "choice" must be present, but no more than one.
059 * </p> 
060 */
061//@SuppressWarnings("unused")
062public class EHC_E01_PRODUCT_SERVICE_LINE_ITEM extends AbstractGroup {
063
064    /** 
065     * Creates a new EHC_E01_PRODUCT_SERVICE_LINE_ITEM group
066     */
067    public EHC_E01_PRODUCT_SERVICE_LINE_ITEM(Group parent, ModelClassFactory factory) {
068       super(parent, factory);
069       init(factory);
070    }
071
072    private void init(ModelClassFactory factory) {
073       try {
074                                  this.add(PSL.class, true, false, true);
075                                  this.add(NTE.class, false, true, true);
076                                  this.add(ADJ.class, false, true, true);
077                                  this.add(AUT.class, false, false, true);
078                                  this.add(LOC.class, false, true, true);
079                                  this.add(PRT.class, false, true, true);
080                                  this.add(ROL.class, false, true, true);
081       } catch(HL7Exception e) {
082          log.error("Unexpected error creating EHC_E01_PRODUCT_SERVICE_LINE_ITEM - this is probably a bug in the source code generator.", e);
083       }
084    }
085
086    /** 
087     * Returns "2.8"
088     */
089    public String getVersion() {
090       return "2.8";
091    }
092
093
094
095    /**
096     * Returns
097     * PSL (Product/Service Line Item) - creates it if necessary
098     */
099    public PSL getPSL() { 
100       PSL retVal = getTyped("PSL", PSL.class);
101       return retVal;
102    }
103
104
105
106
107    /**
108     * Returns
109     * the first repetition of 
110     * NTE (Notes and Comments) - creates it if necessary
111     */
112    public NTE getNTE() { 
113       NTE retVal = getTyped("NTE", NTE.class);
114       return retVal;
115    }
116
117
118    /**
119     * Returns a specific repetition of
120     * NTE (Notes and Comments) - 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 NTE getNTE(int rep) { 
127       NTE retVal = getTyped("NTE", rep, NTE.class);
128       return retVal;
129    }
130
131    /** 
132     * Returns the number of existing repetitions of NTE 
133     */ 
134    public int getNTEReps() {  
135        return getReps("NTE");
136    } 
137
138    /** 
139     * <p>
140     * Returns a non-modifiable List containing all current existing repetitions of NTE.
141     * <p>
142     * <p>
143     * Note that unlike {@link #getNTE()}, 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<NTE> getNTEAll() throws HL7Exception {
148        return getAllAsList("NTE", NTE.class);
149    } 
150
151    /**
152     * Inserts a specific repetition of NTE (Notes and Comments)
153     * @see AbstractGroup#insertRepetition(Structure, int) 
154     */
155    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
156       super.insertRepetition("NTE", structure, rep);
157    }
158
159
160    /**
161     * Inserts a specific repetition of NTE (Notes and Comments)
162     * @see AbstractGroup#insertRepetition(Structure, int) 
163     */
164    public NTE insertNTE(int rep) throws HL7Exception { 
165       return (NTE)super.insertRepetition("NTE", rep);
166    }
167
168
169    /**
170     * Removes a specific repetition of NTE (Notes and Comments)
171     * @see AbstractGroup#removeRepetition(String, int) 
172     */
173    public NTE removeNTE(int rep) throws HL7Exception { 
174       return (NTE)super.removeRepetition("NTE", rep);
175    }
176
177
178
179    /**
180     * Returns
181     * the first repetition of 
182     * ADJ (Adjustment) - creates it if necessary
183     */
184    public ADJ getADJ() { 
185       ADJ retVal = getTyped("ADJ", ADJ.class);
186       return retVal;
187    }
188
189
190    /**
191     * Returns a specific repetition of
192     * ADJ (Adjustment) - creates it if necessary
193     *
194     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
195     * @throws HL7Exception if the repetition requested is more than one 
196     *     greater than the number of existing repetitions.
197     */
198    public ADJ getADJ(int rep) { 
199       ADJ retVal = getTyped("ADJ", rep, ADJ.class);
200       return retVal;
201    }
202
203    /** 
204     * Returns the number of existing repetitions of ADJ 
205     */ 
206    public int getADJReps() {  
207        return getReps("ADJ");
208    } 
209
210    /** 
211     * <p>
212     * Returns a non-modifiable List containing all current existing repetitions of ADJ.
213     * <p>
214     * <p>
215     * Note that unlike {@link #getADJ()}, this method will not create any reps
216     * if none are already present, so an empty list may be returned.
217     * </p>
218     */ 
219    public java.util.List<ADJ> getADJAll() throws HL7Exception {
220        return getAllAsList("ADJ", ADJ.class);
221    } 
222
223    /**
224     * Inserts a specific repetition of ADJ (Adjustment)
225     * @see AbstractGroup#insertRepetition(Structure, int) 
226     */
227    public void insertADJ(ADJ structure, int rep) throws HL7Exception { 
228       super.insertRepetition("ADJ", structure, rep);
229    }
230
231
232    /**
233     * Inserts a specific repetition of ADJ (Adjustment)
234     * @see AbstractGroup#insertRepetition(Structure, int) 
235     */
236    public ADJ insertADJ(int rep) throws HL7Exception { 
237       return (ADJ)super.insertRepetition("ADJ", rep);
238    }
239
240
241    /**
242     * Removes a specific repetition of ADJ (Adjustment)
243     * @see AbstractGroup#removeRepetition(String, int) 
244     */
245    public ADJ removeADJ(int rep) throws HL7Exception { 
246       return (ADJ)super.removeRepetition("ADJ", rep);
247    }
248
249
250
251    /**
252     * Returns
253     * AUT (Authorization Information) - creates it if necessary
254     */
255    public AUT getAUT() { 
256       AUT retVal = getTyped("AUT", AUT.class);
257       return retVal;
258    }
259
260
261
262
263    /**
264     * Returns
265     * the first repetition of 
266     * LOC (Location Identification) - creates it if necessary
267     */
268    public LOC getLOC() { 
269       LOC retVal = getTyped("LOC", LOC.class);
270       return retVal;
271    }
272
273
274    /**
275     * Returns a specific repetition of
276     * LOC (Location Identification) - creates it if necessary
277     *
278     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
279     * @throws HL7Exception if the repetition requested is more than one 
280     *     greater than the number of existing repetitions.
281     */
282    public LOC getLOC(int rep) { 
283       LOC retVal = getTyped("LOC", rep, LOC.class);
284       return retVal;
285    }
286
287    /** 
288     * Returns the number of existing repetitions of LOC 
289     */ 
290    public int getLOCReps() {  
291        return getReps("LOC");
292    } 
293
294    /** 
295     * <p>
296     * Returns a non-modifiable List containing all current existing repetitions of LOC.
297     * <p>
298     * <p>
299     * Note that unlike {@link #getLOC()}, this method will not create any reps
300     * if none are already present, so an empty list may be returned.
301     * </p>
302     */ 
303    public java.util.List<LOC> getLOCAll() throws HL7Exception {
304        return getAllAsList("LOC", LOC.class);
305    } 
306
307    /**
308     * Inserts a specific repetition of LOC (Location Identification)
309     * @see AbstractGroup#insertRepetition(Structure, int) 
310     */
311    public void insertLOC(LOC structure, int rep) throws HL7Exception { 
312       super.insertRepetition("LOC", structure, rep);
313    }
314
315
316    /**
317     * Inserts a specific repetition of LOC (Location Identification)
318     * @see AbstractGroup#insertRepetition(Structure, int) 
319     */
320    public LOC insertLOC(int rep) throws HL7Exception { 
321       return (LOC)super.insertRepetition("LOC", rep);
322    }
323
324
325    /**
326     * Removes a specific repetition of LOC (Location Identification)
327     * @see AbstractGroup#removeRepetition(String, int) 
328     */
329    public LOC removeLOC(int rep) throws HL7Exception { 
330       return (LOC)super.removeRepetition("LOC", rep);
331    }
332
333
334
335    /**
336     * Returns
337     * the first repetition of 
338     * PRT (Participation Information) - creates it if necessary
339     */
340    public PRT getPRT() { 
341       PRT retVal = getTyped("PRT", PRT.class);
342       return retVal;
343    }
344
345
346    /**
347     * Returns a specific repetition of
348     * PRT (Participation Information) - creates it if necessary
349     *
350     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
351     * @throws HL7Exception if the repetition requested is more than one 
352     *     greater than the number of existing repetitions.
353     */
354    public PRT getPRT(int rep) { 
355       PRT retVal = getTyped("PRT", rep, PRT.class);
356       return retVal;
357    }
358
359    /** 
360     * Returns the number of existing repetitions of PRT 
361     */ 
362    public int getPRTReps() {  
363        return getReps("PRT");
364    } 
365
366    /** 
367     * <p>
368     * Returns a non-modifiable List containing all current existing repetitions of PRT.
369     * <p>
370     * <p>
371     * Note that unlike {@link #getPRT()}, this method will not create any reps
372     * if none are already present, so an empty list may be returned.
373     * </p>
374     */ 
375    public java.util.List<PRT> getPRTAll() throws HL7Exception {
376        return getAllAsList("PRT", PRT.class);
377    } 
378
379    /**
380     * Inserts a specific repetition of PRT (Participation Information)
381     * @see AbstractGroup#insertRepetition(Structure, int) 
382     */
383    public void insertPRT(PRT structure, int rep) throws HL7Exception { 
384       super.insertRepetition("PRT", structure, rep);
385    }
386
387
388    /**
389     * Inserts a specific repetition of PRT (Participation Information)
390     * @see AbstractGroup#insertRepetition(Structure, int) 
391     */
392    public PRT insertPRT(int rep) throws HL7Exception { 
393       return (PRT)super.insertRepetition("PRT", rep);
394    }
395
396
397    /**
398     * Removes a specific repetition of PRT (Participation Information)
399     * @see AbstractGroup#removeRepetition(String, int) 
400     */
401    public PRT removePRT(int rep) throws HL7Exception { 
402       return (PRT)super.removeRepetition("PRT", rep);
403    }
404
405
406
407    /**
408     * Returns
409     * the first repetition of 
410     * ROL (Role) - creates it if necessary
411     */
412    public ROL getROL() { 
413       ROL retVal = getTyped("ROL", ROL.class);
414       return retVal;
415    }
416
417
418    /**
419     * Returns a specific repetition of
420     * ROL (Role) - creates it if necessary
421     *
422     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
423     * @throws HL7Exception if the repetition requested is more than one 
424     *     greater than the number of existing repetitions.
425     */
426    public ROL getROL(int rep) { 
427       ROL retVal = getTyped("ROL", rep, ROL.class);
428       return retVal;
429    }
430
431    /** 
432     * Returns the number of existing repetitions of ROL 
433     */ 
434    public int getROLReps() {  
435        return getReps("ROL");
436    } 
437
438    /** 
439     * <p>
440     * Returns a non-modifiable List containing all current existing repetitions of ROL.
441     * <p>
442     * <p>
443     * Note that unlike {@link #getROL()}, this method will not create any reps
444     * if none are already present, so an empty list may be returned.
445     * </p>
446     */ 
447    public java.util.List<ROL> getROLAll() throws HL7Exception {
448        return getAllAsList("ROL", ROL.class);
449    } 
450
451    /**
452     * Inserts a specific repetition of ROL (Role)
453     * @see AbstractGroup#insertRepetition(Structure, int) 
454     */
455    public void insertROL(ROL structure, int rep) throws HL7Exception { 
456       super.insertRepetition("ROL", structure, rep);
457    }
458
459
460    /**
461     * Inserts a specific repetition of ROL (Role)
462     * @see AbstractGroup#insertRepetition(Structure, int) 
463     */
464    public ROL insertROL(int rep) throws HL7Exception { 
465       return (ROL)super.insertRepetition("ROL", rep);
466    }
467
468
469    /**
470     * Removes a specific repetition of ROL (Role)
471     * @see AbstractGroup#removeRepetition(String, int) 
472     */
473    public ROL removeROL(int rep) throws HL7Exception { 
474       return (ROL)super.removeRepetition("ROL", rep);
475    }
476
477
478
479}
480