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 EHC_E01_PATIENT_INFO 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>  choice</b></li>
049                         * <li>2: PV1 (Patient Visit) <b>optional  choice</b></li>
050                         * <li>3: PV2 (Patient Visit - Additional Information) <b>optional  choice</b></li>
051                         * <li>4: ACC (Accident) <b>optional repeating choice</b></li>
052                         * <li>5: EHC_E01_INSURANCE (a Group object) <b> repeating </b></li>
053                         * <li>6: EHC_E01_DIAGNOSIS (a Group object) <b>optional repeating </b></li>
054                         * <li>7: OBX (Observation/Result) <b>optional repeating choice</b></li>
055 * </ul>
056 * <p>
057 * Note that this structure has "choice" elements. This means that one of the 
058 * structures above marked as "choice" must be present, but no more than one.
059 * </p> 
060 */
061//@SuppressWarnings("unused")
062public class EHC_E01_PATIENT_INFO extends AbstractGroup {
063
064    /** 
065     * Creates a new EHC_E01_PATIENT_INFO group
066     */
067    public EHC_E01_PATIENT_INFO(Group parent, ModelClassFactory factory) {
068       super(parent, factory);
069       init(factory);
070    }
071
072    private void init(ModelClassFactory factory) {
073       try {
074                                  this.add(PID.class, true, false, true);
075                                  this.add(PV1.class, false, false, true);
076                                  this.add(PV2.class, false, false, true);
077                                  this.add(ACC.class, false, true, true);
078                                  this.add(EHC_E01_INSURANCE.class, true, true, false);
079                                  this.add(EHC_E01_DIAGNOSIS.class, false, true, false);
080                                  this.add(OBX.class, false, true, true);
081       } catch(HL7Exception e) {
082          log.error("Unexpected error creating EHC_E01_PATIENT_INFO - 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     * PV1 (Patient Visit) - creates it if necessary
110     */
111    public PV1 getPV1() { 
112       PV1 retVal = getTyped("PV1", PV1.class);
113       return retVal;
114    }
115
116
117
118
119    /**
120     * Returns
121     * PV2 (Patient Visit - Additional Information) - creates it if necessary
122     */
123    public PV2 getPV2() { 
124       PV2 retVal = getTyped("PV2", PV2.class);
125       return retVal;
126    }
127
128
129
130
131    /**
132     * Returns
133     * the first repetition of 
134     * ACC (Accident) - creates it if necessary
135     */
136    public ACC getACC() { 
137       ACC retVal = getTyped("ACC", ACC.class);
138       return retVal;
139    }
140
141
142    /**
143     * Returns a specific repetition of
144     * ACC (Accident) - creates it if necessary
145     *
146     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
147     * @throws HL7Exception if the repetition requested is more than one 
148     *     greater than the number of existing repetitions.
149     */
150    public ACC getACC(int rep) { 
151       ACC retVal = getTyped("ACC", rep, ACC.class);
152       return retVal;
153    }
154
155    /** 
156     * Returns the number of existing repetitions of ACC 
157     */ 
158    public int getACCReps() {  
159        return getReps("ACC");
160    } 
161
162    /** 
163     * <p>
164     * Returns a non-modifiable List containing all current existing repetitions of ACC.
165     * <p>
166     * <p>
167     * Note that unlike {@link #getACC()}, this method will not create any reps
168     * if none are already present, so an empty list may be returned.
169     * </p>
170     */ 
171    public java.util.List<ACC> getACCAll() throws HL7Exception {
172        return getAllAsList("ACC", ACC.class);
173    } 
174
175    /**
176     * Inserts a specific repetition of ACC (Accident)
177     * @see AbstractGroup#insertRepetition(Structure, int) 
178     */
179    public void insertACC(ACC structure, int rep) throws HL7Exception { 
180       super.insertRepetition("ACC", structure, rep);
181    }
182
183
184    /**
185     * Inserts a specific repetition of ACC (Accident)
186     * @see AbstractGroup#insertRepetition(Structure, int) 
187     */
188    public ACC insertACC(int rep) throws HL7Exception { 
189       return (ACC)super.insertRepetition("ACC", rep);
190    }
191
192
193    /**
194     * Removes a specific repetition of ACC (Accident)
195     * @see AbstractGroup#removeRepetition(String, int) 
196     */
197    public ACC removeACC(int rep) throws HL7Exception { 
198       return (ACC)super.removeRepetition("ACC", rep);
199    }
200
201
202
203    /**
204     * Returns
205     * the first repetition of 
206     * INSURANCE (a Group object) - creates it if necessary
207     */
208    public EHC_E01_INSURANCE getINSURANCE() { 
209       EHC_E01_INSURANCE retVal = getTyped("INSURANCE", EHC_E01_INSURANCE.class);
210       return retVal;
211    }
212
213
214    /**
215     * Returns a specific repetition of
216     * INSURANCE (a Group object) - creates it if necessary
217     *
218     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
219     * @throws HL7Exception if the repetition requested is more than one 
220     *     greater than the number of existing repetitions.
221     */
222    public EHC_E01_INSURANCE getINSURANCE(int rep) { 
223       EHC_E01_INSURANCE retVal = getTyped("INSURANCE", rep, EHC_E01_INSURANCE.class);
224       return retVal;
225    }
226
227    /** 
228     * Returns the number of existing repetitions of INSURANCE 
229     */ 
230    public int getINSURANCEReps() {  
231        return getReps("INSURANCE");
232    } 
233
234    /** 
235     * <p>
236     * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
237     * <p>
238     * <p>
239     * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
240     * if none are already present, so an empty list may be returned.
241     * </p>
242     */ 
243    public java.util.List<EHC_E01_INSURANCE> getINSURANCEAll() throws HL7Exception {
244        return getAllAsList("INSURANCE", EHC_E01_INSURANCE.class);
245    } 
246
247    /**
248     * Inserts a specific repetition of INSURANCE (a Group object)
249     * @see AbstractGroup#insertRepetition(Structure, int) 
250     */
251    public void insertINSURANCE(EHC_E01_INSURANCE structure, int rep) throws HL7Exception { 
252       super.insertRepetition("INSURANCE", structure, rep);
253    }
254
255
256    /**
257     * Inserts a specific repetition of INSURANCE (a Group object)
258     * @see AbstractGroup#insertRepetition(Structure, int) 
259     */
260    public EHC_E01_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
261       return (EHC_E01_INSURANCE)super.insertRepetition("INSURANCE", rep);
262    }
263
264
265    /**
266     * Removes a specific repetition of INSURANCE (a Group object)
267     * @see AbstractGroup#removeRepetition(String, int) 
268     */
269    public EHC_E01_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
270       return (EHC_E01_INSURANCE)super.removeRepetition("INSURANCE", rep);
271    }
272
273
274
275    /**
276     * Returns
277     * the first repetition of 
278     * DIAGNOSIS (a Group object) - creates it if necessary
279     */
280    public EHC_E01_DIAGNOSIS getDIAGNOSIS() { 
281       EHC_E01_DIAGNOSIS retVal = getTyped("DIAGNOSIS", EHC_E01_DIAGNOSIS.class);
282       return retVal;
283    }
284
285
286    /**
287     * Returns a specific repetition of
288     * DIAGNOSIS (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 EHC_E01_DIAGNOSIS getDIAGNOSIS(int rep) { 
295       EHC_E01_DIAGNOSIS retVal = getTyped("DIAGNOSIS", rep, EHC_E01_DIAGNOSIS.class);
296       return retVal;
297    }
298
299    /** 
300     * Returns the number of existing repetitions of DIAGNOSIS 
301     */ 
302    public int getDIAGNOSISReps() {  
303        return getReps("DIAGNOSIS");
304    } 
305
306    /** 
307     * <p>
308     * Returns a non-modifiable List containing all current existing repetitions of DIAGNOSIS.
309     * <p>
310     * <p>
311     * Note that unlike {@link #getDIAGNOSIS()}, 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 java.util.List<EHC_E01_DIAGNOSIS> getDIAGNOSISAll() throws HL7Exception {
316        return getAllAsList("DIAGNOSIS", EHC_E01_DIAGNOSIS.class);
317    } 
318
319    /**
320     * Inserts a specific repetition of DIAGNOSIS (a Group object)
321     * @see AbstractGroup#insertRepetition(Structure, int) 
322     */
323    public void insertDIAGNOSIS(EHC_E01_DIAGNOSIS structure, int rep) throws HL7Exception { 
324       super.insertRepetition("DIAGNOSIS", structure, rep);
325    }
326
327
328    /**
329     * Inserts a specific repetition of DIAGNOSIS (a Group object)
330     * @see AbstractGroup#insertRepetition(Structure, int) 
331     */
332    public EHC_E01_DIAGNOSIS insertDIAGNOSIS(int rep) throws HL7Exception { 
333       return (EHC_E01_DIAGNOSIS)super.insertRepetition("DIAGNOSIS", rep);
334    }
335
336
337    /**
338     * Removes a specific repetition of DIAGNOSIS (a Group object)
339     * @see AbstractGroup#removeRepetition(String, int) 
340     */
341    public EHC_E01_DIAGNOSIS removeDIAGNOSIS(int rep) throws HL7Exception { 
342       return (EHC_E01_DIAGNOSIS)super.removeRepetition("DIAGNOSIS", rep);
343    }
344
345
346
347    /**
348     * Returns
349     * the first repetition of 
350     * OBX (Observation/Result) - creates it if necessary
351     */
352    public OBX getOBX() { 
353       OBX retVal = getTyped("OBX", OBX.class);
354       return retVal;
355    }
356
357
358    /**
359     * Returns a specific repetition of
360     * OBX (Observation/Result) - 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 OBX getOBX(int rep) { 
367       OBX retVal = getTyped("OBX", rep, OBX.class);
368       return retVal;
369    }
370
371    /** 
372     * Returns the number of existing repetitions of OBX 
373     */ 
374    public int getOBXReps() {  
375        return getReps("OBX");
376    } 
377
378    /** 
379     * <p>
380     * Returns a non-modifiable List containing all current existing repetitions of OBX.
381     * <p>
382     * <p>
383     * Note that unlike {@link #getOBX()}, 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<OBX> getOBXAll() throws HL7Exception {
388        return getAllAsList("OBX", OBX.class);
389    } 
390
391    /**
392     * Inserts a specific repetition of OBX (Observation/Result)
393     * @see AbstractGroup#insertRepetition(Structure, int) 
394     */
395    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
396       super.insertRepetition("OBX", structure, rep);
397    }
398
399
400    /**
401     * Inserts a specific repetition of OBX (Observation/Result)
402     * @see AbstractGroup#insertRepetition(Structure, int) 
403     */
404    public OBX insertOBX(int rep) throws HL7Exception { 
405       return (OBX)super.insertRepetition("OBX", rep);
406    }
407
408
409    /**
410     * Removes a specific repetition of OBX (Observation/Result)
411     * @see AbstractGroup#removeRepetition(String, int) 
412     */
413    public OBX removeOBX(int rep) throws HL7Exception { 
414       return (OBX)super.removeRepetition("OBX", rep);
415    }
416
417
418
419}
420