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