View Javadoc
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.v28.group;
35  
36  import ca.uhn.hl7v2.model.v28.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_GROUP 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: PSG (Product/Service Group) <b>  choice</b></li>
49                           * <li>2: LOC (Location Identification) <b>optional repeating choice</b></li>
50                           * <li>3: PRT (Participation Information) <b>optional repeating choice</b></li>
51                           * <li>4: ROL (Role) <b>optional repeating choice</b></li>
52                           * <li>5: EHC_E01_PATIENT_INFO (a Group object) <b>optional repeating </b></li>
53                           * <li>6: EHC_E01_PRODUCT_SERVICE_LINE_ITEM (a Group object) <b> repeating </b></li>
54                           * <li>7: EHC_E01_PROCEDURE (a Group object) <b>optional repeating </b></li>
55                           * <li>8: IPR (Invoice Processing Results) <b>optional repeating choice</b></li>
56   * </ul>
57   * <p>
58   * Note that this structure has "choice" elements. This means that one of the 
59   * structures above marked as "choice" must be present, but no more than one.
60   * </p> 
61   */
62  //@SuppressWarnings("unused")
63  public class EHC_E01_PRODUCT_SERVICE_GROUP extends AbstractGroup {
64  
65      /** 
66       * Creates a new EHC_E01_PRODUCT_SERVICE_GROUP group
67       */
68      public EHC_E01_PRODUCT_SERVICE_GROUP(Group parent, ModelClassFactory factory) {
69         super(parent, factory);
70         init(factory);
71      }
72  
73      private void init(ModelClassFactory factory) {
74         try {
75                                    this.add(PSG.class, true, false, true);
76                                    this.add(LOC.class, false, true, true);
77                                    this.add(PRT.class, false, true, true);
78                                    this.add(ROL.class, false, true, true);
79                                    this.add(EHC_E01_PATIENT_INFO.class, false, true, false);
80                                    this.add(EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class, true, true, false);
81                                    this.add(EHC_E01_PROCEDURE.class, false, true, false);
82                                    this.add(IPR.class, false, true, true);
83         } catch(HL7Exception e) {
84            log.error("Unexpected error creating EHC_E01_PRODUCT_SERVICE_GROUP - this is probably a bug in the source code generator.", e);
85         }
86      }
87  
88      /** 
89       * Returns "2.8"
90       */
91      public String getVersion() {
92         return "2.8";
93      }
94  
95  
96  
97      /**
98       * Returns
99       * PSG (Product/Service Group) - creates it if necessary
100      */
101     public PSG getPSG() { 
102        PSG retVal = getTyped("PSG", PSG.class);
103        return retVal;
104     }
105 
106 
107 
108 
109     /**
110      * Returns
111      * the first repetition of 
112      * LOC (Location Identification) - creates it if necessary
113      */
114     public LOC getLOC() { 
115        LOC retVal = getTyped("LOC", LOC.class);
116        return retVal;
117     }
118 
119 
120     /**
121      * Returns a specific repetition of
122      * LOC (Location Identification) - creates it if necessary
123      *
124      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
125      * @throws HL7Exception if the repetition requested is more than one 
126      *     greater than the number of existing repetitions.
127      */
128     public LOC getLOC(int rep) { 
129        LOC retVal = getTyped("LOC", rep, LOC.class);
130        return retVal;
131     }
132 
133     /** 
134      * Returns the number of existing repetitions of LOC 
135      */ 
136     public int getLOCReps() {  
137         return getReps("LOC");
138     } 
139 
140     /** 
141      * <p>
142      * Returns a non-modifiable List containing all current existing repetitions of LOC.
143      * <p>
144      * <p>
145      * Note that unlike {@link #getLOC()}, this method will not create any reps
146      * if none are already present, so an empty list may be returned.
147      * </p>
148      */ 
149     public java.util.List<LOC> getLOCAll() throws HL7Exception {
150     	return getAllAsList("LOC", LOC.class);
151     } 
152 
153     /**
154      * Inserts a specific repetition of LOC (Location Identification)
155      * @see AbstractGroup#insertRepetition(Structure, int) 
156      */
157     public void insertLOC(LOC structure, int rep) throws HL7Exception { 
158        super.insertRepetition("LOC", structure, rep);
159     }
160 
161 
162     /**
163      * Inserts a specific repetition of LOC (Location Identification)
164      * @see AbstractGroup#insertRepetition(Structure, int) 
165      */
166     public LOC insertLOC(int rep) throws HL7Exception { 
167        return (LOC)super.insertRepetition("LOC", rep);
168     }
169 
170 
171     /**
172      * Removes a specific repetition of LOC (Location Identification)
173      * @see AbstractGroup#removeRepetition(String, int) 
174      */
175     public LOC removeLOC(int rep) throws HL7Exception { 
176        return (LOC)super.removeRepetition("LOC", rep);
177     }
178 
179 
180 
181     /**
182      * Returns
183      * the first repetition of 
184      * PRT (Participation Information) - creates it if necessary
185      */
186     public PRT getPRT() { 
187        PRT retVal = getTyped("PRT", PRT.class);
188        return retVal;
189     }
190 
191 
192     /**
193      * Returns a specific repetition of
194      * PRT (Participation Information) - creates it if necessary
195      *
196      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
197      * @throws HL7Exception if the repetition requested is more than one 
198      *     greater than the number of existing repetitions.
199      */
200     public PRT getPRT(int rep) { 
201        PRT retVal = getTyped("PRT", rep, PRT.class);
202        return retVal;
203     }
204 
205     /** 
206      * Returns the number of existing repetitions of PRT 
207      */ 
208     public int getPRTReps() {  
209         return getReps("PRT");
210     } 
211 
212     /** 
213      * <p>
214      * Returns a non-modifiable List containing all current existing repetitions of PRT.
215      * <p>
216      * <p>
217      * Note that unlike {@link #getPRT()}, this method will not create any reps
218      * if none are already present, so an empty list may be returned.
219      * </p>
220      */ 
221     public java.util.List<PRT> getPRTAll() throws HL7Exception {
222     	return getAllAsList("PRT", PRT.class);
223     } 
224 
225     /**
226      * Inserts a specific repetition of PRT (Participation Information)
227      * @see AbstractGroup#insertRepetition(Structure, int) 
228      */
229     public void insertPRT(PRT structure, int rep) throws HL7Exception { 
230        super.insertRepetition("PRT", structure, rep);
231     }
232 
233 
234     /**
235      * Inserts a specific repetition of PRT (Participation Information)
236      * @see AbstractGroup#insertRepetition(Structure, int) 
237      */
238     public PRT insertPRT(int rep) throws HL7Exception { 
239        return (PRT)super.insertRepetition("PRT", rep);
240     }
241 
242 
243     /**
244      * Removes a specific repetition of PRT (Participation Information)
245      * @see AbstractGroup#removeRepetition(String, int) 
246      */
247     public PRT removePRT(int rep) throws HL7Exception { 
248        return (PRT)super.removeRepetition("PRT", rep);
249     }
250 
251 
252 
253     /**
254      * Returns
255      * the first repetition of 
256      * ROL (Role) - creates it if necessary
257      */
258     public ROL getROL() { 
259        ROL retVal = getTyped("ROL", ROL.class);
260        return retVal;
261     }
262 
263 
264     /**
265      * Returns a specific repetition of
266      * ROL (Role) - creates it if necessary
267      *
268      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
269      * @throws HL7Exception if the repetition requested is more than one 
270      *     greater than the number of existing repetitions.
271      */
272     public ROL getROL(int rep) { 
273        ROL retVal = getTyped("ROL", rep, ROL.class);
274        return retVal;
275     }
276 
277     /** 
278      * Returns the number of existing repetitions of ROL 
279      */ 
280     public int getROLReps() {  
281         return getReps("ROL");
282     } 
283 
284     /** 
285      * <p>
286      * Returns a non-modifiable List containing all current existing repetitions of ROL.
287      * <p>
288      * <p>
289      * Note that unlike {@link #getROL()}, this method will not create any reps
290      * if none are already present, so an empty list may be returned.
291      * </p>
292      */ 
293     public java.util.List<ROL> getROLAll() throws HL7Exception {
294     	return getAllAsList("ROL", ROL.class);
295     } 
296 
297     /**
298      * Inserts a specific repetition of ROL (Role)
299      * @see AbstractGroup#insertRepetition(Structure, int) 
300      */
301     public void insertROL(ROL structure, int rep) throws HL7Exception { 
302        super.insertRepetition("ROL", structure, rep);
303     }
304 
305 
306     /**
307      * Inserts a specific repetition of ROL (Role)
308      * @see AbstractGroup#insertRepetition(Structure, int) 
309      */
310     public ROL insertROL(int rep) throws HL7Exception { 
311        return (ROL)super.insertRepetition("ROL", rep);
312     }
313 
314 
315     /**
316      * Removes a specific repetition of ROL (Role)
317      * @see AbstractGroup#removeRepetition(String, int) 
318      */
319     public ROL removeROL(int rep) throws HL7Exception { 
320        return (ROL)super.removeRepetition("ROL", rep);
321     }
322 
323 
324 
325     /**
326      * Returns
327      * the first repetition of 
328      * PATIENT_INFO (a Group object) - creates it if necessary
329      */
330     public EHC_E01_PATIENT_INFO getPATIENT_INFO() { 
331        EHC_E01_PATIENT_INFO retVal = getTyped("PATIENT_INFO", EHC_E01_PATIENT_INFO.class);
332        return retVal;
333     }
334 
335 
336     /**
337      * Returns a specific repetition of
338      * PATIENT_INFO (a Group object) - creates it if necessary
339      *
340      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
341      * @throws HL7Exception if the repetition requested is more than one 
342      *     greater than the number of existing repetitions.
343      */
344     public EHC_E01_PATIENT_INFO getPATIENT_INFO(int rep) { 
345        EHC_E01_PATIENT_INFO retVal = getTyped("PATIENT_INFO", rep, EHC_E01_PATIENT_INFO.class);
346        return retVal;
347     }
348 
349     /** 
350      * Returns the number of existing repetitions of PATIENT_INFO 
351      */ 
352     public int getPATIENT_INFOReps() {  
353         return getReps("PATIENT_INFO");
354     } 
355 
356     /** 
357      * <p>
358      * Returns a non-modifiable List containing all current existing repetitions of PATIENT_INFO.
359      * <p>
360      * <p>
361      * Note that unlike {@link #getPATIENT_INFO()}, this method will not create any reps
362      * if none are already present, so an empty list may be returned.
363      * </p>
364      */ 
365     public java.util.List<EHC_E01_PATIENT_INFO> getPATIENT_INFOAll() throws HL7Exception {
366     	return getAllAsList("PATIENT_INFO", EHC_E01_PATIENT_INFO.class);
367     } 
368 
369     /**
370      * Inserts a specific repetition of PATIENT_INFO (a Group object)
371      * @see AbstractGroup#insertRepetition(Structure, int) 
372      */
373     public void insertPATIENT_INFO(EHC_E01_PATIENT_INFO structure, int rep) throws HL7Exception { 
374        super.insertRepetition("PATIENT_INFO", structure, rep);
375     }
376 
377 
378     /**
379      * Inserts a specific repetition of PATIENT_INFO (a Group object)
380      * @see AbstractGroup#insertRepetition(Structure, int) 
381      */
382     public EHC_E01_PATIENT_INFO insertPATIENT_INFO(int rep) throws HL7Exception { 
383        return (EHC_E01_PATIENT_INFO)super.insertRepetition("PATIENT_INFO", rep);
384     }
385 
386 
387     /**
388      * Removes a specific repetition of PATIENT_INFO (a Group object)
389      * @see AbstractGroup#removeRepetition(String, int) 
390      */
391     public EHC_E01_PATIENT_INFO removePATIENT_INFO(int rep) throws HL7Exception { 
392        return (EHC_E01_PATIENT_INFO)super.removeRepetition("PATIENT_INFO", rep);
393     }
394 
395 
396 
397     /**
398      * Returns
399      * the first repetition of 
400      * PRODUCT_SERVICE_LINE_ITEM (a Group object) - creates it if necessary
401      */
402     public EHC_E01_PRODUCT_SERVICE_LINE_ITEM getPRODUCT_SERVICE_LINE_ITEM() { 
403        EHC_E01_PRODUCT_SERVICE_LINE_ITEM retVal = getTyped("PRODUCT_SERVICE_LINE_ITEM", EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class);
404        return retVal;
405     }
406 
407 
408     /**
409      * Returns a specific repetition of
410      * PRODUCT_SERVICE_LINE_ITEM (a Group object) - creates it if necessary
411      *
412      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
413      * @throws HL7Exception if the repetition requested is more than one 
414      *     greater than the number of existing repetitions.
415      */
416     public EHC_E01_PRODUCT_SERVICE_LINE_ITEM getPRODUCT_SERVICE_LINE_ITEM(int rep) { 
417        EHC_E01_PRODUCT_SERVICE_LINE_ITEM retVal = getTyped("PRODUCT_SERVICE_LINE_ITEM", rep, EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class);
418        return retVal;
419     }
420 
421     /** 
422      * Returns the number of existing repetitions of PRODUCT_SERVICE_LINE_ITEM 
423      */ 
424     public int getPRODUCT_SERVICE_LINE_ITEMReps() {  
425         return getReps("PRODUCT_SERVICE_LINE_ITEM");
426     } 
427 
428     /** 
429      * <p>
430      * Returns a non-modifiable List containing all current existing repetitions of PRODUCT_SERVICE_LINE_ITEM.
431      * <p>
432      * <p>
433      * Note that unlike {@link #getPRODUCT_SERVICE_LINE_ITEM()}, this method will not create any reps
434      * if none are already present, so an empty list may be returned.
435      * </p>
436      */ 
437     public java.util.List<EHC_E01_PRODUCT_SERVICE_LINE_ITEM> getPRODUCT_SERVICE_LINE_ITEMAll() throws HL7Exception {
438     	return getAllAsList("PRODUCT_SERVICE_LINE_ITEM", EHC_E01_PRODUCT_SERVICE_LINE_ITEM.class);
439     } 
440 
441     /**
442      * Inserts a specific repetition of PRODUCT_SERVICE_LINE_ITEM (a Group object)
443      * @see AbstractGroup#insertRepetition(Structure, int) 
444      */
445     public void insertPRODUCT_SERVICE_LINE_ITEM(EHC_E01_PRODUCT_SERVICE_LINE_ITEM structure, int rep) throws HL7Exception { 
446        super.insertRepetition("PRODUCT_SERVICE_LINE_ITEM", structure, rep);
447     }
448 
449 
450     /**
451      * Inserts a specific repetition of PRODUCT_SERVICE_LINE_ITEM (a Group object)
452      * @see AbstractGroup#insertRepetition(Structure, int) 
453      */
454     public EHC_E01_PRODUCT_SERVICE_LINE_ITEM insertPRODUCT_SERVICE_LINE_ITEM(int rep) throws HL7Exception { 
455        return (EHC_E01_PRODUCT_SERVICE_LINE_ITEM)super.insertRepetition("PRODUCT_SERVICE_LINE_ITEM", rep);
456     }
457 
458 
459     /**
460      * Removes a specific repetition of PRODUCT_SERVICE_LINE_ITEM (a Group object)
461      * @see AbstractGroup#removeRepetition(String, int) 
462      */
463     public EHC_E01_PRODUCT_SERVICE_LINE_ITEM removePRODUCT_SERVICE_LINE_ITEM(int rep) throws HL7Exception { 
464        return (EHC_E01_PRODUCT_SERVICE_LINE_ITEM)super.removeRepetition("PRODUCT_SERVICE_LINE_ITEM", rep);
465     }
466 
467 
468 
469     /**
470      * Returns
471      * the first repetition of 
472      * PROCEDURE (a Group object) - creates it if necessary
473      */
474     public EHC_E01_PROCEDURE getPROCEDURE() { 
475        EHC_E01_PROCEDURE retVal = getTyped("PROCEDURE", EHC_E01_PROCEDURE.class);
476        return retVal;
477     }
478 
479 
480     /**
481      * Returns a specific repetition of
482      * PROCEDURE (a Group object) - creates it if necessary
483      *
484      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
485      * @throws HL7Exception if the repetition requested is more than one 
486      *     greater than the number of existing repetitions.
487      */
488     public EHC_E01_PROCEDURE getPROCEDURE(int rep) { 
489        EHC_E01_PROCEDURE retVal = getTyped("PROCEDURE", rep, EHC_E01_PROCEDURE.class);
490        return retVal;
491     }
492 
493     /** 
494      * Returns the number of existing repetitions of PROCEDURE 
495      */ 
496     public int getPROCEDUREReps() {  
497         return getReps("PROCEDURE");
498     } 
499 
500     /** 
501      * <p>
502      * Returns a non-modifiable List containing all current existing repetitions of PROCEDURE.
503      * <p>
504      * <p>
505      * Note that unlike {@link #getPROCEDURE()}, this method will not create any reps
506      * if none are already present, so an empty list may be returned.
507      * </p>
508      */ 
509     public java.util.List<EHC_E01_PROCEDURE> getPROCEDUREAll() throws HL7Exception {
510     	return getAllAsList("PROCEDURE", EHC_E01_PROCEDURE.class);
511     } 
512 
513     /**
514      * Inserts a specific repetition of PROCEDURE (a Group object)
515      * @see AbstractGroup#insertRepetition(Structure, int) 
516      */
517     public void insertPROCEDURE(EHC_E01_PROCEDURE structure, int rep) throws HL7Exception { 
518        super.insertRepetition("PROCEDURE", structure, rep);
519     }
520 
521 
522     /**
523      * Inserts a specific repetition of PROCEDURE (a Group object)
524      * @see AbstractGroup#insertRepetition(Structure, int) 
525      */
526     public EHC_E01_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception { 
527        return (EHC_E01_PROCEDURE)super.insertRepetition("PROCEDURE", rep);
528     }
529 
530 
531     /**
532      * Removes a specific repetition of PROCEDURE (a Group object)
533      * @see AbstractGroup#removeRepetition(String, int) 
534      */
535     public EHC_E01_PROCEDURE removePROCEDURE(int rep) throws HL7Exception { 
536        return (EHC_E01_PROCEDURE)super.removeRepetition("PROCEDURE", rep);
537     }
538 
539 
540 
541     /**
542      * Returns
543      * the first repetition of 
544      * IPR (Invoice Processing Results) - creates it if necessary
545      */
546     public IPR getIPR() { 
547        IPR retVal = getTyped("IPR", IPR.class);
548        return retVal;
549     }
550 
551 
552     /**
553      * Returns a specific repetition of
554      * IPR (Invoice Processing Results) - creates it if necessary
555      *
556      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
557      * @throws HL7Exception if the repetition requested is more than one 
558      *     greater than the number of existing repetitions.
559      */
560     public IPR getIPR(int rep) { 
561        IPR retVal = getTyped("IPR", rep, IPR.class);
562        return retVal;
563     }
564 
565     /** 
566      * Returns the number of existing repetitions of IPR 
567      */ 
568     public int getIPRReps() {  
569         return getReps("IPR");
570     } 
571 
572     /** 
573      * <p>
574      * Returns a non-modifiable List containing all current existing repetitions of IPR.
575      * <p>
576      * <p>
577      * Note that unlike {@link #getIPR()}, this method will not create any reps
578      * if none are already present, so an empty list may be returned.
579      * </p>
580      */ 
581     public java.util.List<IPR> getIPRAll() throws HL7Exception {
582     	return getAllAsList("IPR", IPR.class);
583     } 
584 
585     /**
586      * Inserts a specific repetition of IPR (Invoice Processing Results)
587      * @see AbstractGroup#insertRepetition(Structure, int) 
588      */
589     public void insertIPR(IPR structure, int rep) throws HL7Exception { 
590        super.insertRepetition("IPR", structure, rep);
591     }
592 
593 
594     /**
595      * Inserts a specific repetition of IPR (Invoice Processing Results)
596      * @see AbstractGroup#insertRepetition(Structure, int) 
597      */
598     public IPR insertIPR(int rep) throws HL7Exception { 
599        return (IPR)super.insertRepetition("IPR", rep);
600     }
601 
602 
603     /**
604      * Removes a specific repetition of IPR (Invoice Processing Results)
605      * @see AbstractGroup#removeRepetition(String, int) 
606      */
607     public IPR removeIPR(int rep) throws HL7Exception { 
608        return (IPR)super.removeRepetition("IPR", rep);
609     }
610 
611 
612 
613 }
614