View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v28.group;
35  
36  import ca.uhn.hl7v2.model.v28.segment.*;
37  
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.model.*;
41  
42  /**
43   * <p>Represents a OML_O39_PATIENT group structure (a Group object).
44   * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
45   * This Group contains the following elements:  
46   * </p>
47   * <ul>
48                           * <li>1: PID (Patient Identification) <b>  </b></li>
49                           * <li>2: PD1 (Patient Additional Demographic) <b>optional  </b></li>
50                           * <li>3: PRT (Participation Information) <b>optional repeating </b></li>
51                           * <li>4: NTE (Notes and Comments) <b>optional repeating </b></li>
52                           * <li>5: NK1 (Next of Kin / Associated Parties) <b>optional repeating </b></li>
53                           * <li>6: ARV (Access Restriction) <b>optional repeating </b></li>
54                           * <li>7: OML_O39_PATIENT_VISIT (a Group object) <b>optional  </b></li>
55                           * <li>8: OML_O39_INSURANCE (a Group object) <b>optional repeating </b></li>
56                           * <li>9: GT1 (Guarantor) <b>optional  </b></li>
57                           * <li>10: AL1 (Patient Allergy Information) <b>optional repeating </b></li>
58   * </ul>
59   */
60  //@SuppressWarnings("unused")
61  public class OML_O39_PATIENT extends AbstractGroup {
62  
63      /** 
64       * Creates a new OML_O39_PATIENT group
65       */
66      public OML_O39_PATIENT(Group parent, ModelClassFactory factory) {
67         super(parent, factory);
68         init(factory);
69      }
70  
71      private void init(ModelClassFactory factory) {
72         try {
73                                    this.add(PID.class, true, false, false);
74                                    this.add(PD1.class, false, false, false);
75                                    this.add(PRT.class, false, true, false);
76                                    this.add(NTE.class, false, true, false);
77                                    this.add(NK1.class, false, true, false);
78                                    this.add(ARV.class, false, true, false);
79                                    this.add(OML_O39_PATIENT_VISIT.class, false, false, false);
80                                    this.add(OML_O39_INSURANCE.class, false, true, false);
81                                    this.add(GT1.class, false, false, false);
82                                    this.add(AL1.class, false, true, false);
83         } catch(HL7Exception e) {
84            log.error("Unexpected error creating OML_O39_PATIENT - this is probably a bug in the source code generator.", e);
85         }
86      }
87  
88      /** 
89       * Returns "2.8"
90       */
91      public String getVersion() {
92         return "2.8";
93      }
94  
95  
96  
97      /**
98       * Returns
99       * PID (Patient Identification) - creates it if necessary
100      */
101     public PID getPID() { 
102        PID retVal = getTyped("PID", PID.class);
103        return retVal;
104     }
105 
106 
107 
108 
109     /**
110      * Returns
111      * PD1 (Patient Additional Demographic) - creates it if necessary
112      */
113     public PD1 getPD1() { 
114        PD1 retVal = getTyped("PD1", PD1.class);
115        return retVal;
116     }
117 
118 
119 
120 
121     /**
122      * Returns
123      * the first repetition of 
124      * PRT (Participation Information) - creates it if necessary
125      */
126     public PRT getPRT() { 
127        PRT retVal = getTyped("PRT", PRT.class);
128        return retVal;
129     }
130 
131 
132     /**
133      * Returns a specific repetition of
134      * PRT (Participation Information) - creates it if necessary
135      *
136      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
137      * @throws HL7Exception if the repetition requested is more than one 
138      *     greater than the number of existing repetitions.
139      */
140     public PRT getPRT(int rep) { 
141        PRT retVal = getTyped("PRT", rep, PRT.class);
142        return retVal;
143     }
144 
145     /** 
146      * Returns the number of existing repetitions of PRT 
147      */ 
148     public int getPRTReps() {  
149         return getReps("PRT");
150     } 
151 
152     /** 
153      * <p>
154      * Returns a non-modifiable List containing all current existing repetitions of PRT.
155      * <p>
156      * <p>
157      * Note that unlike {@link #getPRT()}, this method will not create any reps
158      * if none are already present, so an empty list may be returned.
159      * </p>
160      */ 
161     public java.util.List<PRT> getPRTAll() throws HL7Exception {
162     	return getAllAsList("PRT", PRT.class);
163     } 
164 
165     /**
166      * Inserts a specific repetition of PRT (Participation Information)
167      * @see AbstractGroup#insertRepetition(Structure, int) 
168      */
169     public void insertPRT(PRT structure, int rep) throws HL7Exception { 
170        super.insertRepetition("PRT", structure, rep);
171     }
172 
173 
174     /**
175      * Inserts a specific repetition of PRT (Participation Information)
176      * @see AbstractGroup#insertRepetition(Structure, int) 
177      */
178     public PRT insertPRT(int rep) throws HL7Exception { 
179        return (PRT)super.insertRepetition("PRT", rep);
180     }
181 
182 
183     /**
184      * Removes a specific repetition of PRT (Participation Information)
185      * @see AbstractGroup#removeRepetition(String, int) 
186      */
187     public PRT removePRT(int rep) throws HL7Exception { 
188        return (PRT)super.removeRepetition("PRT", rep);
189     }
190 
191 
192 
193     /**
194      * Returns
195      * the first repetition of 
196      * NTE (Notes and Comments) - creates it if necessary
197      */
198     public NTE getNTE() { 
199        NTE retVal = getTyped("NTE", NTE.class);
200        return retVal;
201     }
202 
203 
204     /**
205      * Returns a specific repetition of
206      * NTE (Notes and Comments) - creates it if necessary
207      *
208      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
209      * @throws HL7Exception if the repetition requested is more than one 
210      *     greater than the number of existing repetitions.
211      */
212     public NTE getNTE(int rep) { 
213        NTE retVal = getTyped("NTE", rep, NTE.class);
214        return retVal;
215     }
216 
217     /** 
218      * Returns the number of existing repetitions of NTE 
219      */ 
220     public int getNTEReps() {  
221         return getReps("NTE");
222     } 
223 
224     /** 
225      * <p>
226      * Returns a non-modifiable List containing all current existing repetitions of NTE.
227      * <p>
228      * <p>
229      * Note that unlike {@link #getNTE()}, this method will not create any reps
230      * if none are already present, so an empty list may be returned.
231      * </p>
232      */ 
233     public java.util.List<NTE> getNTEAll() throws HL7Exception {
234     	return getAllAsList("NTE", NTE.class);
235     } 
236 
237     /**
238      * Inserts a specific repetition of NTE (Notes and Comments)
239      * @see AbstractGroup#insertRepetition(Structure, int) 
240      */
241     public void insertNTE(NTE structure, int rep) throws HL7Exception { 
242        super.insertRepetition("NTE", structure, rep);
243     }
244 
245 
246     /**
247      * Inserts a specific repetition of NTE (Notes and Comments)
248      * @see AbstractGroup#insertRepetition(Structure, int) 
249      */
250     public NTE insertNTE(int rep) throws HL7Exception { 
251        return (NTE)super.insertRepetition("NTE", rep);
252     }
253 
254 
255     /**
256      * Removes a specific repetition of NTE (Notes and Comments)
257      * @see AbstractGroup#removeRepetition(String, int) 
258      */
259     public NTE removeNTE(int rep) throws HL7Exception { 
260        return (NTE)super.removeRepetition("NTE", rep);
261     }
262 
263 
264 
265     /**
266      * Returns
267      * the first repetition of 
268      * NK1 (Next of Kin / Associated Parties) - creates it if necessary
269      */
270     public NK1 getNK1() { 
271        NK1 retVal = getTyped("NK1", NK1.class);
272        return retVal;
273     }
274 
275 
276     /**
277      * Returns a specific repetition of
278      * NK1 (Next of Kin / Associated Parties) - 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 NK1 getNK1(int rep) { 
285        NK1 retVal = getTyped("NK1", rep, NK1.class);
286        return retVal;
287     }
288 
289     /** 
290      * Returns the number of existing repetitions of NK1 
291      */ 
292     public int getNK1Reps() {  
293         return getReps("NK1");
294     } 
295 
296     /** 
297      * <p>
298      * Returns a non-modifiable List containing all current existing repetitions of NK1.
299      * <p>
300      * <p>
301      * Note that unlike {@link #getNK1()}, this method will not create any reps
302      * if none are already present, so an empty list may be returned.
303      * </p>
304      */ 
305     public java.util.List<NK1> getNK1All() throws HL7Exception {
306     	return getAllAsList("NK1", NK1.class);
307     } 
308 
309     /**
310      * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
311      * @see AbstractGroup#insertRepetition(Structure, int) 
312      */
313     public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
314        super.insertRepetition("NK1", structure, rep);
315     }
316 
317 
318     /**
319      * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
320      * @see AbstractGroup#insertRepetition(Structure, int) 
321      */
322     public NK1 insertNK1(int rep) throws HL7Exception { 
323        return (NK1)super.insertRepetition("NK1", rep);
324     }
325 
326 
327     /**
328      * Removes a specific repetition of NK1 (Next of Kin / Associated Parties)
329      * @see AbstractGroup#removeRepetition(String, int) 
330      */
331     public NK1 removeNK1(int rep) throws HL7Exception { 
332        return (NK1)super.removeRepetition("NK1", rep);
333     }
334 
335 
336 
337     /**
338      * Returns
339      * the first repetition of 
340      * ARV (Access Restriction) - creates it if necessary
341      */
342     public ARV getARV() { 
343        ARV retVal = getTyped("ARV", ARV.class);
344        return retVal;
345     }
346 
347 
348     /**
349      * Returns a specific repetition of
350      * ARV (Access Restriction) - creates it if necessary
351      *
352      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
353      * @throws HL7Exception if the repetition requested is more than one 
354      *     greater than the number of existing repetitions.
355      */
356     public ARV getARV(int rep) { 
357        ARV retVal = getTyped("ARV", rep, ARV.class);
358        return retVal;
359     }
360 
361     /** 
362      * Returns the number of existing repetitions of ARV 
363      */ 
364     public int getARVReps() {  
365         return getReps("ARV");
366     } 
367 
368     /** 
369      * <p>
370      * Returns a non-modifiable List containing all current existing repetitions of ARV.
371      * <p>
372      * <p>
373      * Note that unlike {@link #getARV()}, this method will not create any reps
374      * if none are already present, so an empty list may be returned.
375      * </p>
376      */ 
377     public java.util.List<ARV> getARVAll() throws HL7Exception {
378     	return getAllAsList("ARV", ARV.class);
379     } 
380 
381     /**
382      * Inserts a specific repetition of ARV (Access Restriction)
383      * @see AbstractGroup#insertRepetition(Structure, int) 
384      */
385     public void insertARV(ARV structure, int rep) throws HL7Exception { 
386        super.insertRepetition("ARV", structure, rep);
387     }
388 
389 
390     /**
391      * Inserts a specific repetition of ARV (Access Restriction)
392      * @see AbstractGroup#insertRepetition(Structure, int) 
393      */
394     public ARV insertARV(int rep) throws HL7Exception { 
395        return (ARV)super.insertRepetition("ARV", rep);
396     }
397 
398 
399     /**
400      * Removes a specific repetition of ARV (Access Restriction)
401      * @see AbstractGroup#removeRepetition(String, int) 
402      */
403     public ARV removeARV(int rep) throws HL7Exception { 
404        return (ARV)super.removeRepetition("ARV", rep);
405     }
406 
407 
408 
409     /**
410      * Returns
411      * PATIENT_VISIT (a Group object) - creates it if necessary
412      */
413     public OML_O39_PATIENT_VISIT getPATIENT_VISIT() { 
414        OML_O39_PATIENT_VISIT retVal = getTyped("PATIENT_VISIT", OML_O39_PATIENT_VISIT.class);
415        return retVal;
416     }
417 
418 
419 
420 
421     /**
422      * Returns
423      * the first repetition of 
424      * INSURANCE (a Group object) - creates it if necessary
425      */
426     public OML_O39_INSURANCE getINSURANCE() { 
427        OML_O39_INSURANCE retVal = getTyped("INSURANCE", OML_O39_INSURANCE.class);
428        return retVal;
429     }
430 
431 
432     /**
433      * Returns a specific repetition of
434      * INSURANCE (a Group object) - creates it if necessary
435      *
436      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
437      * @throws HL7Exception if the repetition requested is more than one 
438      *     greater than the number of existing repetitions.
439      */
440     public OML_O39_INSURANCE getINSURANCE(int rep) { 
441        OML_O39_INSURANCE retVal = getTyped("INSURANCE", rep, OML_O39_INSURANCE.class);
442        return retVal;
443     }
444 
445     /** 
446      * Returns the number of existing repetitions of INSURANCE 
447      */ 
448     public int getINSURANCEReps() {  
449         return getReps("INSURANCE");
450     } 
451 
452     /** 
453      * <p>
454      * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
455      * <p>
456      * <p>
457      * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
458      * if none are already present, so an empty list may be returned.
459      * </p>
460      */ 
461     public java.util.List<OML_O39_INSURANCE> getINSURANCEAll() throws HL7Exception {
462     	return getAllAsList("INSURANCE", OML_O39_INSURANCE.class);
463     } 
464 
465     /**
466      * Inserts a specific repetition of INSURANCE (a Group object)
467      * @see AbstractGroup#insertRepetition(Structure, int) 
468      */
469     public void insertINSURANCE(OML_O39_INSURANCE structure, int rep) throws HL7Exception { 
470        super.insertRepetition("INSURANCE", structure, rep);
471     }
472 
473 
474     /**
475      * Inserts a specific repetition of INSURANCE (a Group object)
476      * @see AbstractGroup#insertRepetition(Structure, int) 
477      */
478     public OML_O39_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
479        return (OML_O39_INSURANCE)super.insertRepetition("INSURANCE", rep);
480     }
481 
482 
483     /**
484      * Removes a specific repetition of INSURANCE (a Group object)
485      * @see AbstractGroup#removeRepetition(String, int) 
486      */
487     public OML_O39_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
488        return (OML_O39_INSURANCE)super.removeRepetition("INSURANCE", rep);
489     }
490 
491 
492 
493     /**
494      * Returns
495      * GT1 (Guarantor) - creates it if necessary
496      */
497     public GT1 getGT1() { 
498        GT1 retVal = getTyped("GT1", GT1.class);
499        return retVal;
500     }
501 
502 
503 
504 
505     /**
506      * Returns
507      * the first repetition of 
508      * AL1 (Patient Allergy Information) - creates it if necessary
509      */
510     public AL1 getAL1() { 
511        AL1 retVal = getTyped("AL1", AL1.class);
512        return retVal;
513     }
514 
515 
516     /**
517      * Returns a specific repetition of
518      * AL1 (Patient Allergy Information) - creates it if necessary
519      *
520      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
521      * @throws HL7Exception if the repetition requested is more than one 
522      *     greater than the number of existing repetitions.
523      */
524     public AL1 getAL1(int rep) { 
525        AL1 retVal = getTyped("AL1", rep, AL1.class);
526        return retVal;
527     }
528 
529     /** 
530      * Returns the number of existing repetitions of AL1 
531      */ 
532     public int getAL1Reps() {  
533         return getReps("AL1");
534     } 
535 
536     /** 
537      * <p>
538      * Returns a non-modifiable List containing all current existing repetitions of AL1.
539      * <p>
540      * <p>
541      * Note that unlike {@link #getAL1()}, this method will not create any reps
542      * if none are already present, so an empty list may be returned.
543      * </p>
544      */ 
545     public java.util.List<AL1> getAL1All() throws HL7Exception {
546     	return getAllAsList("AL1", AL1.class);
547     } 
548 
549     /**
550      * Inserts a specific repetition of AL1 (Patient Allergy Information)
551      * @see AbstractGroup#insertRepetition(Structure, int) 
552      */
553     public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
554        super.insertRepetition("AL1", structure, rep);
555     }
556 
557 
558     /**
559      * Inserts a specific repetition of AL1 (Patient Allergy Information)
560      * @see AbstractGroup#insertRepetition(Structure, int) 
561      */
562     public AL1 insertAL1(int rep) throws HL7Exception { 
563        return (AL1)super.insertRepetition("AL1", rep);
564     }
565 
566 
567     /**
568      * Removes a specific repetition of AL1 (Patient Allergy Information)
569      * @see AbstractGroup#removeRepetition(String, int) 
570      */
571     public AL1 removeAL1(int rep) throws HL7Exception { 
572        return (AL1)super.removeRepetition("AL1", rep);
573     }
574 
575 
576 
577 }
578