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.v26.message;
035
036import ca.uhn.hl7v2.model.v26.group.*;
037import ca.uhn.hl7v2.model.v26.segment.*;
038
039import java.util.List;
040
041import ca.uhn.hl7v2.HL7Exception;
042import ca.uhn.hl7v2.parser.ModelClassFactory;
043import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
044import ca.uhn.hl7v2.model.AbstractMessage;
045
046/**
047 * <p>Represents a ORU_R30 message structure (see chapter 7.3.4). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (Message Header) <b> </b></li>
051                 * <li>2: SFT (Software Segment) <b>optional repeating</b></li>
052                 * <li>3: UAC (User Authentication Credential Segment) <b>optional </b></li>
053                 * <li>4: PID (Patient Identification) <b> </b></li>
054                 * <li>5: PD1 (Patient Additional Demographic) <b>optional </b></li>
055                 * <li>6: OBX (Observation/Result) <b>optional repeating</b></li>
056                 * <li>7: ORU_R30_VISIT (a Group object) <b>optional </b></li>
057                 * <li>8: ORC (Common Order) <b> </b></li>
058                 * <li>9: OBR (Observation Request) <b> </b></li>
059                 * <li>10: NTE (Notes and Comments) <b>optional repeating</b></li>
060                 * <li>11: ROL (Role) <b>optional repeating</b></li>
061                 * <li>12: ORU_R30_TIMING_QTY (a Group object) <b>optional repeating</b></li>
062                 * <li>13: ORU_R30_OBSERVATION (a Group object) <b> repeating</b></li>
063 * </ul>
064 */
065@SuppressWarnings("unused")
066public class ORU_R30 extends AbstractMessage  {
067
068    /**
069     * Creates a new ORU_R30 message with DefaultModelClassFactory. 
070     */ 
071    public ORU_R30() { 
072       this(new DefaultModelClassFactory());
073    }
074
075    /** 
076     * Creates a new ORU_R30 message with custom ModelClassFactory.
077     */
078    public ORU_R30(ModelClassFactory factory) {
079       super(factory);
080       init(factory);
081    }
082
083    private void init(ModelClassFactory factory) {
084       try {
085                          this.add(MSH.class, true, false);
086                          this.add(SFT.class, false, true);
087                          this.add(UAC.class, false, false);
088                          this.add(PID.class, true, false);
089                          this.add(PD1.class, false, false);
090                          this.add(OBX.class, false, true);
091                          this.add(ORU_R30_VISIT.class, false, false);
092                          this.add(ORC.class, true, false);
093                          this.add(OBR.class, true, false);
094                          this.add(NTE.class, false, true);
095                          this.add(ROL.class, false, true);
096                          this.add(ORU_R30_TIMING_QTY.class, false, true);
097                          this.add(ORU_R30_OBSERVATION.class, true, true);
098       } catch(HL7Exception e) {
099          log.error("Unexpected error creating ORU_R30 - this is probably a bug in the source code generator.", e);
100       }
101    }
102
103    /** 
104     * Returns "2.6"
105     */
106    public String getVersion() {
107       return "2.6";
108    }
109
110
111
112    /**
113     * Returns
114     * MSH (Message Header) - creates it if necessary
115     */
116    public MSH getMSH() { 
117       return getTyped("MSH", MSH.class);
118    }
119
120
121
122
123    /**
124     * Returns
125     * the first repetition of 
126     * SFT (Software Segment) - creates it if necessary
127     */
128    public SFT getSFT() { 
129       return getTyped("SFT", SFT.class);
130    }
131
132
133    /**
134     * Returns a specific repetition of
135     * SFT (Software Segment) - creates it if necessary
136     *
137     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
138     * @throws HL7Exception if the repetition requested is more than one 
139     *     greater than the number of existing repetitions.
140     */
141    public SFT getSFT(int rep) { 
142       return getTyped("SFT", rep, SFT.class);
143    }
144
145    /** 
146     * Returns the number of existing repetitions of SFT 
147     */ 
148    public int getSFTReps() { 
149        return getReps("SFT");
150    } 
151
152    /** 
153     * <p>
154     * Returns a non-modifiable List containing all current existing repetitions of SFT.
155     * <p>
156     * <p>
157     * Note that unlike {@link #getSFT()}, 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 List<SFT> getSFTAll() throws HL7Exception {
162        return getAllAsList("SFT", SFT.class);
163    } 
164
165    /**
166     * Inserts a specific repetition of SFT (Software Segment)
167     * @see AbstractGroup#insertRepetition(Structure, int) 
168     */
169    public void insertSFT(SFT structure, int rep) throws HL7Exception { 
170       super.insertRepetition( "SFT", structure, rep);
171    }
172
173
174    /**
175     * Inserts a specific repetition of SFT (Software Segment)
176     * @see AbstractGroup#insertRepetition(Structure, int) 
177     */
178    public SFT insertSFT(int rep) throws HL7Exception { 
179       return (SFT)super.insertRepetition("SFT", rep);
180    }
181
182
183    /**
184     * Removes a specific repetition of SFT (Software Segment)
185     * @see AbstractGroup#removeRepetition(String, int) 
186     */
187    public SFT removeSFT(int rep) throws HL7Exception { 
188       return (SFT)super.removeRepetition("SFT", rep);
189    }
190
191
192
193    /**
194     * Returns
195     * UAC (User Authentication Credential Segment) - creates it if necessary
196     */
197    public UAC getUAC() { 
198       return getTyped("UAC", UAC.class);
199    }
200
201
202
203
204    /**
205     * Returns
206     * PID (Patient Identification) - creates it if necessary
207     */
208    public PID getPID() { 
209       return getTyped("PID", PID.class);
210    }
211
212
213
214
215    /**
216     * Returns
217     * PD1 (Patient Additional Demographic) - creates it if necessary
218     */
219    public PD1 getPD1() { 
220       return getTyped("PD1", PD1.class);
221    }
222
223
224
225
226    /**
227     * Returns
228     * the first repetition of 
229     * OBX (Observation/Result) - creates it if necessary
230     */
231    public OBX getOBX() { 
232       return getTyped("OBX", OBX.class);
233    }
234
235
236    /**
237     * Returns a specific repetition of
238     * OBX (Observation/Result) - creates it if necessary
239     *
240     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
241     * @throws HL7Exception if the repetition requested is more than one 
242     *     greater than the number of existing repetitions.
243     */
244    public OBX getOBX(int rep) { 
245       return getTyped("OBX", rep, OBX.class);
246    }
247
248    /** 
249     * Returns the number of existing repetitions of OBX 
250     */ 
251    public int getOBXReps() { 
252        return getReps("OBX");
253    } 
254
255    /** 
256     * <p>
257     * Returns a non-modifiable List containing all current existing repetitions of OBX.
258     * <p>
259     * <p>
260     * Note that unlike {@link #getOBX()}, this method will not create any reps
261     * if none are already present, so an empty list may be returned.
262     * </p>
263     */ 
264    public List<OBX> getOBXAll() throws HL7Exception {
265        return getAllAsList("OBX", OBX.class);
266    } 
267
268    /**
269     * Inserts a specific repetition of OBX (Observation/Result)
270     * @see AbstractGroup#insertRepetition(Structure, int) 
271     */
272    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
273       super.insertRepetition( "OBX", structure, rep);
274    }
275
276
277    /**
278     * Inserts a specific repetition of OBX (Observation/Result)
279     * @see AbstractGroup#insertRepetition(Structure, int) 
280     */
281    public OBX insertOBX(int rep) throws HL7Exception { 
282       return (OBX)super.insertRepetition("OBX", rep);
283    }
284
285
286    /**
287     * Removes a specific repetition of OBX (Observation/Result)
288     * @see AbstractGroup#removeRepetition(String, int) 
289     */
290    public OBX removeOBX(int rep) throws HL7Exception { 
291       return (OBX)super.removeRepetition("OBX", rep);
292    }
293
294
295
296    /**
297     * Returns
298     * VISIT (a Group object) - creates it if necessary
299     */
300    public ORU_R30_VISIT getVISIT() { 
301       return getTyped("VISIT", ORU_R30_VISIT.class);
302    }
303
304
305
306
307    /**
308     * Returns
309     * ORC (Common Order) - creates it if necessary
310     */
311    public ORC getORC() { 
312       return getTyped("ORC", ORC.class);
313    }
314
315
316
317
318    /**
319     * Returns
320     * OBR (Observation Request) - creates it if necessary
321     */
322    public OBR getOBR() { 
323       return getTyped("OBR", OBR.class);
324    }
325
326
327
328
329    /**
330     * Returns
331     * the first repetition of 
332     * NTE (Notes and Comments) - creates it if necessary
333     */
334    public NTE getNTE() { 
335       return getTyped("NTE", NTE.class);
336    }
337
338
339    /**
340     * Returns a specific repetition of
341     * NTE (Notes and Comments) - creates it if necessary
342     *
343     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
344     * @throws HL7Exception if the repetition requested is more than one 
345     *     greater than the number of existing repetitions.
346     */
347    public NTE getNTE(int rep) { 
348       return getTyped("NTE", rep, NTE.class);
349    }
350
351    /** 
352     * Returns the number of existing repetitions of NTE 
353     */ 
354    public int getNTEReps() { 
355        return getReps("NTE");
356    } 
357
358    /** 
359     * <p>
360     * Returns a non-modifiable List containing all current existing repetitions of NTE.
361     * <p>
362     * <p>
363     * Note that unlike {@link #getNTE()}, this method will not create any reps
364     * if none are already present, so an empty list may be returned.
365     * </p>
366     */ 
367    public List<NTE> getNTEAll() throws HL7Exception {
368        return getAllAsList("NTE", NTE.class);
369    } 
370
371    /**
372     * Inserts a specific repetition of NTE (Notes and Comments)
373     * @see AbstractGroup#insertRepetition(Structure, int) 
374     */
375    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
376       super.insertRepetition( "NTE", structure, rep);
377    }
378
379
380    /**
381     * Inserts a specific repetition of NTE (Notes and Comments)
382     * @see AbstractGroup#insertRepetition(Structure, int) 
383     */
384    public NTE insertNTE(int rep) throws HL7Exception { 
385       return (NTE)super.insertRepetition("NTE", rep);
386    }
387
388
389    /**
390     * Removes a specific repetition of NTE (Notes and Comments)
391     * @see AbstractGroup#removeRepetition(String, int) 
392     */
393    public NTE removeNTE(int rep) throws HL7Exception { 
394       return (NTE)super.removeRepetition("NTE", rep);
395    }
396
397
398
399    /**
400     * Returns
401     * the first repetition of 
402     * ROL (Role) - creates it if necessary
403     */
404    public ROL getROL() { 
405       return getTyped("ROL", ROL.class);
406    }
407
408
409    /**
410     * Returns a specific repetition of
411     * ROL (Role) - creates it if necessary
412     *
413     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
414     * @throws HL7Exception if the repetition requested is more than one 
415     *     greater than the number of existing repetitions.
416     */
417    public ROL getROL(int rep) { 
418       return getTyped("ROL", rep, ROL.class);
419    }
420
421    /** 
422     * Returns the number of existing repetitions of ROL 
423     */ 
424    public int getROLReps() { 
425        return getReps("ROL");
426    } 
427
428    /** 
429     * <p>
430     * Returns a non-modifiable List containing all current existing repetitions of ROL.
431     * <p>
432     * <p>
433     * Note that unlike {@link #getROL()}, this method will not create any reps
434     * if none are already present, so an empty list may be returned.
435     * </p>
436     */ 
437    public List<ROL> getROLAll() throws HL7Exception {
438        return getAllAsList("ROL", ROL.class);
439    } 
440
441    /**
442     * Inserts a specific repetition of ROL (Role)
443     * @see AbstractGroup#insertRepetition(Structure, int) 
444     */
445    public void insertROL(ROL structure, int rep) throws HL7Exception { 
446       super.insertRepetition( "ROL", structure, rep);
447    }
448
449
450    /**
451     * Inserts a specific repetition of ROL (Role)
452     * @see AbstractGroup#insertRepetition(Structure, int) 
453     */
454    public ROL insertROL(int rep) throws HL7Exception { 
455       return (ROL)super.insertRepetition("ROL", rep);
456    }
457
458
459    /**
460     * Removes a specific repetition of ROL (Role)
461     * @see AbstractGroup#removeRepetition(String, int) 
462     */
463    public ROL removeROL(int rep) throws HL7Exception { 
464       return (ROL)super.removeRepetition("ROL", rep);
465    }
466
467
468
469    /**
470     * Returns
471     * the first repetition of 
472     * TIMING_QTY (a Group object) - creates it if necessary
473     */
474    public ORU_R30_TIMING_QTY getTIMING_QTY() { 
475       return getTyped("TIMING_QTY", ORU_R30_TIMING_QTY.class);
476    }
477
478
479    /**
480     * Returns a specific repetition of
481     * TIMING_QTY (a Group object) - creates it if necessary
482     *
483     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
484     * @throws HL7Exception if the repetition requested is more than one 
485     *     greater than the number of existing repetitions.
486     */
487    public ORU_R30_TIMING_QTY getTIMING_QTY(int rep) { 
488       return getTyped("TIMING_QTY", rep, ORU_R30_TIMING_QTY.class);
489    }
490
491    /** 
492     * Returns the number of existing repetitions of TIMING_QTY 
493     */ 
494    public int getTIMING_QTYReps() { 
495        return getReps("TIMING_QTY");
496    } 
497
498    /** 
499     * <p>
500     * Returns a non-modifiable List containing all current existing repetitions of TIMING_QTY.
501     * <p>
502     * <p>
503     * Note that unlike {@link #getTIMING_QTY()}, this method will not create any reps
504     * if none are already present, so an empty list may be returned.
505     * </p>
506     */ 
507    public List<ORU_R30_TIMING_QTY> getTIMING_QTYAll() throws HL7Exception {
508        return getAllAsList("TIMING_QTY", ORU_R30_TIMING_QTY.class);
509    } 
510
511    /**
512     * Inserts a specific repetition of TIMING_QTY (a Group object)
513     * @see AbstractGroup#insertRepetition(Structure, int) 
514     */
515    public void insertTIMING_QTY(ORU_R30_TIMING_QTY structure, int rep) throws HL7Exception { 
516       super.insertRepetition( "TIMING_QTY", structure, rep);
517    }
518
519
520    /**
521     * Inserts a specific repetition of TIMING_QTY (a Group object)
522     * @see AbstractGroup#insertRepetition(Structure, int) 
523     */
524    public ORU_R30_TIMING_QTY insertTIMING_QTY(int rep) throws HL7Exception { 
525       return (ORU_R30_TIMING_QTY)super.insertRepetition("TIMING_QTY", rep);
526    }
527
528
529    /**
530     * Removes a specific repetition of TIMING_QTY (a Group object)
531     * @see AbstractGroup#removeRepetition(String, int) 
532     */
533    public ORU_R30_TIMING_QTY removeTIMING_QTY(int rep) throws HL7Exception { 
534       return (ORU_R30_TIMING_QTY)super.removeRepetition("TIMING_QTY", rep);
535    }
536
537
538
539    /**
540     * Returns
541     * the first repetition of 
542     * OBSERVATION (a Group object) - creates it if necessary
543     */
544    public ORU_R30_OBSERVATION getOBSERVATION() { 
545       return getTyped("OBSERVATION", ORU_R30_OBSERVATION.class);
546    }
547
548
549    /**
550     * Returns a specific repetition of
551     * OBSERVATION (a Group object) - creates it if necessary
552     *
553     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
554     * @throws HL7Exception if the repetition requested is more than one 
555     *     greater than the number of existing repetitions.
556     */
557    public ORU_R30_OBSERVATION getOBSERVATION(int rep) { 
558       return getTyped("OBSERVATION", rep, ORU_R30_OBSERVATION.class);
559    }
560
561    /** 
562     * Returns the number of existing repetitions of OBSERVATION 
563     */ 
564    public int getOBSERVATIONReps() { 
565        return getReps("OBSERVATION");
566    } 
567
568    /** 
569     * <p>
570     * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION.
571     * <p>
572     * <p>
573     * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps
574     * if none are already present, so an empty list may be returned.
575     * </p>
576     */ 
577    public List<ORU_R30_OBSERVATION> getOBSERVATIONAll() throws HL7Exception {
578        return getAllAsList("OBSERVATION", ORU_R30_OBSERVATION.class);
579    } 
580
581    /**
582     * Inserts a specific repetition of OBSERVATION (a Group object)
583     * @see AbstractGroup#insertRepetition(Structure, int) 
584     */
585    public void insertOBSERVATION(ORU_R30_OBSERVATION structure, int rep) throws HL7Exception { 
586       super.insertRepetition( "OBSERVATION", structure, rep);
587    }
588
589
590    /**
591     * Inserts a specific repetition of OBSERVATION (a Group object)
592     * @see AbstractGroup#insertRepetition(Structure, int) 
593     */
594    public ORU_R30_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 
595       return (ORU_R30_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
596    }
597
598
599    /**
600     * Removes a specific repetition of OBSERVATION (a Group object)
601     * @see AbstractGroup#removeRepetition(String, int) 
602     */
603    public ORU_R30_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 
604       return (ORU_R30_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
605    }
606
607
608
609}
610