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.message;
035
036import ca.uhn.hl7v2.model.v26.group.*;
037import ca.uhn.hl7v2.model.v26.segment.*;
038
039import java.util.List;
040
041import ca.uhn.hl7v2.HL7Exception;
042import ca.uhn.hl7v2.parser.ModelClassFactory;
043import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
044import ca.uhn.hl7v2.model.AbstractMessage;
045
046/**
047 * <p>Represents a EHC_E20 message structure (see chapter 16.3.10). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (Message Header) <b> </b></li>
051                 * <li>2: SFT (Software Segment) <b>optional repeating</b></li>
052                 * <li>3: UAC (User Authentication Credential Segment) <b>optional repeating</b></li>
053                 * <li>4: IVC (Invoice Segment) <b> </b></li>
054                 * <li>5: CTD (Contact Data) <b> repeating</b></li>
055                 * <li>6: LOC (Location Identification) <b>optional repeating</b></li>
056                 * <li>7: ROL (Role) <b>optional repeating</b></li>
057                 * <li>8: EHC_E20_PAT_INFO (a Group object) <b> repeating</b></li>
058                 * <li>9: EHC_E20_PSL_ITEM_INFO (a Group object) <b> repeating</b></li>
059 * </ul>
060 */
061@SuppressWarnings("unused")
062public class EHC_E20 extends AbstractMessage  {
063
064    /**
065     * Creates a new EHC_E20 message with DefaultModelClassFactory. 
066     */ 
067    public EHC_E20() { 
068       this(new DefaultModelClassFactory());
069    }
070
071    /** 
072     * Creates a new EHC_E20 message with custom ModelClassFactory.
073     */
074    public EHC_E20(ModelClassFactory factory) {
075       super(factory);
076       init(factory);
077    }
078
079    private void init(ModelClassFactory factory) {
080       try {
081                          this.add(MSH.class, true, false);
082                          this.add(SFT.class, false, true);
083                          this.add(UAC.class, false, true);
084                          this.add(IVC.class, true, false);
085                          this.add(CTD.class, true, true);
086                          this.add(LOC.class, false, true);
087                          this.add(ROL.class, false, true);
088                          this.add(EHC_E20_PAT_INFO.class, true, true);
089                          this.add(EHC_E20_PSL_ITEM_INFO.class, true, true);
090       } catch(HL7Exception e) {
091          log.error("Unexpected error creating EHC_E20 - this is probably a bug in the source code generator.", e);
092       }
093    }
094
095    /** 
096     * Returns "2.6"
097     */
098    public String getVersion() {
099       return "2.6";
100    }
101
102
103
104    /**
105     * Returns
106     * MSH (Message Header) - creates it if necessary
107     */
108    public MSH getMSH() { 
109       return getTyped("MSH", MSH.class);
110    }
111
112
113
114
115    /**
116     * Returns
117     * the first repetition of 
118     * SFT (Software Segment) - creates it if necessary
119     */
120    public SFT getSFT() { 
121       return getTyped("SFT", SFT.class);
122    }
123
124
125    /**
126     * Returns a specific repetition of
127     * SFT (Software Segment) - creates it if necessary
128     *
129     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
130     * @throws HL7Exception if the repetition requested is more than one 
131     *     greater than the number of existing repetitions.
132     */
133    public SFT getSFT(int rep) { 
134       return getTyped("SFT", rep, SFT.class);
135    }
136
137    /** 
138     * Returns the number of existing repetitions of SFT 
139     */ 
140    public int getSFTReps() { 
141        return getReps("SFT");
142    } 
143
144    /** 
145     * <p>
146     * Returns a non-modifiable List containing all current existing repetitions of SFT.
147     * <p>
148     * <p>
149     * Note that unlike {@link #getSFT()}, this method will not create any reps
150     * if none are already present, so an empty list may be returned.
151     * </p>
152     */ 
153    public List<SFT> getSFTAll() throws HL7Exception {
154        return getAllAsList("SFT", SFT.class);
155    } 
156
157    /**
158     * Inserts a specific repetition of SFT (Software Segment)
159     * @see AbstractGroup#insertRepetition(Structure, int) 
160     */
161    public void insertSFT(SFT structure, int rep) throws HL7Exception { 
162       super.insertRepetition( "SFT", structure, rep);
163    }
164
165
166    /**
167     * Inserts a specific repetition of SFT (Software Segment)
168     * @see AbstractGroup#insertRepetition(Structure, int) 
169     */
170    public SFT insertSFT(int rep) throws HL7Exception { 
171       return (SFT)super.insertRepetition("SFT", rep);
172    }
173
174
175    /**
176     * Removes a specific repetition of SFT (Software Segment)
177     * @see AbstractGroup#removeRepetition(String, int) 
178     */
179    public SFT removeSFT(int rep) throws HL7Exception { 
180       return (SFT)super.removeRepetition("SFT", rep);
181    }
182
183
184
185    /**
186     * Returns
187     * the first repetition of 
188     * UAC (User Authentication Credential Segment) - creates it if necessary
189     */
190    public UAC getUAC() { 
191       return getTyped("UAC", UAC.class);
192    }
193
194
195    /**
196     * Returns a specific repetition of
197     * UAC (User Authentication Credential Segment) - creates it if necessary
198     *
199     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
200     * @throws HL7Exception if the repetition requested is more than one 
201     *     greater than the number of existing repetitions.
202     */
203    public UAC getUAC(int rep) { 
204       return getTyped("UAC", rep, UAC.class);
205    }
206
207    /** 
208     * Returns the number of existing repetitions of UAC 
209     */ 
210    public int getUACReps() { 
211        return getReps("UAC");
212    } 
213
214    /** 
215     * <p>
216     * Returns a non-modifiable List containing all current existing repetitions of UAC.
217     * <p>
218     * <p>
219     * Note that unlike {@link #getUAC()}, this method will not create any reps
220     * if none are already present, so an empty list may be returned.
221     * </p>
222     */ 
223    public List<UAC> getUACAll() throws HL7Exception {
224        return getAllAsList("UAC", UAC.class);
225    } 
226
227    /**
228     * Inserts a specific repetition of UAC (User Authentication Credential Segment)
229     * @see AbstractGroup#insertRepetition(Structure, int) 
230     */
231    public void insertUAC(UAC structure, int rep) throws HL7Exception { 
232       super.insertRepetition( "UAC", structure, rep);
233    }
234
235
236    /**
237     * Inserts a specific repetition of UAC (User Authentication Credential Segment)
238     * @see AbstractGroup#insertRepetition(Structure, int) 
239     */
240    public UAC insertUAC(int rep) throws HL7Exception { 
241       return (UAC)super.insertRepetition("UAC", rep);
242    }
243
244
245    /**
246     * Removes a specific repetition of UAC (User Authentication Credential Segment)
247     * @see AbstractGroup#removeRepetition(String, int) 
248     */
249    public UAC removeUAC(int rep) throws HL7Exception { 
250       return (UAC)super.removeRepetition("UAC", rep);
251    }
252
253
254
255    /**
256     * Returns
257     * IVC (Invoice Segment) - creates it if necessary
258     */
259    public IVC getIVC() { 
260       return getTyped("IVC", IVC.class);
261    }
262
263
264
265
266    /**
267     * Returns
268     * the first repetition of 
269     * CTD (Contact Data) - creates it if necessary
270     */
271    public CTD getCTD() { 
272       return getTyped("CTD", CTD.class);
273    }
274
275
276    /**
277     * Returns a specific repetition of
278     * CTD (Contact Data) - creates it if necessary
279     *
280     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
281     * @throws HL7Exception if the repetition requested is more than one 
282     *     greater than the number of existing repetitions.
283     */
284    public CTD getCTD(int rep) { 
285       return getTyped("CTD", rep, CTD.class);
286    }
287
288    /** 
289     * Returns the number of existing repetitions of CTD 
290     */ 
291    public int getCTDReps() { 
292        return getReps("CTD");
293    } 
294
295    /** 
296     * <p>
297     * Returns a non-modifiable List containing all current existing repetitions of CTD.
298     * <p>
299     * <p>
300     * Note that unlike {@link #getCTD()}, this method will not create any reps
301     * if none are already present, so an empty list may be returned.
302     * </p>
303     */ 
304    public List<CTD> getCTDAll() throws HL7Exception {
305        return getAllAsList("CTD", CTD.class);
306    } 
307
308    /**
309     * Inserts a specific repetition of CTD (Contact Data)
310     * @see AbstractGroup#insertRepetition(Structure, int) 
311     */
312    public void insertCTD(CTD structure, int rep) throws HL7Exception { 
313       super.insertRepetition( "CTD", structure, rep);
314    }
315
316
317    /**
318     * Inserts a specific repetition of CTD (Contact Data)
319     * @see AbstractGroup#insertRepetition(Structure, int) 
320     */
321    public CTD insertCTD(int rep) throws HL7Exception { 
322       return (CTD)super.insertRepetition("CTD", rep);
323    }
324
325
326    /**
327     * Removes a specific repetition of CTD (Contact Data)
328     * @see AbstractGroup#removeRepetition(String, int) 
329     */
330    public CTD removeCTD(int rep) throws HL7Exception { 
331       return (CTD)super.removeRepetition("CTD", rep);
332    }
333
334
335
336    /**
337     * Returns
338     * the first repetition of 
339     * LOC (Location Identification) - creates it if necessary
340     */
341    public LOC getLOC() { 
342       return getTyped("LOC", LOC.class);
343    }
344
345
346    /**
347     * Returns a specific repetition of
348     * LOC (Location Identification) - 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 LOC getLOC(int rep) { 
355       return getTyped("LOC", rep, LOC.class);
356    }
357
358    /** 
359     * Returns the number of existing repetitions of LOC 
360     */ 
361    public int getLOCReps() { 
362        return getReps("LOC");
363    } 
364
365    /** 
366     * <p>
367     * Returns a non-modifiable List containing all current existing repetitions of LOC.
368     * <p>
369     * <p>
370     * Note that unlike {@link #getLOC()}, this method will not create any reps
371     * if none are already present, so an empty list may be returned.
372     * </p>
373     */ 
374    public List<LOC> getLOCAll() throws HL7Exception {
375        return getAllAsList("LOC", LOC.class);
376    } 
377
378    /**
379     * Inserts a specific repetition of LOC (Location Identification)
380     * @see AbstractGroup#insertRepetition(Structure, int) 
381     */
382    public void insertLOC(LOC structure, int rep) throws HL7Exception { 
383       super.insertRepetition( "LOC", structure, rep);
384    }
385
386
387    /**
388     * Inserts a specific repetition of LOC (Location Identification)
389     * @see AbstractGroup#insertRepetition(Structure, int) 
390     */
391    public LOC insertLOC(int rep) throws HL7Exception { 
392       return (LOC)super.insertRepetition("LOC", rep);
393    }
394
395
396    /**
397     * Removes a specific repetition of LOC (Location Identification)
398     * @see AbstractGroup#removeRepetition(String, int) 
399     */
400    public LOC removeLOC(int rep) throws HL7Exception { 
401       return (LOC)super.removeRepetition("LOC", rep);
402    }
403
404
405
406    /**
407     * Returns
408     * the first repetition of 
409     * ROL (Role) - creates it if necessary
410     */
411    public ROL getROL() { 
412       return getTyped("ROL", ROL.class);
413    }
414
415
416    /**
417     * Returns a specific repetition of
418     * ROL (Role) - creates it if necessary
419     *
420     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
421     * @throws HL7Exception if the repetition requested is more than one 
422     *     greater than the number of existing repetitions.
423     */
424    public ROL getROL(int rep) { 
425       return getTyped("ROL", rep, ROL.class);
426    }
427
428    /** 
429     * Returns the number of existing repetitions of ROL 
430     */ 
431    public int getROLReps() { 
432        return getReps("ROL");
433    } 
434
435    /** 
436     * <p>
437     * Returns a non-modifiable List containing all current existing repetitions of ROL.
438     * <p>
439     * <p>
440     * Note that unlike {@link #getROL()}, this method will not create any reps
441     * if none are already present, so an empty list may be returned.
442     * </p>
443     */ 
444    public List<ROL> getROLAll() throws HL7Exception {
445        return getAllAsList("ROL", ROL.class);
446    } 
447
448    /**
449     * Inserts a specific repetition of ROL (Role)
450     * @see AbstractGroup#insertRepetition(Structure, int) 
451     */
452    public void insertROL(ROL structure, int rep) throws HL7Exception { 
453       super.insertRepetition( "ROL", structure, rep);
454    }
455
456
457    /**
458     * Inserts a specific repetition of ROL (Role)
459     * @see AbstractGroup#insertRepetition(Structure, int) 
460     */
461    public ROL insertROL(int rep) throws HL7Exception { 
462       return (ROL)super.insertRepetition("ROL", rep);
463    }
464
465
466    /**
467     * Removes a specific repetition of ROL (Role)
468     * @see AbstractGroup#removeRepetition(String, int) 
469     */
470    public ROL removeROL(int rep) throws HL7Exception { 
471       return (ROL)super.removeRepetition("ROL", rep);
472    }
473
474
475
476    /**
477     * Returns
478     * the first repetition of 
479     * PAT_INFO (a Group object) - creates it if necessary
480     */
481    public EHC_E20_PAT_INFO getPAT_INFO() { 
482       return getTyped("PAT_INFO", EHC_E20_PAT_INFO.class);
483    }
484
485
486    /**
487     * Returns a specific repetition of
488     * PAT_INFO (a Group object) - creates it if necessary
489     *
490     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
491     * @throws HL7Exception if the repetition requested is more than one 
492     *     greater than the number of existing repetitions.
493     */
494    public EHC_E20_PAT_INFO getPAT_INFO(int rep) { 
495       return getTyped("PAT_INFO", rep, EHC_E20_PAT_INFO.class);
496    }
497
498    /** 
499     * Returns the number of existing repetitions of PAT_INFO 
500     */ 
501    public int getPAT_INFOReps() { 
502        return getReps("PAT_INFO");
503    } 
504
505    /** 
506     * <p>
507     * Returns a non-modifiable List containing all current existing repetitions of PAT_INFO.
508     * <p>
509     * <p>
510     * Note that unlike {@link #getPAT_INFO()}, this method will not create any reps
511     * if none are already present, so an empty list may be returned.
512     * </p>
513     */ 
514    public List<EHC_E20_PAT_INFO> getPAT_INFOAll() throws HL7Exception {
515        return getAllAsList("PAT_INFO", EHC_E20_PAT_INFO.class);
516    } 
517
518    /**
519     * Inserts a specific repetition of PAT_INFO (a Group object)
520     * @see AbstractGroup#insertRepetition(Structure, int) 
521     */
522    public void insertPAT_INFO(EHC_E20_PAT_INFO structure, int rep) throws HL7Exception { 
523       super.insertRepetition( "PAT_INFO", structure, rep);
524    }
525
526
527    /**
528     * Inserts a specific repetition of PAT_INFO (a Group object)
529     * @see AbstractGroup#insertRepetition(Structure, int) 
530     */
531    public EHC_E20_PAT_INFO insertPAT_INFO(int rep) throws HL7Exception { 
532       return (EHC_E20_PAT_INFO)super.insertRepetition("PAT_INFO", rep);
533    }
534
535
536    /**
537     * Removes a specific repetition of PAT_INFO (a Group object)
538     * @see AbstractGroup#removeRepetition(String, int) 
539     */
540    public EHC_E20_PAT_INFO removePAT_INFO(int rep) throws HL7Exception { 
541       return (EHC_E20_PAT_INFO)super.removeRepetition("PAT_INFO", rep);
542    }
543
544
545
546    /**
547     * Returns
548     * the first repetition of 
549     * PSL_ITEM_INFO (a Group object) - creates it if necessary
550     */
551    public EHC_E20_PSL_ITEM_INFO getPSL_ITEM_INFO() { 
552       return getTyped("PSL_ITEM_INFO", EHC_E20_PSL_ITEM_INFO.class);
553    }
554
555
556    /**
557     * Returns a specific repetition of
558     * PSL_ITEM_INFO (a Group object) - creates it if necessary
559     *
560     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
561     * @throws HL7Exception if the repetition requested is more than one 
562     *     greater than the number of existing repetitions.
563     */
564    public EHC_E20_PSL_ITEM_INFO getPSL_ITEM_INFO(int rep) { 
565       return getTyped("PSL_ITEM_INFO", rep, EHC_E20_PSL_ITEM_INFO.class);
566    }
567
568    /** 
569     * Returns the number of existing repetitions of PSL_ITEM_INFO 
570     */ 
571    public int getPSL_ITEM_INFOReps() { 
572        return getReps("PSL_ITEM_INFO");
573    } 
574
575    /** 
576     * <p>
577     * Returns a non-modifiable List containing all current existing repetitions of PSL_ITEM_INFO.
578     * <p>
579     * <p>
580     * Note that unlike {@link #getPSL_ITEM_INFO()}, this method will not create any reps
581     * if none are already present, so an empty list may be returned.
582     * </p>
583     */ 
584    public List<EHC_E20_PSL_ITEM_INFO> getPSL_ITEM_INFOAll() throws HL7Exception {
585        return getAllAsList("PSL_ITEM_INFO", EHC_E20_PSL_ITEM_INFO.class);
586    } 
587
588    /**
589     * Inserts a specific repetition of PSL_ITEM_INFO (a Group object)
590     * @see AbstractGroup#insertRepetition(Structure, int) 
591     */
592    public void insertPSL_ITEM_INFO(EHC_E20_PSL_ITEM_INFO structure, int rep) throws HL7Exception { 
593       super.insertRepetition( "PSL_ITEM_INFO", structure, rep);
594    }
595
596
597    /**
598     * Inserts a specific repetition of PSL_ITEM_INFO (a Group object)
599     * @see AbstractGroup#insertRepetition(Structure, int) 
600     */
601    public EHC_E20_PSL_ITEM_INFO insertPSL_ITEM_INFO(int rep) throws HL7Exception { 
602       return (EHC_E20_PSL_ITEM_INFO)super.insertRepetition("PSL_ITEM_INFO", rep);
603    }
604
605
606    /**
607     * Removes a specific repetition of PSL_ITEM_INFO (a Group object)
608     * @see AbstractGroup#removeRepetition(String, int) 
609     */
610    public EHC_E20_PSL_ITEM_INFO removePSL_ITEM_INFO(int rep) throws HL7Exception { 
611       return (EHC_E20_PSL_ITEM_INFO)super.removeRepetition("PSL_ITEM_INFO", rep);
612    }
613
614
615
616}
617