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