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.v22.message;
035
036import ca.uhn.hl7v2.model.v22.group.*;
037import ca.uhn.hl7v2.model.v22.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 ADT_A07 message structure (see chapter ?). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (MESSAGE HEADER) <b> </b></li>
051                 * <li>2: EVN (EVENT TYPE) <b> </b></li>
052                 * <li>3: PID (PATIENT IDENTIFICATION) <b> </b></li>
053                 * <li>4: MRG (MERGE PATIENT INFORMATION) <b>optional </b></li>
054                 * <li>5: NK1 (NEXT OF KIN) <b>optional repeating</b></li>
055                 * <li>6: PV1 (PATIENT VISIT) <b> </b></li>
056                 * <li>7: PV2 (PATIENT VISIT - additional information) <b>optional </b></li>
057                 * <li>8: OBX (OBSERVATION RESULT) <b>optional repeating</b></li>
058                 * <li>9: AL1 (PATIENT ALLERGY INFORMATION) <b>optional repeating</b></li>
059                 * <li>10: DG1 (DIAGNOSIS) <b>optional repeating</b></li>
060                 * <li>11: PR1 (PROCEDURES) <b>optional repeating</b></li>
061                 * <li>12: GT1 (GUARANTOR) <b>optional repeating</b></li>
062                 * <li>13: ADT_A07_INSURANCE (a Group object) <b>optional repeating</b></li>
063                 * <li>14: ACC (ACCIDENT) <b>optional </b></li>
064                 * <li>15: UB1 (UB82 DATA) <b>optional </b></li>
065                 * <li>16: UB2 (UB92 DATA) <b>optional </b></li>
066 * </ul>
067 */
068@SuppressWarnings("unused")
069public class ADT_A07 extends AbstractMessage  {
070
071    /**
072     * Creates a new ADT_A07 message with DefaultModelClassFactory. 
073     */ 
074    public ADT_A07() { 
075       this(new DefaultModelClassFactory());
076    }
077
078    /** 
079     * Creates a new ADT_A07 message with custom ModelClassFactory.
080     */
081    public ADT_A07(ModelClassFactory factory) {
082       super(factory);
083       init(factory);
084    }
085
086    private void init(ModelClassFactory factory) {
087       try {
088                          this.add(MSH.class, true, false);
089                          this.add(EVN.class, true, false);
090                          this.add(PID.class, true, false);
091                          this.add(MRG.class, false, false);
092                          this.add(NK1.class, false, true);
093                          this.add(PV1.class, true, false);
094                          this.add(PV2.class, false, false);
095                          this.add(OBX.class, false, true);
096                          this.add(AL1.class, false, true);
097                          this.add(DG1.class, false, true);
098                          this.add(PR1.class, false, true);
099                          this.add(GT1.class, false, true);
100                          this.add(ADT_A07_INSURANCE.class, false, true);
101                          this.add(ACC.class, false, false);
102                          this.add(UB1.class, false, false);
103                          this.add(UB2.class, false, false);
104       } catch(HL7Exception e) {
105          log.error("Unexpected error creating ADT_A07 - this is probably a bug in the source code generator.", e);
106       }
107    }
108
109    /** 
110     * Returns "2.2"
111     */
112    public String getVersion() {
113       return "2.2";
114    }
115
116
117
118    /**
119     * Returns
120     * MSH (MESSAGE HEADER) - creates it if necessary
121     */
122    public MSH getMSH() { 
123       return getTyped("MSH", MSH.class);
124    }
125
126
127
128
129    /**
130     * Returns
131     * EVN (EVENT TYPE) - creates it if necessary
132     */
133    public EVN getEVN() { 
134       return getTyped("EVN", EVN.class);
135    }
136
137
138
139
140    /**
141     * Returns
142     * PID (PATIENT IDENTIFICATION) - creates it if necessary
143     */
144    public PID getPID() { 
145       return getTyped("PID", PID.class);
146    }
147
148
149
150
151    /**
152     * Returns
153     * MRG (MERGE PATIENT INFORMATION) - creates it if necessary
154     */
155    public MRG getMRG() { 
156       return getTyped("MRG", MRG.class);
157    }
158
159
160
161
162    /**
163     * Returns
164     * the first repetition of 
165     * NK1 (NEXT OF KIN) - creates it if necessary
166     */
167    public NK1 getNK1() { 
168       return getTyped("NK1", NK1.class);
169    }
170
171
172    /**
173     * Returns a specific repetition of
174     * NK1 (NEXT OF KIN) - creates it if necessary
175     *
176     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
177     * @throws HL7Exception if the repetition requested is more than one 
178     *     greater than the number of existing repetitions.
179     */
180    public NK1 getNK1(int rep) { 
181       return getTyped("NK1", rep, NK1.class);
182    }
183
184    /** 
185     * Returns the number of existing repetitions of NK1 
186     */ 
187    public int getNK1Reps() { 
188        return getReps("NK1");
189    } 
190
191    /** 
192     * <p>
193     * Returns a non-modifiable List containing all current existing repetitions of NK1.
194     * <p>
195     * <p>
196     * Note that unlike {@link #getNK1()}, this method will not create any reps
197     * if none are already present, so an empty list may be returned.
198     * </p>
199     */ 
200    public List<NK1> getNK1All() throws HL7Exception {
201        return getAllAsList("NK1", NK1.class);
202    } 
203
204    /**
205     * Inserts a specific repetition of NK1 (NEXT OF KIN)
206     * @see AbstractGroup#insertRepetition(Structure, int) 
207     */
208    public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
209       super.insertRepetition( "NK1", structure, rep);
210    }
211
212
213    /**
214     * Inserts a specific repetition of NK1 (NEXT OF KIN)
215     * @see AbstractGroup#insertRepetition(Structure, int) 
216     */
217    public NK1 insertNK1(int rep) throws HL7Exception { 
218       return (NK1)super.insertRepetition("NK1", rep);
219    }
220
221
222    /**
223     * Removes a specific repetition of NK1 (NEXT OF KIN)
224     * @see AbstractGroup#removeRepetition(String, int) 
225     */
226    public NK1 removeNK1(int rep) throws HL7Exception { 
227       return (NK1)super.removeRepetition("NK1", rep);
228    }
229
230
231
232    /**
233     * Returns
234     * PV1 (PATIENT VISIT) - creates it if necessary
235     */
236    public PV1 getPV1() { 
237       return getTyped("PV1", PV1.class);
238    }
239
240
241
242
243    /**
244     * Returns
245     * PV2 (PATIENT VISIT - additional information) - creates it if necessary
246     */
247    public PV2 getPV2() { 
248       return getTyped("PV2", PV2.class);
249    }
250
251
252
253
254    /**
255     * Returns
256     * the first repetition of 
257     * OBX (OBSERVATION RESULT) - creates it if necessary
258     */
259    public OBX getOBX() { 
260       return getTyped("OBX", OBX.class);
261    }
262
263
264    /**
265     * Returns a specific repetition of
266     * OBX (OBSERVATION RESULT) - 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 OBX getOBX(int rep) { 
273       return getTyped("OBX", rep, OBX.class);
274    }
275
276    /** 
277     * Returns the number of existing repetitions of OBX 
278     */ 
279    public int getOBXReps() { 
280        return getReps("OBX");
281    } 
282
283    /** 
284     * <p>
285     * Returns a non-modifiable List containing all current existing repetitions of OBX.
286     * <p>
287     * <p>
288     * Note that unlike {@link #getOBX()}, this method will not create any reps
289     * if none are already present, so an empty list may be returned.
290     * </p>
291     */ 
292    public List<OBX> getOBXAll() throws HL7Exception {
293        return getAllAsList("OBX", OBX.class);
294    } 
295
296    /**
297     * Inserts a specific repetition of OBX (OBSERVATION RESULT)
298     * @see AbstractGroup#insertRepetition(Structure, int) 
299     */
300    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
301       super.insertRepetition( "OBX", structure, rep);
302    }
303
304
305    /**
306     * Inserts a specific repetition of OBX (OBSERVATION RESULT)
307     * @see AbstractGroup#insertRepetition(Structure, int) 
308     */
309    public OBX insertOBX(int rep) throws HL7Exception { 
310       return (OBX)super.insertRepetition("OBX", rep);
311    }
312
313
314    /**
315     * Removes a specific repetition of OBX (OBSERVATION RESULT)
316     * @see AbstractGroup#removeRepetition(String, int) 
317     */
318    public OBX removeOBX(int rep) throws HL7Exception { 
319       return (OBX)super.removeRepetition("OBX", rep);
320    }
321
322
323
324    /**
325     * Returns
326     * the first repetition of 
327     * AL1 (PATIENT ALLERGY INFORMATION) - creates it if necessary
328     */
329    public AL1 getAL1() { 
330       return getTyped("AL1", AL1.class);
331    }
332
333
334    /**
335     * Returns a specific repetition of
336     * AL1 (PATIENT ALLERGY INFORMATION) - creates it if necessary
337     *
338     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
339     * @throws HL7Exception if the repetition requested is more than one 
340     *     greater than the number of existing repetitions.
341     */
342    public AL1 getAL1(int rep) { 
343       return getTyped("AL1", rep, AL1.class);
344    }
345
346    /** 
347     * Returns the number of existing repetitions of AL1 
348     */ 
349    public int getAL1Reps() { 
350        return getReps("AL1");
351    } 
352
353    /** 
354     * <p>
355     * Returns a non-modifiable List containing all current existing repetitions of AL1.
356     * <p>
357     * <p>
358     * Note that unlike {@link #getAL1()}, this method will not create any reps
359     * if none are already present, so an empty list may be returned.
360     * </p>
361     */ 
362    public List<AL1> getAL1All() throws HL7Exception {
363        return getAllAsList("AL1", AL1.class);
364    } 
365
366    /**
367     * Inserts a specific repetition of AL1 (PATIENT ALLERGY INFORMATION)
368     * @see AbstractGroup#insertRepetition(Structure, int) 
369     */
370    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
371       super.insertRepetition( "AL1", structure, rep);
372    }
373
374
375    /**
376     * Inserts a specific repetition of AL1 (PATIENT ALLERGY INFORMATION)
377     * @see AbstractGroup#insertRepetition(Structure, int) 
378     */
379    public AL1 insertAL1(int rep) throws HL7Exception { 
380       return (AL1)super.insertRepetition("AL1", rep);
381    }
382
383
384    /**
385     * Removes a specific repetition of AL1 (PATIENT ALLERGY INFORMATION)
386     * @see AbstractGroup#removeRepetition(String, int) 
387     */
388    public AL1 removeAL1(int rep) throws HL7Exception { 
389       return (AL1)super.removeRepetition("AL1", rep);
390    }
391
392
393
394    /**
395     * Returns
396     * the first repetition of 
397     * DG1 (DIAGNOSIS) - creates it if necessary
398     */
399    public DG1 getDG1() { 
400       return getTyped("DG1", DG1.class);
401    }
402
403
404    /**
405     * Returns a specific repetition of
406     * DG1 (DIAGNOSIS) - 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 DG1 getDG1(int rep) { 
413       return getTyped("DG1", rep, DG1.class);
414    }
415
416    /** 
417     * Returns the number of existing repetitions of DG1 
418     */ 
419    public int getDG1Reps() { 
420        return getReps("DG1");
421    } 
422
423    /** 
424     * <p>
425     * Returns a non-modifiable List containing all current existing repetitions of DG1.
426     * <p>
427     * <p>
428     * Note that unlike {@link #getDG1()}, this method will not create any reps
429     * if none are already present, so an empty list may be returned.
430     * </p>
431     */ 
432    public List<DG1> getDG1All() throws HL7Exception {
433        return getAllAsList("DG1", DG1.class);
434    } 
435
436    /**
437     * Inserts a specific repetition of DG1 (DIAGNOSIS)
438     * @see AbstractGroup#insertRepetition(Structure, int) 
439     */
440    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
441       super.insertRepetition( "DG1", structure, rep);
442    }
443
444
445    /**
446     * Inserts a specific repetition of DG1 (DIAGNOSIS)
447     * @see AbstractGroup#insertRepetition(Structure, int) 
448     */
449    public DG1 insertDG1(int rep) throws HL7Exception { 
450       return (DG1)super.insertRepetition("DG1", rep);
451    }
452
453
454    /**
455     * Removes a specific repetition of DG1 (DIAGNOSIS)
456     * @see AbstractGroup#removeRepetition(String, int) 
457     */
458    public DG1 removeDG1(int rep) throws HL7Exception { 
459       return (DG1)super.removeRepetition("DG1", rep);
460    }
461
462
463
464    /**
465     * Returns
466     * the first repetition of 
467     * PR1 (PROCEDURES) - creates it if necessary
468     */
469    public PR1 getPR1() { 
470       return getTyped("PR1", PR1.class);
471    }
472
473
474    /**
475     * Returns a specific repetition of
476     * PR1 (PROCEDURES) - creates it if necessary
477     *
478     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
479     * @throws HL7Exception if the repetition requested is more than one 
480     *     greater than the number of existing repetitions.
481     */
482    public PR1 getPR1(int rep) { 
483       return getTyped("PR1", rep, PR1.class);
484    }
485
486    /** 
487     * Returns the number of existing repetitions of PR1 
488     */ 
489    public int getPR1Reps() { 
490        return getReps("PR1");
491    } 
492
493    /** 
494     * <p>
495     * Returns a non-modifiable List containing all current existing repetitions of PR1.
496     * <p>
497     * <p>
498     * Note that unlike {@link #getPR1()}, this method will not create any reps
499     * if none are already present, so an empty list may be returned.
500     * </p>
501     */ 
502    public List<PR1> getPR1All() throws HL7Exception {
503        return getAllAsList("PR1", PR1.class);
504    } 
505
506    /**
507     * Inserts a specific repetition of PR1 (PROCEDURES)
508     * @see AbstractGroup#insertRepetition(Structure, int) 
509     */
510    public void insertPR1(PR1 structure, int rep) throws HL7Exception { 
511       super.insertRepetition( "PR1", structure, rep);
512    }
513
514
515    /**
516     * Inserts a specific repetition of PR1 (PROCEDURES)
517     * @see AbstractGroup#insertRepetition(Structure, int) 
518     */
519    public PR1 insertPR1(int rep) throws HL7Exception { 
520       return (PR1)super.insertRepetition("PR1", rep);
521    }
522
523
524    /**
525     * Removes a specific repetition of PR1 (PROCEDURES)
526     * @see AbstractGroup#removeRepetition(String, int) 
527     */
528    public PR1 removePR1(int rep) throws HL7Exception { 
529       return (PR1)super.removeRepetition("PR1", rep);
530    }
531
532
533
534    /**
535     * Returns
536     * the first repetition of 
537     * GT1 (GUARANTOR) - creates it if necessary
538     */
539    public GT1 getGT1() { 
540       return getTyped("GT1", GT1.class);
541    }
542
543
544    /**
545     * Returns a specific repetition of
546     * GT1 (GUARANTOR) - creates it if necessary
547     *
548     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
549     * @throws HL7Exception if the repetition requested is more than one 
550     *     greater than the number of existing repetitions.
551     */
552    public GT1 getGT1(int rep) { 
553       return getTyped("GT1", rep, GT1.class);
554    }
555
556    /** 
557     * Returns the number of existing repetitions of GT1 
558     */ 
559    public int getGT1Reps() { 
560        return getReps("GT1");
561    } 
562
563    /** 
564     * <p>
565     * Returns a non-modifiable List containing all current existing repetitions of GT1.
566     * <p>
567     * <p>
568     * Note that unlike {@link #getGT1()}, this method will not create any reps
569     * if none are already present, so an empty list may be returned.
570     * </p>
571     */ 
572    public List<GT1> getGT1All() throws HL7Exception {
573        return getAllAsList("GT1", GT1.class);
574    } 
575
576    /**
577     * Inserts a specific repetition of GT1 (GUARANTOR)
578     * @see AbstractGroup#insertRepetition(Structure, int) 
579     */
580    public void insertGT1(GT1 structure, int rep) throws HL7Exception { 
581       super.insertRepetition( "GT1", structure, rep);
582    }
583
584
585    /**
586     * Inserts a specific repetition of GT1 (GUARANTOR)
587     * @see AbstractGroup#insertRepetition(Structure, int) 
588     */
589    public GT1 insertGT1(int rep) throws HL7Exception { 
590       return (GT1)super.insertRepetition("GT1", rep);
591    }
592
593
594    /**
595     * Removes a specific repetition of GT1 (GUARANTOR)
596     * @see AbstractGroup#removeRepetition(String, int) 
597     */
598    public GT1 removeGT1(int rep) throws HL7Exception { 
599       return (GT1)super.removeRepetition("GT1", rep);
600    }
601
602
603
604    /**
605     * Returns
606     * the first repetition of 
607     * INSURANCE (a Group object) - creates it if necessary
608     */
609    public ADT_A07_INSURANCE getINSURANCE() { 
610       return getTyped("INSURANCE", ADT_A07_INSURANCE.class);
611    }
612
613
614    /**
615     * Returns a specific repetition of
616     * INSURANCE (a Group object) - creates it if necessary
617     *
618     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
619     * @throws HL7Exception if the repetition requested is more than one 
620     *     greater than the number of existing repetitions.
621     */
622    public ADT_A07_INSURANCE getINSURANCE(int rep) { 
623       return getTyped("INSURANCE", rep, ADT_A07_INSURANCE.class);
624    }
625
626    /** 
627     * Returns the number of existing repetitions of INSURANCE 
628     */ 
629    public int getINSURANCEReps() { 
630        return getReps("INSURANCE");
631    } 
632
633    /** 
634     * <p>
635     * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
636     * <p>
637     * <p>
638     * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
639     * if none are already present, so an empty list may be returned.
640     * </p>
641     */ 
642    public List<ADT_A07_INSURANCE> getINSURANCEAll() throws HL7Exception {
643        return getAllAsList("INSURANCE", ADT_A07_INSURANCE.class);
644    } 
645
646    /**
647     * Inserts a specific repetition of INSURANCE (a Group object)
648     * @see AbstractGroup#insertRepetition(Structure, int) 
649     */
650    public void insertINSURANCE(ADT_A07_INSURANCE structure, int rep) throws HL7Exception { 
651       super.insertRepetition( "INSURANCE", structure, rep);
652    }
653
654
655    /**
656     * Inserts a specific repetition of INSURANCE (a Group object)
657     * @see AbstractGroup#insertRepetition(Structure, int) 
658     */
659    public ADT_A07_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
660       return (ADT_A07_INSURANCE)super.insertRepetition("INSURANCE", rep);
661    }
662
663
664    /**
665     * Removes a specific repetition of INSURANCE (a Group object)
666     * @see AbstractGroup#removeRepetition(String, int) 
667     */
668    public ADT_A07_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
669       return (ADT_A07_INSURANCE)super.removeRepetition("INSURANCE", rep);
670    }
671
672
673
674    /**
675     * Returns
676     * ACC (ACCIDENT) - creates it if necessary
677     */
678    public ACC getACC() { 
679       return getTyped("ACC", ACC.class);
680    }
681
682
683
684
685    /**
686     * Returns
687     * UB1 (UB82 DATA) - creates it if necessary
688     */
689    public UB1 getUB1() { 
690       return getTyped("UB1", UB1.class);
691    }
692
693
694
695
696    /**
697     * Returns
698     * UB2 (UB92 DATA) - creates it if necessary
699     */
700    public UB2 getUB2() { 
701       return getTyped("UB2", UB2.class);
702    }
703
704
705
706
707}
708