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 EHC_E01_PRODUCT_SERVICE_GROUP 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: PSG (Product/Service Group) <b> </b></li>
051                 * <li>2: LOC (Location Identification) <b>optional repeating</b></li>
052                 * <li>3: ROL (Role) <b>optional repeating</b></li>
053                 * <li>4: EHC_E01_PATIENT_INFO (a Group object) <b>optional repeating</b></li>
054                 * <li>5: EHC_E01_PRODUCT_SERVICE_LINE_ITEM (a Group object) <b> repeating</b></li>
055                 * <li>6: EHC_E01_PROCEDURE (a Group object) <b>optional repeating</b></li>
056                 * <li>7: EHC_E01_INVOICE_PROCESSING (a Group object) <b>optional repeating</b></li>
057 * </ul>
058 */
059@SuppressWarnings("unused")
060public class EHC_E01_PRODUCT_SERVICE_GROUP extends AbstractGroup {
061
062    /** 
063     * Creates a new EHC_E01_PRODUCT_SERVICE_GROUP group
064     */
065    public EHC_E01_PRODUCT_SERVICE_GROUP(Group parent, ModelClassFactory factory) {
066       super(parent, factory);
067       init(factory);
068    }
069
070    private void init(ModelClassFactory factory) {
071       try {
072                          this.add(PSG.class, true, false);
073                          this.add(LOC.class, false, true);
074                          this.add(ROL.class, false, true);
075                          this.add(EHC_E01_PATIENT_INFO.class, false, true);
076                          this.add(EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class, true, true);
077                          this.add(EHC_E01_PROCEDURE.class, false, true);
078                          this.add(EHC_E01_INVOICE_PROCESSING.class, false, true);
079       } catch(HL7Exception e) {
080          log.error("Unexpected error creating EHC_E01_PRODUCT_SERVICE_GROUP - 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     * PSG (Product/Service Group) - creates it if necessary
096     */
097    public PSG getPSG() { 
098       PSG retVal = getTyped("PSG", PSG.class);
099       return retVal;
100    }
101
102
103
104
105    /**
106     * Returns
107     * the first repetition of 
108     * LOC (Location Identification) - creates it if necessary
109     */
110    public LOC getLOC() { 
111       LOC retVal = getTyped("LOC", LOC.class);
112       return retVal;
113    }
114
115
116    /**
117     * Returns a specific repetition of
118     * LOC (Location Identification) - 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 LOC getLOC(int rep) { 
125       LOC retVal = getTyped("LOC", rep, LOC.class);
126       return retVal;
127    }
128
129    /** 
130     * Returns the number of existing repetitions of LOC 
131     */ 
132    public int getLOCReps() {  
133        return getReps("LOC");
134    } 
135
136    /** 
137     * <p>
138     * Returns a non-modifiable List containing all current existing repetitions of LOC.
139     * <p>
140     * <p>
141     * Note that unlike {@link #getLOC()}, 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 List<LOC> getLOCAll() throws HL7Exception {
146        return getAllAsList("LOC", LOC.class);
147    } 
148
149    /**
150     * Inserts a specific repetition of LOC (Location Identification)
151     * @see AbstractGroup#insertRepetition(Structure, int) 
152     */
153    public void insertLOC(LOC structure, int rep) throws HL7Exception { 
154       super.insertRepetition("LOC", structure, rep);
155    }
156
157
158    /**
159     * Inserts a specific repetition of LOC (Location Identification)
160     * @see AbstractGroup#insertRepetition(Structure, int) 
161     */
162    public LOC insertLOC(int rep) throws HL7Exception { 
163       return (LOC)super.insertRepetition("LOC", rep);
164    }
165
166
167    /**
168     * Removes a specific repetition of LOC (Location Identification)
169     * @see AbstractGroup#removeRepetition(String, int) 
170     */
171    public LOC removeLOC(int rep) throws HL7Exception { 
172       return (LOC)super.removeRepetition("LOC", rep);
173    }
174
175
176
177    /**
178     * Returns
179     * the first repetition of 
180     * ROL (Role) - creates it if necessary
181     */
182    public ROL getROL() { 
183       ROL retVal = getTyped("ROL", ROL.class);
184       return retVal;
185    }
186
187
188    /**
189     * Returns a specific repetition of
190     * ROL (Role) - 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 ROL getROL(int rep) { 
197       ROL retVal = getTyped("ROL", rep, ROL.class);
198       return retVal;
199    }
200
201    /** 
202     * Returns the number of existing repetitions of ROL 
203     */ 
204    public int getROLReps() {  
205        return getReps("ROL");
206    } 
207
208    /** 
209     * <p>
210     * Returns a non-modifiable List containing all current existing repetitions of ROL.
211     * <p>
212     * <p>
213     * Note that unlike {@link #getROL()}, 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<ROL> getROLAll() throws HL7Exception {
218        return getAllAsList("ROL", ROL.class);
219    } 
220
221    /**
222     * Inserts a specific repetition of ROL (Role)
223     * @see AbstractGroup#insertRepetition(Structure, int) 
224     */
225    public void insertROL(ROL structure, int rep) throws HL7Exception { 
226       super.insertRepetition("ROL", structure, rep);
227    }
228
229
230    /**
231     * Inserts a specific repetition of ROL (Role)
232     * @see AbstractGroup#insertRepetition(Structure, int) 
233     */
234    public ROL insertROL(int rep) throws HL7Exception { 
235       return (ROL)super.insertRepetition("ROL", rep);
236    }
237
238
239    /**
240     * Removes a specific repetition of ROL (Role)
241     * @see AbstractGroup#removeRepetition(String, int) 
242     */
243    public ROL removeROL(int rep) throws HL7Exception { 
244       return (ROL)super.removeRepetition("ROL", rep);
245    }
246
247
248
249    /**
250     * Returns
251     * the first repetition of 
252     * PATIENT_INFO (a Group object) - creates it if necessary
253     */
254    public EHC_E01_PATIENT_INFO getPATIENT_INFO() { 
255       EHC_E01_PATIENT_INFO retVal = getTyped("PATIENT_INFO", EHC_E01_PATIENT_INFO.class);
256       return retVal;
257    }
258
259
260    /**
261     * Returns a specific repetition of
262     * PATIENT_INFO (a Group object) - creates it if necessary
263     *
264     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
265     * @throws HL7Exception if the repetition requested is more than one 
266     *     greater than the number of existing repetitions.
267     */
268    public EHC_E01_PATIENT_INFO getPATIENT_INFO(int rep) { 
269       EHC_E01_PATIENT_INFO retVal = getTyped("PATIENT_INFO", rep, EHC_E01_PATIENT_INFO.class);
270       return retVal;
271    }
272
273    /** 
274     * Returns the number of existing repetitions of PATIENT_INFO 
275     */ 
276    public int getPATIENT_INFOReps() {  
277        return getReps("PATIENT_INFO");
278    } 
279
280    /** 
281     * <p>
282     * Returns a non-modifiable List containing all current existing repetitions of PATIENT_INFO.
283     * <p>
284     * <p>
285     * Note that unlike {@link #getPATIENT_INFO()}, this method will not create any reps
286     * if none are already present, so an empty list may be returned.
287     * </p>
288     */ 
289    public List<EHC_E01_PATIENT_INFO> getPATIENT_INFOAll() throws HL7Exception {
290        return getAllAsList("PATIENT_INFO", EHC_E01_PATIENT_INFO.class);
291    } 
292
293    /**
294     * Inserts a specific repetition of PATIENT_INFO (a Group object)
295     * @see AbstractGroup#insertRepetition(Structure, int) 
296     */
297    public void insertPATIENT_INFO(EHC_E01_PATIENT_INFO structure, int rep) throws HL7Exception { 
298       super.insertRepetition("PATIENT_INFO", structure, rep);
299    }
300
301
302    /**
303     * Inserts a specific repetition of PATIENT_INFO (a Group object)
304     * @see AbstractGroup#insertRepetition(Structure, int) 
305     */
306    public EHC_E01_PATIENT_INFO insertPATIENT_INFO(int rep) throws HL7Exception { 
307       return (EHC_E01_PATIENT_INFO)super.insertRepetition("PATIENT_INFO", rep);
308    }
309
310
311    /**
312     * Removes a specific repetition of PATIENT_INFO (a Group object)
313     * @see AbstractGroup#removeRepetition(String, int) 
314     */
315    public EHC_E01_PATIENT_INFO removePATIENT_INFO(int rep) throws HL7Exception { 
316       return (EHC_E01_PATIENT_INFO)super.removeRepetition("PATIENT_INFO", rep);
317    }
318
319
320
321    /**
322     * Returns
323     * the first repetition of 
324     * PRODUCT_SERVICE_LINE_ITEM (a Group object) - creates it if necessary
325     */
326    public EHC_E01_PRODUCT_SERVICE_LINE_ITEM getPRODUCT_SERVICE_LINE_ITEM() { 
327       EHC_E01_PRODUCT_SERVICE_LINE_ITEM retVal = getTyped("PRODUCT_SERVICE_LINE_ITEM", EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class);
328       return retVal;
329    }
330
331
332    /**
333     * Returns a specific repetition of
334     * PRODUCT_SERVICE_LINE_ITEM (a Group object) - creates it if necessary
335     *
336     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
337     * @throws HL7Exception if the repetition requested is more than one 
338     *     greater than the number of existing repetitions.
339     */
340    public EHC_E01_PRODUCT_SERVICE_LINE_ITEM getPRODUCT_SERVICE_LINE_ITEM(int rep) { 
341       EHC_E01_PRODUCT_SERVICE_LINE_ITEM retVal = getTyped("PRODUCT_SERVICE_LINE_ITEM", rep, EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class);
342       return retVal;
343    }
344
345    /** 
346     * Returns the number of existing repetitions of PRODUCT_SERVICE_LINE_ITEM 
347     */ 
348    public int getPRODUCT_SERVICE_LINE_ITEMReps() {  
349        return getReps("PRODUCT_SERVICE_LINE_ITEM");
350    } 
351
352    /** 
353     * <p>
354     * Returns a non-modifiable List containing all current existing repetitions of PRODUCT_SERVICE_LINE_ITEM.
355     * <p>
356     * <p>
357     * Note that unlike {@link #getPRODUCT_SERVICE_LINE_ITEM()}, this method will not create any reps
358     * if none are already present, so an empty list may be returned.
359     * </p>
360     */ 
361    public List<EHC_E01_PRODUCT_SERVICE_LINE_ITEM> getPRODUCT_SERVICE_LINE_ITEMAll() throws HL7Exception {
362        return getAllAsList("PRODUCT_SERVICE_LINE_ITEM", EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class);
363    } 
364
365    /**
366     * Inserts a specific repetition of PRODUCT_SERVICE_LINE_ITEM (a Group object)
367     * @see AbstractGroup#insertRepetition(Structure, int) 
368     */
369    public void insertPRODUCT_SERVICE_LINE_ITEM(EHC_E01_PRODUCT_SERVICE_LINE_ITEM structure, int rep) throws HL7Exception { 
370       super.insertRepetition("PRODUCT_SERVICE_LINE_ITEM", structure, rep);
371    }
372
373
374    /**
375     * Inserts a specific repetition of PRODUCT_SERVICE_LINE_ITEM (a Group object)
376     * @see AbstractGroup#insertRepetition(Structure, int) 
377     */
378    public EHC_E01_PRODUCT_SERVICE_LINE_ITEM insertPRODUCT_SERVICE_LINE_ITEM(int rep) throws HL7Exception { 
379       return (EHC_E01_PRODUCT_SERVICE_LINE_ITEM)super.insertRepetition("PRODUCT_SERVICE_LINE_ITEM", rep);
380    }
381
382
383    /**
384     * Removes a specific repetition of PRODUCT_SERVICE_LINE_ITEM (a Group object)
385     * @see AbstractGroup#removeRepetition(String, int) 
386     */
387    public EHC_E01_PRODUCT_SERVICE_LINE_ITEM removePRODUCT_SERVICE_LINE_ITEM(int rep) throws HL7Exception { 
388       return (EHC_E01_PRODUCT_SERVICE_LINE_ITEM)super.removeRepetition("PRODUCT_SERVICE_LINE_ITEM", rep);
389    }
390
391
392
393    /**
394     * Returns
395     * the first repetition of 
396     * PROCEDURE (a Group object) - creates it if necessary
397     */
398    public EHC_E01_PROCEDURE getPROCEDURE() { 
399       EHC_E01_PROCEDURE retVal = getTyped("PROCEDURE", EHC_E01_PROCEDURE.class);
400       return retVal;
401    }
402
403
404    /**
405     * Returns a specific repetition of
406     * PROCEDURE (a Group object) - creates it if necessary
407     *
408     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
409     * @throws HL7Exception if the repetition requested is more than one 
410     *     greater than the number of existing repetitions.
411     */
412    public EHC_E01_PROCEDURE getPROCEDURE(int rep) { 
413       EHC_E01_PROCEDURE retVal = getTyped("PROCEDURE", rep, EHC_E01_PROCEDURE.class);
414       return retVal;
415    }
416
417    /** 
418     * Returns the number of existing repetitions of PROCEDURE 
419     */ 
420    public int getPROCEDUREReps() {  
421        return getReps("PROCEDURE");
422    } 
423
424    /** 
425     * <p>
426     * Returns a non-modifiable List containing all current existing repetitions of PROCEDURE.
427     * <p>
428     * <p>
429     * Note that unlike {@link #getPROCEDURE()}, this method will not create any reps
430     * if none are already present, so an empty list may be returned.
431     * </p>
432     */ 
433    public List<EHC_E01_PROCEDURE> getPROCEDUREAll() throws HL7Exception {
434        return getAllAsList("PROCEDURE", EHC_E01_PROCEDURE.class);
435    } 
436
437    /**
438     * Inserts a specific repetition of PROCEDURE (a Group object)
439     * @see AbstractGroup#insertRepetition(Structure, int) 
440     */
441    public void insertPROCEDURE(EHC_E01_PROCEDURE structure, int rep) throws HL7Exception { 
442       super.insertRepetition("PROCEDURE", structure, rep);
443    }
444
445
446    /**
447     * Inserts a specific repetition of PROCEDURE (a Group object)
448     * @see AbstractGroup#insertRepetition(Structure, int) 
449     */
450    public EHC_E01_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception { 
451       return (EHC_E01_PROCEDURE)super.insertRepetition("PROCEDURE", rep);
452    }
453
454
455    /**
456     * Removes a specific repetition of PROCEDURE (a Group object)
457     * @see AbstractGroup#removeRepetition(String, int) 
458     */
459    public EHC_E01_PROCEDURE removePROCEDURE(int rep) throws HL7Exception { 
460       return (EHC_E01_PROCEDURE)super.removeRepetition("PROCEDURE", rep);
461    }
462
463
464
465    /**
466     * Returns
467     * the first repetition of 
468     * INVOICE_PROCESSING (a Group object) - creates it if necessary
469     */
470    public EHC_E01_INVOICE_PROCESSING getINVOICE_PROCESSING() { 
471       EHC_E01_INVOICE_PROCESSING retVal = getTyped("INVOICE_PROCESSING", EHC_E01_INVOICE_PROCESSING.class);
472       return retVal;
473    }
474
475
476    /**
477     * Returns a specific repetition of
478     * INVOICE_PROCESSING (a Group object) - creates it if necessary
479     *
480     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
481     * @throws HL7Exception if the repetition requested is more than one 
482     *     greater than the number of existing repetitions.
483     */
484    public EHC_E01_INVOICE_PROCESSING getINVOICE_PROCESSING(int rep) { 
485       EHC_E01_INVOICE_PROCESSING retVal = getTyped("INVOICE_PROCESSING", rep, EHC_E01_INVOICE_PROCESSING.class);
486       return retVal;
487    }
488
489    /** 
490     * Returns the number of existing repetitions of INVOICE_PROCESSING 
491     */ 
492    public int getINVOICE_PROCESSINGReps() {  
493        return getReps("INVOICE_PROCESSING");
494    } 
495
496    /** 
497     * <p>
498     * Returns a non-modifiable List containing all current existing repetitions of INVOICE_PROCESSING.
499     * <p>
500     * <p>
501     * Note that unlike {@link #getINVOICE_PROCESSING()}, this method will not create any reps
502     * if none are already present, so an empty list may be returned.
503     * </p>
504     */ 
505    public List<EHC_E01_INVOICE_PROCESSING> getINVOICE_PROCESSINGAll() throws HL7Exception {
506        return getAllAsList("INVOICE_PROCESSING", EHC_E01_INVOICE_PROCESSING.class);
507    } 
508
509    /**
510     * Inserts a specific repetition of INVOICE_PROCESSING (a Group object)
511     * @see AbstractGroup#insertRepetition(Structure, int) 
512     */
513    public void insertINVOICE_PROCESSING(EHC_E01_INVOICE_PROCESSING structure, int rep) throws HL7Exception { 
514       super.insertRepetition("INVOICE_PROCESSING", structure, rep);
515    }
516
517
518    /**
519     * Inserts a specific repetition of INVOICE_PROCESSING (a Group object)
520     * @see AbstractGroup#insertRepetition(Structure, int) 
521     */
522    public EHC_E01_INVOICE_PROCESSING insertINVOICE_PROCESSING(int rep) throws HL7Exception { 
523       return (EHC_E01_INVOICE_PROCESSING)super.insertRepetition("INVOICE_PROCESSING", rep);
524    }
525
526
527    /**
528     * Removes a specific repetition of INVOICE_PROCESSING (a Group object)
529     * @see AbstractGroup#removeRepetition(String, int) 
530     */
531    public EHC_E01_INVOICE_PROCESSING removeINVOICE_PROCESSING(int rep) throws HL7Exception { 
532       return (EHC_E01_INVOICE_PROCESSING)super.removeRepetition("INVOICE_PROCESSING", rep);
533    }
534
535
536
537}
538