View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v24.message;
35  
36  import ca.uhn.hl7v2.model.v24.group.*;
37  import ca.uhn.hl7v2.model.v24.segment.*;
38  
39  import ca.uhn.hl7v2.HL7Exception;
40  import ca.uhn.hl7v2.parser.ModelClassFactory;
41  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
42  import ca.uhn.hl7v2.model.*;
43  
44  
45  /**
46   * <p>Represents a RCI_I05 message structure (see chapter 11). This structure contains the 
47   * following elements: </p>
48   * <ul>
49  		                 * <li>1: MSH (Message Header) <b> </b> </li>
50  		                 * <li>2: MSA (Message Acknowledgment) <b> </b> </li>
51  		                 * <li>3: QRD (Original-Style Query Definition) <b> </b> </li>
52  		                 * <li>4: QRF (Original Style Query Filter) <b>optional </b> </li>
53  		                 * <li>5: RCI_I05_PROVIDER (a Group object) <b> repeating</b> </li>
54  		                 * <li>6: PID (Patient identification) <b> </b> </li>
55  		                 * <li>7: DG1 (Diagnosis) <b>optional repeating</b> </li>
56  		                 * <li>8: DRG (Diagnosis Related Group) <b>optional repeating</b> </li>
57  		                 * <li>9: AL1 (Patient allergy information) <b>optional repeating</b> </li>
58  		                 * <li>10: RCI_I05_OBSERVATION (a Group object) <b>optional repeating</b> </li>
59  		                 * <li>11: NTE (Notes and Comments) <b>optional repeating</b> </li>
60   * </ul>
61   */
62  //@SuppressWarnings("unused")
63  public class RCI_I05 extends AbstractMessage  {
64  
65      /**
66       * Creates a new RCI_I05 message with DefaultModelClassFactory. 
67       */ 
68      public RCI_I05() { 
69         this(new DefaultModelClassFactory());
70      }
71  
72      /** 
73       * Creates a new RCI_I05 message with custom ModelClassFactory.
74       */
75      public RCI_I05(ModelClassFactory factory) {
76         super(factory);
77         init(factory);
78      }
79  
80      private void init(ModelClassFactory factory) {
81         try {
82                            this.add(MSH.class, true, false);
83  	                          this.add(MSA.class, true, false);
84  	                          this.add(QRD.class, true, false);
85  	                          this.add(QRF.class, false, false);
86  	                          this.add(RCI_I05_PROVIDER.class, true, true);
87  	                          this.add(PID.class, true, false);
88  	                          this.add(DG1.class, false, true);
89  	                          this.add(DRG.class, false, true);
90  	                          this.add(AL1.class, false, true);
91  	                          this.add(RCI_I05_OBSERVATION.class, false, true);
92  	                          this.add(NTE.class, false, true);
93  	       } catch(HL7Exception e) {
94            log.error("Unexpected error creating RCI_I05 - this is probably a bug in the source code generator.", e);
95         }
96      }
97  
98  
99      /** 
100      * Returns "2.4"
101      */
102     public String getVersion() {
103        return "2.4";
104     }
105 
106 
107 
108 
109     /**
110      * <p>
111      * Returns
112      * MSH (Message Header) - creates it if necessary
113      * </p>
114      * 
115      *
116      */
117     public MSH getMSH() { 
118        return getTyped("MSH", MSH.class);
119     }
120 
121 
122 
123 
124 
125     /**
126      * <p>
127      * Returns
128      * MSA (Message Acknowledgment) - creates it if necessary
129      * </p>
130      * 
131      *
132      */
133     public MSA getMSA() { 
134        return getTyped("MSA", MSA.class);
135     }
136 
137 
138 
139 
140 
141     /**
142      * <p>
143      * Returns
144      * QRD (Original-Style Query Definition) - creates it if necessary
145      * </p>
146      * 
147      *
148      */
149     public QRD getQRD() { 
150        return getTyped("QRD", QRD.class);
151     }
152 
153 
154 
155 
156 
157     /**
158      * <p>
159      * Returns
160      * QRF (Original Style Query Filter) - creates it if necessary
161      * </p>
162      * 
163      *
164      */
165     public QRF getQRF() { 
166        return getTyped("QRF", QRF.class);
167     }
168 
169 
170 
171 
172 
173     /**
174      * <p>
175      * Returns
176      * the first repetition of 
177      * PROVIDER (a Group object) - creates it if necessary
178      * </p>
179      * 
180      *
181      */
182     public RCI_I05_PROVIDER getPROVIDER() { 
183        return getTyped("PROVIDER", RCI_I05_PROVIDER.class);
184     }
185 
186 
187     /**
188      * <p>
189      * Returns a specific repetition of
190      * PROVIDER (a Group object) - creates it if necessary
191      * </p>
192      * 
193      *
194      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
195      * @throws HL7Exception if the repetition requested is more than one 
196      *     greater than the number of existing repetitions.
197      */
198     public RCI_I05_PROVIDER getPROVIDER(int rep) { 
199        return getTyped("PROVIDER", rep, RCI_I05_PROVIDER.class);
200     }
201 
202     /** 
203      * <p>
204      * Returns the number of existing repetitions of PROVIDER 
205      * </p>
206      * 
207      */ 
208     public int getPROVIDERReps() { 
209     	return getReps("PROVIDER");
210     } 
211 
212     /** 
213      * <p>
214      * Returns a non-modifiable List containing all current existing repetitions of PROVIDER.
215      * <p>
216      * <p>
217      * Note that unlike {@link #getPROVIDER()}, this method will not create any reps
218      * if none are already present, so an empty list may be returned.
219      * </p>
220      * 
221      */ 
222     public java.util.List<RCI_I05_PROVIDER> getPROVIDERAll() throws HL7Exception {
223     	return getAllAsList("PROVIDER", RCI_I05_PROVIDER.class);
224     } 
225 
226     /**
227      * <p>
228      * Inserts a specific repetition of PROVIDER (a Group object)
229      * </p>
230      * 
231      *
232      * @see AbstractGroup#insertRepetition(Structure, int) 
233      */
234     public void insertPROVIDER(RCI_I05_PROVIDER structure, int rep) throws HL7Exception { 
235        super.insertRepetition( "PROVIDER", structure, rep);
236     }
237 
238 
239     /**
240      * <p>
241      * Inserts a specific repetition of PROVIDER (a Group object)
242      * </p>
243      * 
244      *
245      * @see AbstractGroup#insertRepetition(Structure, int) 
246      */
247     public RCI_I05_PROVIDER insertPROVIDER(int rep) throws HL7Exception { 
248        return (RCI_I05_PROVIDER)super.insertRepetition("PROVIDER", rep);
249     }
250 
251 
252     /**
253      * <p>
254      * Removes a specific repetition of PROVIDER (a Group object)
255      * </p>
256      * 
257      *
258      * @see AbstractGroup#removeRepetition(String, int) 
259      */
260     public RCI_I05_PROVIDER removePROVIDER(int rep) throws HL7Exception { 
261        return (RCI_I05_PROVIDER)super.removeRepetition("PROVIDER", rep);
262     }
263 
264 
265 
266 
267     /**
268      * <p>
269      * Returns
270      * PID (Patient identification) - creates it if necessary
271      * </p>
272      * 
273      *
274      */
275     public PID getPID() { 
276        return getTyped("PID", PID.class);
277     }
278 
279 
280 
281 
282 
283     /**
284      * <p>
285      * Returns
286      * the first repetition of 
287      * DG1 (Diagnosis) - creates it if necessary
288      * </p>
289      * 
290      *
291      */
292     public DG1 getDG1() { 
293        return getTyped("DG1", DG1.class);
294     }
295 
296 
297     /**
298      * <p>
299      * Returns a specific repetition of
300      * DG1 (Diagnosis) - creates it if necessary
301      * </p>
302      * 
303      *
304      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
305      * @throws HL7Exception if the repetition requested is more than one 
306      *     greater than the number of existing repetitions.
307      */
308     public DG1 getDG1(int rep) { 
309        return getTyped("DG1", rep, DG1.class);
310     }
311 
312     /** 
313      * <p>
314      * Returns the number of existing repetitions of DG1 
315      * </p>
316      * 
317      */ 
318     public int getDG1Reps() { 
319     	return getReps("DG1");
320     } 
321 
322     /** 
323      * <p>
324      * Returns a non-modifiable List containing all current existing repetitions of DG1.
325      * <p>
326      * <p>
327      * Note that unlike {@link #getDG1()}, this method will not create any reps
328      * if none are already present, so an empty list may be returned.
329      * </p>
330      * 
331      */ 
332     public java.util.List<DG1> getDG1All() throws HL7Exception {
333     	return getAllAsList("DG1", DG1.class);
334     } 
335 
336     /**
337      * <p>
338      * Inserts a specific repetition of DG1 (Diagnosis)
339      * </p>
340      * 
341      *
342      * @see AbstractGroup#insertRepetition(Structure, int) 
343      */
344     public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
345        super.insertRepetition( "DG1", structure, rep);
346     }
347 
348 
349     /**
350      * <p>
351      * Inserts a specific repetition of DG1 (Diagnosis)
352      * </p>
353      * 
354      *
355      * @see AbstractGroup#insertRepetition(Structure, int) 
356      */
357     public DG1 insertDG1(int rep) throws HL7Exception { 
358        return (DG1)super.insertRepetition("DG1", rep);
359     }
360 
361 
362     /**
363      * <p>
364      * Removes a specific repetition of DG1 (Diagnosis)
365      * </p>
366      * 
367      *
368      * @see AbstractGroup#removeRepetition(String, int) 
369      */
370     public DG1 removeDG1(int rep) throws HL7Exception { 
371        return (DG1)super.removeRepetition("DG1", rep);
372     }
373 
374 
375 
376 
377     /**
378      * <p>
379      * Returns
380      * the first repetition of 
381      * DRG (Diagnosis Related Group) - creates it if necessary
382      * </p>
383      * 
384      *
385      */
386     public DRG getDRG() { 
387        return getTyped("DRG", DRG.class);
388     }
389 
390 
391     /**
392      * <p>
393      * Returns a specific repetition of
394      * DRG (Diagnosis Related Group) - creates it if necessary
395      * </p>
396      * 
397      *
398      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
399      * @throws HL7Exception if the repetition requested is more than one 
400      *     greater than the number of existing repetitions.
401      */
402     public DRG getDRG(int rep) { 
403        return getTyped("DRG", rep, DRG.class);
404     }
405 
406     /** 
407      * <p>
408      * Returns the number of existing repetitions of DRG 
409      * </p>
410      * 
411      */ 
412     public int getDRGReps() { 
413     	return getReps("DRG");
414     } 
415 
416     /** 
417      * <p>
418      * Returns a non-modifiable List containing all current existing repetitions of DRG.
419      * <p>
420      * <p>
421      * Note that unlike {@link #getDRG()}, this method will not create any reps
422      * if none are already present, so an empty list may be returned.
423      * </p>
424      * 
425      */ 
426     public java.util.List<DRG> getDRGAll() throws HL7Exception {
427     	return getAllAsList("DRG", DRG.class);
428     } 
429 
430     /**
431      * <p>
432      * Inserts a specific repetition of DRG (Diagnosis Related Group)
433      * </p>
434      * 
435      *
436      * @see AbstractGroup#insertRepetition(Structure, int) 
437      */
438     public void insertDRG(DRG structure, int rep) throws HL7Exception { 
439        super.insertRepetition( "DRG", structure, rep);
440     }
441 
442 
443     /**
444      * <p>
445      * Inserts a specific repetition of DRG (Diagnosis Related Group)
446      * </p>
447      * 
448      *
449      * @see AbstractGroup#insertRepetition(Structure, int) 
450      */
451     public DRG insertDRG(int rep) throws HL7Exception { 
452        return (DRG)super.insertRepetition("DRG", rep);
453     }
454 
455 
456     /**
457      * <p>
458      * Removes a specific repetition of DRG (Diagnosis Related Group)
459      * </p>
460      * 
461      *
462      * @see AbstractGroup#removeRepetition(String, int) 
463      */
464     public DRG removeDRG(int rep) throws HL7Exception { 
465        return (DRG)super.removeRepetition("DRG", rep);
466     }
467 
468 
469 
470 
471     /**
472      * <p>
473      * Returns
474      * the first repetition of 
475      * AL1 (Patient allergy information) - creates it if necessary
476      * </p>
477      * 
478      *
479      */
480     public AL1 getAL1() { 
481        return getTyped("AL1", AL1.class);
482     }
483 
484 
485     /**
486      * <p>
487      * Returns a specific repetition of
488      * AL1 (Patient allergy information) - creates it if necessary
489      * </p>
490      * 
491      *
492      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
493      * @throws HL7Exception if the repetition requested is more than one 
494      *     greater than the number of existing repetitions.
495      */
496     public AL1 getAL1(int rep) { 
497        return getTyped("AL1", rep, AL1.class);
498     }
499 
500     /** 
501      * <p>
502      * Returns the number of existing repetitions of AL1 
503      * </p>
504      * 
505      */ 
506     public int getAL1Reps() { 
507     	return getReps("AL1");
508     } 
509 
510     /** 
511      * <p>
512      * Returns a non-modifiable List containing all current existing repetitions of AL1.
513      * <p>
514      * <p>
515      * Note that unlike {@link #getAL1()}, this method will not create any reps
516      * if none are already present, so an empty list may be returned.
517      * </p>
518      * 
519      */ 
520     public java.util.List<AL1> getAL1All() throws HL7Exception {
521     	return getAllAsList("AL1", AL1.class);
522     } 
523 
524     /**
525      * <p>
526      * Inserts a specific repetition of AL1 (Patient allergy information)
527      * </p>
528      * 
529      *
530      * @see AbstractGroup#insertRepetition(Structure, int) 
531      */
532     public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
533        super.insertRepetition( "AL1", structure, rep);
534     }
535 
536 
537     /**
538      * <p>
539      * Inserts a specific repetition of AL1 (Patient allergy information)
540      * </p>
541      * 
542      *
543      * @see AbstractGroup#insertRepetition(Structure, int) 
544      */
545     public AL1 insertAL1(int rep) throws HL7Exception { 
546        return (AL1)super.insertRepetition("AL1", rep);
547     }
548 
549 
550     /**
551      * <p>
552      * Removes a specific repetition of AL1 (Patient allergy information)
553      * </p>
554      * 
555      *
556      * @see AbstractGroup#removeRepetition(String, int) 
557      */
558     public AL1 removeAL1(int rep) throws HL7Exception { 
559        return (AL1)super.removeRepetition("AL1", rep);
560     }
561 
562 
563 
564 
565     /**
566      * <p>
567      * Returns
568      * the first repetition of 
569      * OBSERVATION (a Group object) - creates it if necessary
570      * </p>
571      * 
572      *
573      */
574     public RCI_I05_OBSERVATION getOBSERVATION() { 
575        return getTyped("OBSERVATION", RCI_I05_OBSERVATION.class);
576     }
577 
578 
579     /**
580      * <p>
581      * Returns a specific repetition of
582      * OBSERVATION (a Group object) - creates it if necessary
583      * </p>
584      * 
585      *
586      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
587      * @throws HL7Exception if the repetition requested is more than one 
588      *     greater than the number of existing repetitions.
589      */
590     public RCI_I05_OBSERVATION getOBSERVATION(int rep) { 
591        return getTyped("OBSERVATION", rep, RCI_I05_OBSERVATION.class);
592     }
593 
594     /** 
595      * <p>
596      * Returns the number of existing repetitions of OBSERVATION 
597      * </p>
598      * 
599      */ 
600     public int getOBSERVATIONReps() { 
601     	return getReps("OBSERVATION");
602     } 
603 
604     /** 
605      * <p>
606      * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION.
607      * <p>
608      * <p>
609      * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps
610      * if none are already present, so an empty list may be returned.
611      * </p>
612      * 
613      */ 
614     public java.util.List<RCI_I05_OBSERVATION> getOBSERVATIONAll() throws HL7Exception {
615     	return getAllAsList("OBSERVATION", RCI_I05_OBSERVATION.class);
616     } 
617 
618     /**
619      * <p>
620      * Inserts a specific repetition of OBSERVATION (a Group object)
621      * </p>
622      * 
623      *
624      * @see AbstractGroup#insertRepetition(Structure, int) 
625      */
626     public void insertOBSERVATION(RCI_I05_OBSERVATION structure, int rep) throws HL7Exception { 
627        super.insertRepetition( "OBSERVATION", structure, rep);
628     }
629 
630 
631     /**
632      * <p>
633      * Inserts a specific repetition of OBSERVATION (a Group object)
634      * </p>
635      * 
636      *
637      * @see AbstractGroup#insertRepetition(Structure, int) 
638      */
639     public RCI_I05_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 
640        return (RCI_I05_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
641     }
642 
643 
644     /**
645      * <p>
646      * Removes a specific repetition of OBSERVATION (a Group object)
647      * </p>
648      * 
649      *
650      * @see AbstractGroup#removeRepetition(String, int) 
651      */
652     public RCI_I05_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 
653        return (RCI_I05_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
654     }
655 
656 
657 
658 
659     /**
660      * <p>
661      * Returns
662      * the first repetition of 
663      * NTE (Notes and Comments) - creates it if necessary
664      * </p>
665      * 
666      *
667      */
668     public NTE getNTE() { 
669        return getTyped("NTE", NTE.class);
670     }
671 
672 
673     /**
674      * <p>
675      * Returns a specific repetition of
676      * NTE (Notes and Comments) - creates it if necessary
677      * </p>
678      * 
679      *
680      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
681      * @throws HL7Exception if the repetition requested is more than one 
682      *     greater than the number of existing repetitions.
683      */
684     public NTE getNTE(int rep) { 
685        return getTyped("NTE", rep, NTE.class);
686     }
687 
688     /** 
689      * <p>
690      * Returns the number of existing repetitions of NTE 
691      * </p>
692      * 
693      */ 
694     public int getNTEReps() { 
695     	return getReps("NTE");
696     } 
697 
698     /** 
699      * <p>
700      * Returns a non-modifiable List containing all current existing repetitions of NTE.
701      * <p>
702      * <p>
703      * Note that unlike {@link #getNTE()}, this method will not create any reps
704      * if none are already present, so an empty list may be returned.
705      * </p>
706      * 
707      */ 
708     public java.util.List<NTE> getNTEAll() throws HL7Exception {
709     	return getAllAsList("NTE", NTE.class);
710     } 
711 
712     /**
713      * <p>
714      * Inserts a specific repetition of NTE (Notes and Comments)
715      * </p>
716      * 
717      *
718      * @see AbstractGroup#insertRepetition(Structure, int) 
719      */
720     public void insertNTE(NTE structure, int rep) throws HL7Exception { 
721        super.insertRepetition( "NTE", structure, rep);
722     }
723 
724 
725     /**
726      * <p>
727      * Inserts a specific repetition of NTE (Notes and Comments)
728      * </p>
729      * 
730      *
731      * @see AbstractGroup#insertRepetition(Structure, int) 
732      */
733     public NTE insertNTE(int rep) throws HL7Exception { 
734        return (NTE)super.insertRepetition("NTE", rep);
735     }
736 
737 
738     /**
739      * <p>
740      * Removes a specific repetition of NTE (Notes and Comments)
741      * </p>
742      * 
743      *
744      * @see AbstractGroup#removeRepetition(String, int) 
745      */
746     public NTE removeNTE(int rep) throws HL7Exception { 
747        return (NTE)super.removeRepetition("NTE", rep);
748     }
749 
750 
751 
752 }
753