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_E12 message structure (see chapter 16.3.7). 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: RFI (Request for Information) <b> </b></li>
054                 * <li>5: CTD (Contact Data) <b>optional repeating</b></li>
055                 * <li>6: IVC (Invoice Segment) <b> </b></li>
056                 * <li>7: PSS (Product/Service Section) <b> </b></li>
057                 * <li>8: PSG (Product/Service Group) <b> </b></li>
058                 * <li>9: PID (Patient Identification) <b>optional </b></li>
059                 * <li>10: PSL (Product/Service Line Item) <b>optional repeating</b></li>
060                 * <li>11: EHC_E12_REQUEST (a Group object) <b> repeating</b></li>
061 * </ul>
062 */
063@SuppressWarnings("unused")
064public class EHC_E12 extends AbstractMessage  {
065
066    /**
067     * Creates a new EHC_E12 message with DefaultModelClassFactory. 
068     */ 
069    public EHC_E12() { 
070       this(new DefaultModelClassFactory());
071    }
072
073    /** 
074     * Creates a new EHC_E12 message with custom ModelClassFactory.
075     */
076    public EHC_E12(ModelClassFactory factory) {
077       super(factory);
078       init(factory);
079    }
080
081    private void init(ModelClassFactory factory) {
082       try {
083                          this.add(MSH.class, true, false);
084                          this.add(SFT.class, false, true);
085                          this.add(UAC.class, false, true);
086                          this.add(RFI.class, true, false);
087                          this.add(CTD.class, false, true);
088                          this.add(IVC.class, true, false);
089                          this.add(PSS.class, true, false);
090                          this.add(PSG.class, true, false);
091                          this.add(PID.class, false, false);
092                          this.add(PSL.class, false, true);
093                          this.add(EHC_E12_REQUEST.class, true, true);
094       } catch(HL7Exception e) {
095          log.error("Unexpected error creating EHC_E12 - this is probably a bug in the source code generator.", e);
096       }
097    }
098
099    /** 
100     * Returns "2.6"
101     */
102    public String getVersion() {
103       return "2.6";
104    }
105
106
107
108    /**
109     * Returns
110     * MSH (Message Header) - creates it if necessary
111     */
112    public MSH getMSH() { 
113       return getTyped("MSH", MSH.class);
114    }
115
116
117
118
119    /**
120     * Returns
121     * the first repetition of 
122     * SFT (Software Segment) - creates it if necessary
123     */
124    public SFT getSFT() { 
125       return getTyped("SFT", SFT.class);
126    }
127
128
129    /**
130     * Returns a specific repetition of
131     * SFT (Software Segment) - creates it if necessary
132     *
133     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
134     * @throws HL7Exception if the repetition requested is more than one 
135     *     greater than the number of existing repetitions.
136     */
137    public SFT getSFT(int rep) { 
138       return getTyped("SFT", rep, SFT.class);
139    }
140
141    /** 
142     * Returns the number of existing repetitions of SFT 
143     */ 
144    public int getSFTReps() { 
145        return getReps("SFT");
146    } 
147
148    /** 
149     * <p>
150     * Returns a non-modifiable List containing all current existing repetitions of SFT.
151     * <p>
152     * <p>
153     * Note that unlike {@link #getSFT()}, this method will not create any reps
154     * if none are already present, so an empty list may be returned.
155     * </p>
156     */ 
157    public List<SFT> getSFTAll() throws HL7Exception {
158        return getAllAsList("SFT", SFT.class);
159    } 
160
161    /**
162     * Inserts a specific repetition of SFT (Software Segment)
163     * @see AbstractGroup#insertRepetition(Structure, int) 
164     */
165    public void insertSFT(SFT structure, int rep) throws HL7Exception { 
166       super.insertRepetition( "SFT", structure, rep);
167    }
168
169
170    /**
171     * Inserts a specific repetition of SFT (Software Segment)
172     * @see AbstractGroup#insertRepetition(Structure, int) 
173     */
174    public SFT insertSFT(int rep) throws HL7Exception { 
175       return (SFT)super.insertRepetition("SFT", rep);
176    }
177
178
179    /**
180     * Removes a specific repetition of SFT (Software Segment)
181     * @see AbstractGroup#removeRepetition(String, int) 
182     */
183    public SFT removeSFT(int rep) throws HL7Exception { 
184       return (SFT)super.removeRepetition("SFT", rep);
185    }
186
187
188
189    /**
190     * Returns
191     * the first repetition of 
192     * UAC (User Authentication Credential Segment) - creates it if necessary
193     */
194    public UAC getUAC() { 
195       return getTyped("UAC", UAC.class);
196    }
197
198
199    /**
200     * Returns a specific repetition of
201     * UAC (User Authentication Credential Segment) - creates it if necessary
202     *
203     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
204     * @throws HL7Exception if the repetition requested is more than one 
205     *     greater than the number of existing repetitions.
206     */
207    public UAC getUAC(int rep) { 
208       return getTyped("UAC", rep, UAC.class);
209    }
210
211    /** 
212     * Returns the number of existing repetitions of UAC 
213     */ 
214    public int getUACReps() { 
215        return getReps("UAC");
216    } 
217
218    /** 
219     * <p>
220     * Returns a non-modifiable List containing all current existing repetitions of UAC.
221     * <p>
222     * <p>
223     * Note that unlike {@link #getUAC()}, this method will not create any reps
224     * if none are already present, so an empty list may be returned.
225     * </p>
226     */ 
227    public List<UAC> getUACAll() throws HL7Exception {
228        return getAllAsList("UAC", UAC.class);
229    } 
230
231    /**
232     * Inserts a specific repetition of UAC (User Authentication Credential Segment)
233     * @see AbstractGroup#insertRepetition(Structure, int) 
234     */
235    public void insertUAC(UAC structure, int rep) throws HL7Exception { 
236       super.insertRepetition( "UAC", structure, rep);
237    }
238
239
240    /**
241     * Inserts a specific repetition of UAC (User Authentication Credential Segment)
242     * @see AbstractGroup#insertRepetition(Structure, int) 
243     */
244    public UAC insertUAC(int rep) throws HL7Exception { 
245       return (UAC)super.insertRepetition("UAC", rep);
246    }
247
248
249    /**
250     * Removes a specific repetition of UAC (User Authentication Credential Segment)
251     * @see AbstractGroup#removeRepetition(String, int) 
252     */
253    public UAC removeUAC(int rep) throws HL7Exception { 
254       return (UAC)super.removeRepetition("UAC", rep);
255    }
256
257
258
259    /**
260     * Returns
261     * RFI (Request for Information) - creates it if necessary
262     */
263    public RFI getRFI() { 
264       return getTyped("RFI", RFI.class);
265    }
266
267
268
269
270    /**
271     * Returns
272     * the first repetition of 
273     * CTD (Contact Data) - creates it if necessary
274     */
275    public CTD getCTD() { 
276       return getTyped("CTD", CTD.class);
277    }
278
279
280    /**
281     * Returns a specific repetition of
282     * CTD (Contact Data) - creates it if necessary
283     *
284     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
285     * @throws HL7Exception if the repetition requested is more than one 
286     *     greater than the number of existing repetitions.
287     */
288    public CTD getCTD(int rep) { 
289       return getTyped("CTD", rep, CTD.class);
290    }
291
292    /** 
293     * Returns the number of existing repetitions of CTD 
294     */ 
295    public int getCTDReps() { 
296        return getReps("CTD");
297    } 
298
299    /** 
300     * <p>
301     * Returns a non-modifiable List containing all current existing repetitions of CTD.
302     * <p>
303     * <p>
304     * Note that unlike {@link #getCTD()}, this method will not create any reps
305     * if none are already present, so an empty list may be returned.
306     * </p>
307     */ 
308    public List<CTD> getCTDAll() throws HL7Exception {
309        return getAllAsList("CTD", CTD.class);
310    } 
311
312    /**
313     * Inserts a specific repetition of CTD (Contact Data)
314     * @see AbstractGroup#insertRepetition(Structure, int) 
315     */
316    public void insertCTD(CTD structure, int rep) throws HL7Exception { 
317       super.insertRepetition( "CTD", structure, rep);
318    }
319
320
321    /**
322     * Inserts a specific repetition of CTD (Contact Data)
323     * @see AbstractGroup#insertRepetition(Structure, int) 
324     */
325    public CTD insertCTD(int rep) throws HL7Exception { 
326       return (CTD)super.insertRepetition("CTD", rep);
327    }
328
329
330    /**
331     * Removes a specific repetition of CTD (Contact Data)
332     * @see AbstractGroup#removeRepetition(String, int) 
333     */
334    public CTD removeCTD(int rep) throws HL7Exception { 
335       return (CTD)super.removeRepetition("CTD", rep);
336    }
337
338
339
340    /**
341     * Returns
342     * IVC (Invoice Segment) - creates it if necessary
343     */
344    public IVC getIVC() { 
345       return getTyped("IVC", IVC.class);
346    }
347
348
349
350
351    /**
352     * Returns
353     * PSS (Product/Service Section) - creates it if necessary
354     */
355    public PSS getPSS() { 
356       return getTyped("PSS", PSS.class);
357    }
358
359
360
361
362    /**
363     * Returns
364     * PSG (Product/Service Group) - creates it if necessary
365     */
366    public PSG getPSG() { 
367       return getTyped("PSG", PSG.class);
368    }
369
370
371
372
373    /**
374     * Returns
375     * PID (Patient Identification) - creates it if necessary
376     */
377    public PID getPID() { 
378       return getTyped("PID", PID.class);
379    }
380
381
382
383
384    /**
385     * Returns
386     * the first repetition of 
387     * PSL (Product/Service Line Item) - creates it if necessary
388     */
389    public PSL getPSL() { 
390       return getTyped("PSL", PSL.class);
391    }
392
393
394    /**
395     * Returns a specific repetition of
396     * PSL (Product/Service Line Item) - creates it if necessary
397     *
398     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
399     * @throws HL7Exception if the repetition requested is more than one 
400     *     greater than the number of existing repetitions.
401     */
402    public PSL getPSL(int rep) { 
403       return getTyped("PSL", rep, PSL.class);
404    }
405
406    /** 
407     * Returns the number of existing repetitions of PSL 
408     */ 
409    public int getPSLReps() { 
410        return getReps("PSL");
411    } 
412
413    /** 
414     * <p>
415     * Returns a non-modifiable List containing all current existing repetitions of PSL.
416     * <p>
417     * <p>
418     * Note that unlike {@link #getPSL()}, this method will not create any reps
419     * if none are already present, so an empty list may be returned.
420     * </p>
421     */ 
422    public List<PSL> getPSLAll() throws HL7Exception {
423        return getAllAsList("PSL", PSL.class);
424    } 
425
426    /**
427     * Inserts a specific repetition of PSL (Product/Service Line Item)
428     * @see AbstractGroup#insertRepetition(Structure, int) 
429     */
430    public void insertPSL(PSL structure, int rep) throws HL7Exception { 
431       super.insertRepetition( "PSL", structure, rep);
432    }
433
434
435    /**
436     * Inserts a specific repetition of PSL (Product/Service Line Item)
437     * @see AbstractGroup#insertRepetition(Structure, int) 
438     */
439    public PSL insertPSL(int rep) throws HL7Exception { 
440       return (PSL)super.insertRepetition("PSL", rep);
441    }
442
443
444    /**
445     * Removes a specific repetition of PSL (Product/Service Line Item)
446     * @see AbstractGroup#removeRepetition(String, int) 
447     */
448    public PSL removePSL(int rep) throws HL7Exception { 
449       return (PSL)super.removeRepetition("PSL", rep);
450    }
451
452
453
454    /**
455     * Returns
456     * the first repetition of 
457     * REQUEST (a Group object) - creates it if necessary
458     */
459    public EHC_E12_REQUEST getREQUEST() { 
460       return getTyped("REQUEST", EHC_E12_REQUEST.class);
461    }
462
463
464    /**
465     * Returns a specific repetition of
466     * REQUEST (a Group object) - creates it if necessary
467     *
468     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
469     * @throws HL7Exception if the repetition requested is more than one 
470     *     greater than the number of existing repetitions.
471     */
472    public EHC_E12_REQUEST getREQUEST(int rep) { 
473       return getTyped("REQUEST", rep, EHC_E12_REQUEST.class);
474    }
475
476    /** 
477     * Returns the number of existing repetitions of REQUEST 
478     */ 
479    public int getREQUESTReps() { 
480        return getReps("REQUEST");
481    } 
482
483    /** 
484     * <p>
485     * Returns a non-modifiable List containing all current existing repetitions of REQUEST.
486     * <p>
487     * <p>
488     * Note that unlike {@link #getREQUEST()}, this method will not create any reps
489     * if none are already present, so an empty list may be returned.
490     * </p>
491     */ 
492    public List<EHC_E12_REQUEST> getREQUESTAll() throws HL7Exception {
493        return getAllAsList("REQUEST", EHC_E12_REQUEST.class);
494    } 
495
496    /**
497     * Inserts a specific repetition of REQUEST (a Group object)
498     * @see AbstractGroup#insertRepetition(Structure, int) 
499     */
500    public void insertREQUEST(EHC_E12_REQUEST structure, int rep) throws HL7Exception { 
501       super.insertRepetition( "REQUEST", structure, rep);
502    }
503
504
505    /**
506     * Inserts a specific repetition of REQUEST (a Group object)
507     * @see AbstractGroup#insertRepetition(Structure, int) 
508     */
509    public EHC_E12_REQUEST insertREQUEST(int rep) throws HL7Exception { 
510       return (EHC_E12_REQUEST)super.insertRepetition("REQUEST", rep);
511    }
512
513
514    /**
515     * Removes a specific repetition of REQUEST (a Group object)
516     * @see AbstractGroup#removeRepetition(String, int) 
517     */
518    public EHC_E12_REQUEST removeREQUEST(int rep) throws HL7Exception { 
519       return (EHC_E12_REQUEST)super.removeRepetition("REQUEST", rep);
520    }
521
522
523
524}
525