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.v27.group;
035
036import ca.uhn.hl7v2.model.v27.segment.*;
037
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.model.*;
041
042/**
043 * <p>Represents a OML_O39_PATIENT 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: PID (Patient Identification) <b>  </b></li>
049                         * <li>2: PD1 (Patient Additional Demographic) <b>optional  </b></li>
050                         * <li>3: PRT (Participation Information) <b>optional repeating </b></li>
051                         * <li>4: NTE (Notes and Comments) <b>optional repeating </b></li>
052                         * <li>5: NK1 (Next of Kin / Associated Parties) <b>optional repeating </b></li>
053                         * <li>6: OML_O39_PATIENT_VISIT (a Group object) <b>optional  </b></li>
054                         * <li>7: OML_O39_INSURANCE (a Group object) <b>optional repeating </b></li>
055                         * <li>8: GT1 (Guarantor) <b>optional  </b></li>
056                         * <li>9: AL1 (Patient Allergy Information) <b>optional repeating </b></li>
057 * </ul>
058 */
059//@SuppressWarnings("unused")
060public class OML_O39_PATIENT extends AbstractGroup {
061
062    /** 
063     * Creates a new OML_O39_PATIENT group
064     */
065    public OML_O39_PATIENT(Group parent, ModelClassFactory factory) {
066       super(parent, factory);
067       init(factory);
068    }
069
070    private void init(ModelClassFactory factory) {
071       try {
072                                  this.add(PID.class, true, false, false);
073                                  this.add(PD1.class, false, false, false);
074                                  this.add(PRT.class, false, true, false);
075                                  this.add(NTE.class, false, true, false);
076                                  this.add(NK1.class, false, true, false);
077                                  this.add(OML_O39_PATIENT_VISIT.class, false, false, false);
078                                  this.add(OML_O39_INSURANCE.class, false, true, false);
079                                  this.add(GT1.class, false, false, false);
080                                  this.add(AL1.class, false, true, false);
081       } catch(HL7Exception e) {
082          log.error("Unexpected error creating OML_O39_PATIENT - this is probably a bug in the source code generator.", e);
083       }
084    }
085
086    /** 
087     * Returns "2.7"
088     */
089    public String getVersion() {
090       return "2.7";
091    }
092
093
094
095    /**
096     * Returns
097     * PID (Patient Identification) - creates it if necessary
098     */
099    public PID getPID() { 
100       PID retVal = getTyped("PID", PID.class);
101       return retVal;
102    }
103
104
105
106
107    /**
108     * Returns
109     * PD1 (Patient Additional Demographic) - creates it if necessary
110     */
111    public PD1 getPD1() { 
112       PD1 retVal = getTyped("PD1", PD1.class);
113       return retVal;
114    }
115
116
117
118
119    /**
120     * Returns
121     * the first repetition of 
122     * PRT (Participation Information) - creates it if necessary
123     */
124    public PRT getPRT() { 
125       PRT retVal = getTyped("PRT", PRT.class);
126       return retVal;
127    }
128
129
130    /**
131     * Returns a specific repetition of
132     * PRT (Participation Information) - creates it if necessary
133     *
134     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
135     * @throws HL7Exception if the repetition requested is more than one 
136     *     greater than the number of existing repetitions.
137     */
138    public PRT getPRT(int rep) { 
139       PRT retVal = getTyped("PRT", rep, PRT.class);
140       return retVal;
141    }
142
143    /** 
144     * Returns the number of existing repetitions of PRT 
145     */ 
146    public int getPRTReps() {  
147        return getReps("PRT");
148    } 
149
150    /** 
151     * <p>
152     * Returns a non-modifiable List containing all current existing repetitions of PRT.
153     * <p>
154     * <p>
155     * Note that unlike {@link #getPRT()}, this method will not create any reps
156     * if none are already present, so an empty list may be returned.
157     * </p>
158     */ 
159    public java.util.List<PRT> getPRTAll() throws HL7Exception {
160        return getAllAsList("PRT", PRT.class);
161    } 
162
163    /**
164     * Inserts a specific repetition of PRT (Participation Information)
165     * @see AbstractGroup#insertRepetition(Structure, int) 
166     */
167    public void insertPRT(PRT structure, int rep) throws HL7Exception { 
168       super.insertRepetition("PRT", structure, rep);
169    }
170
171
172    /**
173     * Inserts a specific repetition of PRT (Participation Information)
174     * @see AbstractGroup#insertRepetition(Structure, int) 
175     */
176    public PRT insertPRT(int rep) throws HL7Exception { 
177       return (PRT)super.insertRepetition("PRT", rep);
178    }
179
180
181    /**
182     * Removes a specific repetition of PRT (Participation Information)
183     * @see AbstractGroup#removeRepetition(String, int) 
184     */
185    public PRT removePRT(int rep) throws HL7Exception { 
186       return (PRT)super.removeRepetition("PRT", rep);
187    }
188
189
190
191    /**
192     * Returns
193     * the first repetition of 
194     * NTE (Notes and Comments) - creates it if necessary
195     */
196    public NTE getNTE() { 
197       NTE retVal = getTyped("NTE", NTE.class);
198       return retVal;
199    }
200
201
202    /**
203     * Returns a specific repetition of
204     * NTE (Notes and Comments) - creates it if necessary
205     *
206     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
207     * @throws HL7Exception if the repetition requested is more than one 
208     *     greater than the number of existing repetitions.
209     */
210    public NTE getNTE(int rep) { 
211       NTE retVal = getTyped("NTE", rep, NTE.class);
212       return retVal;
213    }
214
215    /** 
216     * Returns the number of existing repetitions of NTE 
217     */ 
218    public int getNTEReps() {  
219        return getReps("NTE");
220    } 
221
222    /** 
223     * <p>
224     * Returns a non-modifiable List containing all current existing repetitions of NTE.
225     * <p>
226     * <p>
227     * Note that unlike {@link #getNTE()}, this method will not create any reps
228     * if none are already present, so an empty list may be returned.
229     * </p>
230     */ 
231    public java.util.List<NTE> getNTEAll() throws HL7Exception {
232        return getAllAsList("NTE", NTE.class);
233    } 
234
235    /**
236     * Inserts a specific repetition of NTE (Notes and Comments)
237     * @see AbstractGroup#insertRepetition(Structure, int) 
238     */
239    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
240       super.insertRepetition("NTE", structure, rep);
241    }
242
243
244    /**
245     * Inserts a specific repetition of NTE (Notes and Comments)
246     * @see AbstractGroup#insertRepetition(Structure, int) 
247     */
248    public NTE insertNTE(int rep) throws HL7Exception { 
249       return (NTE)super.insertRepetition("NTE", rep);
250    }
251
252
253    /**
254     * Removes a specific repetition of NTE (Notes and Comments)
255     * @see AbstractGroup#removeRepetition(String, int) 
256     */
257    public NTE removeNTE(int rep) throws HL7Exception { 
258       return (NTE)super.removeRepetition("NTE", rep);
259    }
260
261
262
263    /**
264     * Returns
265     * the first repetition of 
266     * NK1 (Next of Kin / Associated Parties) - creates it if necessary
267     */
268    public NK1 getNK1() { 
269       NK1 retVal = getTyped("NK1", NK1.class);
270       return retVal;
271    }
272
273
274    /**
275     * Returns a specific repetition of
276     * NK1 (Next of Kin / Associated Parties) - creates it if necessary
277     *
278     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
279     * @throws HL7Exception if the repetition requested is more than one 
280     *     greater than the number of existing repetitions.
281     */
282    public NK1 getNK1(int rep) { 
283       NK1 retVal = getTyped("NK1", rep, NK1.class);
284       return retVal;
285    }
286
287    /** 
288     * Returns the number of existing repetitions of NK1 
289     */ 
290    public int getNK1Reps() {  
291        return getReps("NK1");
292    } 
293
294    /** 
295     * <p>
296     * Returns a non-modifiable List containing all current existing repetitions of NK1.
297     * <p>
298     * <p>
299     * Note that unlike {@link #getNK1()}, this method will not create any reps
300     * if none are already present, so an empty list may be returned.
301     * </p>
302     */ 
303    public java.util.List<NK1> getNK1All() throws HL7Exception {
304        return getAllAsList("NK1", NK1.class);
305    } 
306
307    /**
308     * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
309     * @see AbstractGroup#insertRepetition(Structure, int) 
310     */
311    public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
312       super.insertRepetition("NK1", structure, rep);
313    }
314
315
316    /**
317     * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
318     * @see AbstractGroup#insertRepetition(Structure, int) 
319     */
320    public NK1 insertNK1(int rep) throws HL7Exception { 
321       return (NK1)super.insertRepetition("NK1", rep);
322    }
323
324
325    /**
326     * Removes a specific repetition of NK1 (Next of Kin / Associated Parties)
327     * @see AbstractGroup#removeRepetition(String, int) 
328     */
329    public NK1 removeNK1(int rep) throws HL7Exception { 
330       return (NK1)super.removeRepetition("NK1", rep);
331    }
332
333
334
335    /**
336     * Returns
337     * PATIENT_VISIT (a Group object) - creates it if necessary
338     */
339    public OML_O39_PATIENT_VISIT getPATIENT_VISIT() { 
340       OML_O39_PATIENT_VISIT retVal = getTyped("PATIENT_VISIT", OML_O39_PATIENT_VISIT.class);
341       return retVal;
342    }
343
344
345
346
347    /**
348     * Returns
349     * the first repetition of 
350     * INSURANCE (a Group object) - creates it if necessary
351     */
352    public OML_O39_INSURANCE getINSURANCE() { 
353       OML_O39_INSURANCE retVal = getTyped("INSURANCE", OML_O39_INSURANCE.class);
354       return retVal;
355    }
356
357
358    /**
359     * Returns a specific repetition of
360     * INSURANCE (a Group object) - creates it if necessary
361     *
362     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
363     * @throws HL7Exception if the repetition requested is more than one 
364     *     greater than the number of existing repetitions.
365     */
366    public OML_O39_INSURANCE getINSURANCE(int rep) { 
367       OML_O39_INSURANCE retVal = getTyped("INSURANCE", rep, OML_O39_INSURANCE.class);
368       return retVal;
369    }
370
371    /** 
372     * Returns the number of existing repetitions of INSURANCE 
373     */ 
374    public int getINSURANCEReps() {  
375        return getReps("INSURANCE");
376    } 
377
378    /** 
379     * <p>
380     * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
381     * <p>
382     * <p>
383     * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
384     * if none are already present, so an empty list may be returned.
385     * </p>
386     */ 
387    public java.util.List<OML_O39_INSURANCE> getINSURANCEAll() throws HL7Exception {
388        return getAllAsList("INSURANCE", OML_O39_INSURANCE.class);
389    } 
390
391    /**
392     * Inserts a specific repetition of INSURANCE (a Group object)
393     * @see AbstractGroup#insertRepetition(Structure, int) 
394     */
395    public void insertINSURANCE(OML_O39_INSURANCE structure, int rep) throws HL7Exception { 
396       super.insertRepetition("INSURANCE", structure, rep);
397    }
398
399
400    /**
401     * Inserts a specific repetition of INSURANCE (a Group object)
402     * @see AbstractGroup#insertRepetition(Structure, int) 
403     */
404    public OML_O39_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
405       return (OML_O39_INSURANCE)super.insertRepetition("INSURANCE", rep);
406    }
407
408
409    /**
410     * Removes a specific repetition of INSURANCE (a Group object)
411     * @see AbstractGroup#removeRepetition(String, int) 
412     */
413    public OML_O39_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
414       return (OML_O39_INSURANCE)super.removeRepetition("INSURANCE", rep);
415    }
416
417
418
419    /**
420     * Returns
421     * GT1 (Guarantor) - creates it if necessary
422     */
423    public GT1 getGT1() { 
424       GT1 retVal = getTyped("GT1", GT1.class);
425       return retVal;
426    }
427
428
429
430
431    /**
432     * Returns
433     * the first repetition of 
434     * AL1 (Patient Allergy Information) - creates it if necessary
435     */
436    public AL1 getAL1() { 
437       AL1 retVal = getTyped("AL1", AL1.class);
438       return retVal;
439    }
440
441
442    /**
443     * Returns a specific repetition of
444     * AL1 (Patient Allergy Information) - creates it if necessary
445     *
446     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
447     * @throws HL7Exception if the repetition requested is more than one 
448     *     greater than the number of existing repetitions.
449     */
450    public AL1 getAL1(int rep) { 
451       AL1 retVal = getTyped("AL1", rep, AL1.class);
452       return retVal;
453    }
454
455    /** 
456     * Returns the number of existing repetitions of AL1 
457     */ 
458    public int getAL1Reps() {  
459        return getReps("AL1");
460    } 
461
462    /** 
463     * <p>
464     * Returns a non-modifiable List containing all current existing repetitions of AL1.
465     * <p>
466     * <p>
467     * Note that unlike {@link #getAL1()}, this method will not create any reps
468     * if none are already present, so an empty list may be returned.
469     * </p>
470     */ 
471    public java.util.List<AL1> getAL1All() throws HL7Exception {
472        return getAllAsList("AL1", AL1.class);
473    } 
474
475    /**
476     * Inserts a specific repetition of AL1 (Patient Allergy Information)
477     * @see AbstractGroup#insertRepetition(Structure, int) 
478     */
479    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
480       super.insertRepetition("AL1", structure, rep);
481    }
482
483
484    /**
485     * Inserts a specific repetition of AL1 (Patient Allergy Information)
486     * @see AbstractGroup#insertRepetition(Structure, int) 
487     */
488    public AL1 insertAL1(int rep) throws HL7Exception { 
489       return (AL1)super.insertRepetition("AL1", rep);
490    }
491
492
493    /**
494     * Removes a specific repetition of AL1 (Patient Allergy Information)
495     * @see AbstractGroup#removeRepetition(String, int) 
496     */
497    public AL1 removeAL1(int rep) throws HL7Exception { 
498       return (AL1)super.removeRepetition("AL1", rep);
499    }
500
501
502
503}
504