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.v24.group;
035
036import ca.uhn.hl7v2.model.v24.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 PEX_P07_PEX_CAUSE 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: PCR (Possible Causal Relationship) <b> </b></li>
051                 * <li>2: PEX_P07_RX_ORDER (a Group object) <b>optional </b></li>
052                 * <li>3: PEX_P07_RX_ADMINISTRATION (a Group object) <b>optional repeating</b></li>
053                 * <li>4: PRB (Problem Details) <b>optional repeating</b></li>
054                 * <li>5: OBX (Observation/Result) <b>optional repeating</b></li>
055                 * <li>6: NTE (Notes and Comments) <b>optional repeating</b></li>
056                 * <li>7: PEX_P07_ASSOCIATED_PERSON (a Group object) <b>optional </b></li>
057                 * <li>8: PEX_P07_STUDY (a Group object) <b>optional repeating</b></li>
058 * </ul>
059 */
060@SuppressWarnings("unused")
061public class PEX_P07_PEX_CAUSE extends AbstractGroup {
062
063    /** 
064     * Creates a new PEX_P07_PEX_CAUSE group
065     */
066    public PEX_P07_PEX_CAUSE(Group parent, ModelClassFactory factory) {
067       super(parent, factory);
068       init(factory);
069    }
070
071    private void init(ModelClassFactory factory) {
072       try {
073                          this.add(PCR.class, true, false);
074                          this.add(PEX_P07_RX_ORDER.class, false, false);
075                          this.add(PEX_P07_RX_ADMINISTRATION.class, false, true);
076                          this.add(PRB.class, false, true);
077                          this.add(OBX.class, false, true);
078                          this.add(NTE.class, false, true);
079                          this.add(PEX_P07_ASSOCIATED_PERSON.class, false, false);
080                          this.add(PEX_P07_STUDY.class, false, true);
081       } catch(HL7Exception e) {
082          log.error("Unexpected error creating PEX_P07_PEX_CAUSE - this is probably a bug in the source code generator.", e);
083       }
084    }
085
086    /** 
087     * Returns "2.4"
088     */
089    public String getVersion() {
090       return "2.4";
091    }
092
093
094
095    /**
096     * Returns
097     * PCR (Possible Causal Relationship) - creates it if necessary
098     */
099    public PCR getPCR() { 
100       PCR retVal = getTyped("PCR", PCR.class);
101       return retVal;
102    }
103
104
105
106
107    /**
108     * Returns
109     * RX_ORDER (a Group object) - creates it if necessary
110     */
111    public PEX_P07_RX_ORDER getRX_ORDER() { 
112       PEX_P07_RX_ORDER retVal = getTyped("RX_ORDER", PEX_P07_RX_ORDER.class);
113       return retVal;
114    }
115
116
117
118
119    /**
120     * Returns
121     * the first repetition of 
122     * RX_ADMINISTRATION (a Group object) - creates it if necessary
123     */
124    public PEX_P07_RX_ADMINISTRATION getRX_ADMINISTRATION() { 
125       PEX_P07_RX_ADMINISTRATION retVal = getTyped("RX_ADMINISTRATION", PEX_P07_RX_ADMINISTRATION.class);
126       return retVal;
127    }
128
129
130    /**
131     * Returns a specific repetition of
132     * RX_ADMINISTRATION (a Group object) - 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 PEX_P07_RX_ADMINISTRATION getRX_ADMINISTRATION(int rep) { 
139       PEX_P07_RX_ADMINISTRATION retVal = getTyped("RX_ADMINISTRATION", rep, PEX_P07_RX_ADMINISTRATION.class);
140       return retVal;
141    }
142
143    /** 
144     * Returns the number of existing repetitions of RX_ADMINISTRATION 
145     */ 
146    public int getRX_ADMINISTRATIONReps() {  
147        return getReps("RX_ADMINISTRATION");
148    } 
149
150    /** 
151     * <p>
152     * Returns a non-modifiable List containing all current existing repetitions of RX_ADMINISTRATION.
153     * <p>
154     * <p>
155     * Note that unlike {@link #getRX_ADMINISTRATION()}, 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<PEX_P07_RX_ADMINISTRATION> getRX_ADMINISTRATIONAll() throws HL7Exception {
160        return getAllAsList("RX_ADMINISTRATION", PEX_P07_RX_ADMINISTRATION.class);
161    } 
162
163    /**
164     * Inserts a specific repetition of RX_ADMINISTRATION (a Group object)
165     * @see AbstractGroup#insertRepetition(Structure, int) 
166     */
167    public void insertRX_ADMINISTRATION(PEX_P07_RX_ADMINISTRATION structure, int rep) throws HL7Exception { 
168       super.insertRepetition("RX_ADMINISTRATION", structure, rep);
169    }
170
171
172    /**
173     * Inserts a specific repetition of RX_ADMINISTRATION (a Group object)
174     * @see AbstractGroup#insertRepetition(Structure, int) 
175     */
176    public PEX_P07_RX_ADMINISTRATION insertRX_ADMINISTRATION(int rep) throws HL7Exception { 
177       return (PEX_P07_RX_ADMINISTRATION)super.insertRepetition("RX_ADMINISTRATION", rep);
178    }
179
180
181    /**
182     * Removes a specific repetition of RX_ADMINISTRATION (a Group object)
183     * @see AbstractGroup#removeRepetition(String, int) 
184     */
185    public PEX_P07_RX_ADMINISTRATION removeRX_ADMINISTRATION(int rep) throws HL7Exception { 
186       return (PEX_P07_RX_ADMINISTRATION)super.removeRepetition("RX_ADMINISTRATION", rep);
187    }
188
189
190
191    /**
192     * Returns
193     * the first repetition of 
194     * PRB (Problem Details) - creates it if necessary
195     */
196    public PRB getPRB() { 
197       PRB retVal = getTyped("PRB", PRB.class);
198       return retVal;
199    }
200
201
202    /**
203     * Returns a specific repetition of
204     * PRB (Problem Details) - 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 PRB getPRB(int rep) { 
211       PRB retVal = getTyped("PRB", rep, PRB.class);
212       return retVal;
213    }
214
215    /** 
216     * Returns the number of existing repetitions of PRB 
217     */ 
218    public int getPRBReps() {  
219        return getReps("PRB");
220    } 
221
222    /** 
223     * <p>
224     * Returns a non-modifiable List containing all current existing repetitions of PRB.
225     * <p>
226     * <p>
227     * Note that unlike {@link #getPRB()}, 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<PRB> getPRBAll() throws HL7Exception {
232        return getAllAsList("PRB", PRB.class);
233    } 
234
235    /**
236     * Inserts a specific repetition of PRB (Problem Details)
237     * @see AbstractGroup#insertRepetition(Structure, int) 
238     */
239    public void insertPRB(PRB structure, int rep) throws HL7Exception { 
240       super.insertRepetition("PRB", structure, rep);
241    }
242
243
244    /**
245     * Inserts a specific repetition of PRB (Problem Details)
246     * @see AbstractGroup#insertRepetition(Structure, int) 
247     */
248    public PRB insertPRB(int rep) throws HL7Exception { 
249       return (PRB)super.insertRepetition("PRB", rep);
250    }
251
252
253    /**
254     * Removes a specific repetition of PRB (Problem Details)
255     * @see AbstractGroup#removeRepetition(String, int) 
256     */
257    public PRB removePRB(int rep) throws HL7Exception { 
258       return (PRB)super.removeRepetition("PRB", rep);
259    }
260
261
262
263    /**
264     * Returns
265     * the first repetition of 
266     * OBX (Observation/Result) - creates it if necessary
267     */
268    public OBX getOBX() { 
269       OBX retVal = getTyped("OBX", OBX.class);
270       return retVal;
271    }
272
273
274    /**
275     * Returns a specific repetition of
276     * OBX (Observation/Result) - 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 OBX getOBX(int rep) { 
283       OBX retVal = getTyped("OBX", rep, OBX.class);
284       return retVal;
285    }
286
287    /** 
288     * Returns the number of existing repetitions of OBX 
289     */ 
290    public int getOBXReps() {  
291        return getReps("OBX");
292    } 
293
294    /** 
295     * <p>
296     * Returns a non-modifiable List containing all current existing repetitions of OBX.
297     * <p>
298     * <p>
299     * Note that unlike {@link #getOBX()}, 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 List<OBX> getOBXAll() throws HL7Exception {
304        return getAllAsList("OBX", OBX.class);
305    } 
306
307    /**
308     * Inserts a specific repetition of OBX (Observation/Result)
309     * @see AbstractGroup#insertRepetition(Structure, int) 
310     */
311    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
312       super.insertRepetition("OBX", structure, rep);
313    }
314
315
316    /**
317     * Inserts a specific repetition of OBX (Observation/Result)
318     * @see AbstractGroup#insertRepetition(Structure, int) 
319     */
320    public OBX insertOBX(int rep) throws HL7Exception { 
321       return (OBX)super.insertRepetition("OBX", rep);
322    }
323
324
325    /**
326     * Removes a specific repetition of OBX (Observation/Result)
327     * @see AbstractGroup#removeRepetition(String, int) 
328     */
329    public OBX removeOBX(int rep) throws HL7Exception { 
330       return (OBX)super.removeRepetition("OBX", rep);
331    }
332
333
334
335    /**
336     * Returns
337     * the first repetition of 
338     * NTE (Notes and Comments) - creates it if necessary
339     */
340    public NTE getNTE() { 
341       NTE retVal = getTyped("NTE", NTE.class);
342       return retVal;
343    }
344
345
346    /**
347     * Returns a specific repetition of
348     * NTE (Notes and Comments) - creates it if necessary
349     *
350     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
351     * @throws HL7Exception if the repetition requested is more than one 
352     *     greater than the number of existing repetitions.
353     */
354    public NTE getNTE(int rep) { 
355       NTE retVal = getTyped("NTE", rep, NTE.class);
356       return retVal;
357    }
358
359    /** 
360     * Returns the number of existing repetitions of NTE 
361     */ 
362    public int getNTEReps() {  
363        return getReps("NTE");
364    } 
365
366    /** 
367     * <p>
368     * Returns a non-modifiable List containing all current existing repetitions of NTE.
369     * <p>
370     * <p>
371     * Note that unlike {@link #getNTE()}, this method will not create any reps
372     * if none are already present, so an empty list may be returned.
373     * </p>
374     */ 
375    public List<NTE> getNTEAll() throws HL7Exception {
376        return getAllAsList("NTE", NTE.class);
377    } 
378
379    /**
380     * Inserts a specific repetition of NTE (Notes and Comments)
381     * @see AbstractGroup#insertRepetition(Structure, int) 
382     */
383    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
384       super.insertRepetition("NTE", structure, rep);
385    }
386
387
388    /**
389     * Inserts a specific repetition of NTE (Notes and Comments)
390     * @see AbstractGroup#insertRepetition(Structure, int) 
391     */
392    public NTE insertNTE(int rep) throws HL7Exception { 
393       return (NTE)super.insertRepetition("NTE", rep);
394    }
395
396
397    /**
398     * Removes a specific repetition of NTE (Notes and Comments)
399     * @see AbstractGroup#removeRepetition(String, int) 
400     */
401    public NTE removeNTE(int rep) throws HL7Exception { 
402       return (NTE)super.removeRepetition("NTE", rep);
403    }
404
405
406
407    /**
408     * Returns
409     * ASSOCIATED_PERSON (a Group object) - creates it if necessary
410     */
411    public PEX_P07_ASSOCIATED_PERSON getASSOCIATED_PERSON() { 
412       PEX_P07_ASSOCIATED_PERSON retVal = getTyped("ASSOCIATED_PERSON", PEX_P07_ASSOCIATED_PERSON.class);
413       return retVal;
414    }
415
416
417
418
419    /**
420     * Returns
421     * the first repetition of 
422     * STUDY (a Group object) - creates it if necessary
423     */
424    public PEX_P07_STUDY getSTUDY() { 
425       PEX_P07_STUDY retVal = getTyped("STUDY", PEX_P07_STUDY.class);
426       return retVal;
427    }
428
429
430    /**
431     * Returns a specific repetition of
432     * STUDY (a Group object) - creates it if necessary
433     *
434     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
435     * @throws HL7Exception if the repetition requested is more than one 
436     *     greater than the number of existing repetitions.
437     */
438    public PEX_P07_STUDY getSTUDY(int rep) { 
439       PEX_P07_STUDY retVal = getTyped("STUDY", rep, PEX_P07_STUDY.class);
440       return retVal;
441    }
442
443    /** 
444     * Returns the number of existing repetitions of STUDY 
445     */ 
446    public int getSTUDYReps() {  
447        return getReps("STUDY");
448    } 
449
450    /** 
451     * <p>
452     * Returns a non-modifiable List containing all current existing repetitions of STUDY.
453     * <p>
454     * <p>
455     * Note that unlike {@link #getSTUDY()}, this method will not create any reps
456     * if none are already present, so an empty list may be returned.
457     * </p>
458     */ 
459    public List<PEX_P07_STUDY> getSTUDYAll() throws HL7Exception {
460        return getAllAsList("STUDY", PEX_P07_STUDY.class);
461    } 
462
463    /**
464     * Inserts a specific repetition of STUDY (a Group object)
465     * @see AbstractGroup#insertRepetition(Structure, int) 
466     */
467    public void insertSTUDY(PEX_P07_STUDY structure, int rep) throws HL7Exception { 
468       super.insertRepetition("STUDY", structure, rep);
469    }
470
471
472    /**
473     * Inserts a specific repetition of STUDY (a Group object)
474     * @see AbstractGroup#insertRepetition(Structure, int) 
475     */
476    public PEX_P07_STUDY insertSTUDY(int rep) throws HL7Exception { 
477       return (PEX_P07_STUDY)super.insertRepetition("STUDY", rep);
478    }
479
480
481    /**
482     * Removes a specific repetition of STUDY (a Group object)
483     * @see AbstractGroup#removeRepetition(String, int) 
484     */
485    public PEX_P07_STUDY removeSTUDY(int rep) throws HL7Exception { 
486       return (PEX_P07_STUDY)super.removeRepetition("STUDY", rep);
487    }
488
489
490
491}
492