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.v25.group;
035
036import ca.uhn.hl7v2.model.v25.segment.*;
037
038import java.util.List;
039
040import ca.uhn.hl7v2.HL7Exception;
041import ca.uhn.hl7v2.parser.ModelClassFactory;
042import ca.uhn.hl7v2.model.*;
043
044/**
045 * <p>Represents a OMG_O19_PATIENT group structure (a Group object).
046 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
047 * This Group contains the following elements:  
048 * </p>
049 * <ul>
050                 * <li>1: PID (Patient Identification) <b> </b></li>
051                 * <li>2: PD1 (Patient Additional Demographic) <b>optional </b></li>
052                 * <li>3: NTE (Notes and Comments) <b>optional repeating</b></li>
053                 * <li>4: NK1 (Next of Kin / Associated Parties) <b>optional repeating</b></li>
054                 * <li>5: OMG_O19_PATIENT_VISIT (a Group object) <b>optional </b></li>
055                 * <li>6: OMG_O19_INSURANCE (a Group object) <b>optional repeating</b></li>
056                 * <li>7: GT1 (Guarantor) <b>optional </b></li>
057                 * <li>8: AL1 (Patient Allergy Information) <b>optional repeating</b></li>
058 * </ul>
059 */
060@SuppressWarnings("unused")
061public class OMG_O19_PATIENT extends AbstractGroup {
062
063    /** 
064     * Creates a new OMG_O19_PATIENT group
065     */
066    public OMG_O19_PATIENT(Group parent, ModelClassFactory factory) {
067       super(parent, factory);
068       init(factory);
069    }
070
071    private void init(ModelClassFactory factory) {
072       try {
073                          this.add(PID.class, true, false);
074                          this.add(PD1.class, false, false);
075                          this.add(NTE.class, false, true);
076                          this.add(NK1.class, false, true);
077                          this.add(OMG_O19_PATIENT_VISIT.class, false, false);
078                          this.add(OMG_O19_INSURANCE.class, false, true);
079                          this.add(GT1.class, false, false);
080                          this.add(AL1.class, false, true);
081       } catch(HL7Exception e) {
082          log.error("Unexpected error creating OMG_O19_PATIENT - this is probably a bug in the source code generator.", e);
083       }
084    }
085
086    /** 
087     * Returns "2.5"
088     */
089    public String getVersion() {
090       return "2.5";
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     * NTE (Notes and Comments) - creates it if necessary
123     */
124    public NTE getNTE() { 
125       NTE retVal = getTyped("NTE", NTE.class);
126       return retVal;
127    }
128
129
130    /**
131     * Returns a specific repetition of
132     * NTE (Notes and Comments) - 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 NTE getNTE(int rep) { 
139       NTE retVal = getTyped("NTE", rep, NTE.class);
140       return retVal;
141    }
142
143    /** 
144     * Returns the number of existing repetitions of NTE 
145     */ 
146    public int getNTEReps() {  
147        return getReps("NTE");
148    } 
149
150    /** 
151     * <p>
152     * Returns a non-modifiable List containing all current existing repetitions of NTE.
153     * <p>
154     * <p>
155     * Note that unlike {@link #getNTE()}, 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 List<NTE> getNTEAll() throws HL7Exception {
160        return getAllAsList("NTE", NTE.class);
161    } 
162
163    /**
164     * Inserts a specific repetition of NTE (Notes and Comments)
165     * @see AbstractGroup#insertRepetition(Structure, int) 
166     */
167    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
168       super.insertRepetition("NTE", structure, rep);
169    }
170
171
172    /**
173     * Inserts a specific repetition of NTE (Notes and Comments)
174     * @see AbstractGroup#insertRepetition(Structure, int) 
175     */
176    public NTE insertNTE(int rep) throws HL7Exception { 
177       return (NTE)super.insertRepetition("NTE", rep);
178    }
179
180
181    /**
182     * Removes a specific repetition of NTE (Notes and Comments)
183     * @see AbstractGroup#removeRepetition(String, int) 
184     */
185    public NTE removeNTE(int rep) throws HL7Exception { 
186       return (NTE)super.removeRepetition("NTE", rep);
187    }
188
189
190
191    /**
192     * Returns
193     * the first repetition of 
194     * NK1 (Next of Kin / Associated Parties) - creates it if necessary
195     */
196    public NK1 getNK1() { 
197       NK1 retVal = getTyped("NK1", NK1.class);
198       return retVal;
199    }
200
201
202    /**
203     * Returns a specific repetition of
204     * NK1 (Next of Kin / Associated Parties) - 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 NK1 getNK1(int rep) { 
211       NK1 retVal = getTyped("NK1", rep, NK1.class);
212       return retVal;
213    }
214
215    /** 
216     * Returns the number of existing repetitions of NK1 
217     */ 
218    public int getNK1Reps() {  
219        return getReps("NK1");
220    } 
221
222    /** 
223     * <p>
224     * Returns a non-modifiable List containing all current existing repetitions of NK1.
225     * <p>
226     * <p>
227     * Note that unlike {@link #getNK1()}, 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 List<NK1> getNK1All() throws HL7Exception {
232        return getAllAsList("NK1", NK1.class);
233    } 
234
235    /**
236     * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
237     * @see AbstractGroup#insertRepetition(Structure, int) 
238     */
239    public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
240       super.insertRepetition("NK1", structure, rep);
241    }
242
243
244    /**
245     * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
246     * @see AbstractGroup#insertRepetition(Structure, int) 
247     */
248    public NK1 insertNK1(int rep) throws HL7Exception { 
249       return (NK1)super.insertRepetition("NK1", rep);
250    }
251
252
253    /**
254     * Removes a specific repetition of NK1 (Next of Kin / Associated Parties)
255     * @see AbstractGroup#removeRepetition(String, int) 
256     */
257    public NK1 removeNK1(int rep) throws HL7Exception { 
258       return (NK1)super.removeRepetition("NK1", rep);
259    }
260
261
262
263    /**
264     * Returns
265     * PATIENT_VISIT (a Group object) - creates it if necessary
266     */
267    public OMG_O19_PATIENT_VISIT getPATIENT_VISIT() { 
268       OMG_O19_PATIENT_VISIT retVal = getTyped("PATIENT_VISIT", OMG_O19_PATIENT_VISIT.class);
269       return retVal;
270    }
271
272
273
274
275    /**
276     * Returns
277     * the first repetition of 
278     * INSURANCE (a Group object) - creates it if necessary
279     */
280    public OMG_O19_INSURANCE getINSURANCE() { 
281       OMG_O19_INSURANCE retVal = getTyped("INSURANCE", OMG_O19_INSURANCE.class);
282       return retVal;
283    }
284
285
286    /**
287     * Returns a specific repetition of
288     * INSURANCE (a Group object) - creates it if necessary
289     *
290     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
291     * @throws HL7Exception if the repetition requested is more than one 
292     *     greater than the number of existing repetitions.
293     */
294    public OMG_O19_INSURANCE getINSURANCE(int rep) { 
295       OMG_O19_INSURANCE retVal = getTyped("INSURANCE", rep, OMG_O19_INSURANCE.class);
296       return retVal;
297    }
298
299    /** 
300     * Returns the number of existing repetitions of INSURANCE 
301     */ 
302    public int getINSURANCEReps() {  
303        return getReps("INSURANCE");
304    } 
305
306    /** 
307     * <p>
308     * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
309     * <p>
310     * <p>
311     * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
312     * if none are already present, so an empty list may be returned.
313     * </p>
314     */ 
315    public List<OMG_O19_INSURANCE> getINSURANCEAll() throws HL7Exception {
316        return getAllAsList("INSURANCE", OMG_O19_INSURANCE.class);
317    } 
318
319    /**
320     * Inserts a specific repetition of INSURANCE (a Group object)
321     * @see AbstractGroup#insertRepetition(Structure, int) 
322     */
323    public void insertINSURANCE(OMG_O19_INSURANCE structure, int rep) throws HL7Exception { 
324       super.insertRepetition("INSURANCE", structure, rep);
325    }
326
327
328    /**
329     * Inserts a specific repetition of INSURANCE (a Group object)
330     * @see AbstractGroup#insertRepetition(Structure, int) 
331     */
332    public OMG_O19_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
333       return (OMG_O19_INSURANCE)super.insertRepetition("INSURANCE", rep);
334    }
335
336
337    /**
338     * Removes a specific repetition of INSURANCE (a Group object)
339     * @see AbstractGroup#removeRepetition(String, int) 
340     */
341    public OMG_O19_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
342       return (OMG_O19_INSURANCE)super.removeRepetition("INSURANCE", rep);
343    }
344
345
346
347    /**
348     * Returns
349     * GT1 (Guarantor) - creates it if necessary
350     */
351    public GT1 getGT1() { 
352       GT1 retVal = getTyped("GT1", GT1.class);
353       return retVal;
354    }
355
356
357
358
359    /**
360     * Returns
361     * the first repetition of 
362     * AL1 (Patient Allergy Information) - creates it if necessary
363     */
364    public AL1 getAL1() { 
365       AL1 retVal = getTyped("AL1", AL1.class);
366       return retVal;
367    }
368
369
370    /**
371     * Returns a specific repetition of
372     * AL1 (Patient Allergy Information) - creates it if necessary
373     *
374     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
375     * @throws HL7Exception if the repetition requested is more than one 
376     *     greater than the number of existing repetitions.
377     */
378    public AL1 getAL1(int rep) { 
379       AL1 retVal = getTyped("AL1", rep, AL1.class);
380       return retVal;
381    }
382
383    /** 
384     * Returns the number of existing repetitions of AL1 
385     */ 
386    public int getAL1Reps() {  
387        return getReps("AL1");
388    } 
389
390    /** 
391     * <p>
392     * Returns a non-modifiable List containing all current existing repetitions of AL1.
393     * <p>
394     * <p>
395     * Note that unlike {@link #getAL1()}, this method will not create any reps
396     * if none are already present, so an empty list may be returned.
397     * </p>
398     */ 
399    public List<AL1> getAL1All() throws HL7Exception {
400        return getAllAsList("AL1", AL1.class);
401    } 
402
403    /**
404     * Inserts a specific repetition of AL1 (Patient Allergy Information)
405     * @see AbstractGroup#insertRepetition(Structure, int) 
406     */
407    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
408       super.insertRepetition("AL1", structure, rep);
409    }
410
411
412    /**
413     * Inserts a specific repetition of AL1 (Patient Allergy Information)
414     * @see AbstractGroup#insertRepetition(Structure, int) 
415     */
416    public AL1 insertAL1(int rep) throws HL7Exception { 
417       return (AL1)super.insertRepetition("AL1", rep);
418    }
419
420
421    /**
422     * Removes a specific repetition of AL1 (Patient Allergy Information)
423     * @see AbstractGroup#removeRepetition(String, int) 
424     */
425    public AL1 removeAL1(int rep) throws HL7Exception { 
426       return (AL1)super.removeRepetition("AL1", rep);
427    }
428
429
430
431}
432