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.v26.message;
35  
36  import ca.uhn.hl7v2.model.v26.group.*;
37  import ca.uhn.hl7v2.model.v26.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 RDR_RDR message structure (see chapter 4.13.17). 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: ERR (Error) <b>optional repeating</b> </li>
52  		                 * <li>4: SFT (Software Segment) <b>optional repeating</b> </li>
53  		                 * <li>5: SFT (Software Segment) <b>optional </b> </li>
54  		                 * <li>6: UAC (User Authentication Credential Segment) <b>optional </b> </li>
55  		                 * <li>7: RDR_RDR_DEFINITION (a Group object) <b> repeating</b> </li>
56  		                 * <li>8: RXC (Pharmacy/Treatment Component Order) <b>optional repeating</b> </li>
57  		                 * <li>9: DSC (Continuation Pointer) <b>optional </b> </li>
58  		                 * <li>10: RXD (Pharmacy/Treatment Dispense) <b> </b> </li>
59  		                 * <li>11: RXR (Pharmacy/Treatment Route) <b> repeating</b> </li>
60  		                 * <li>12: RXC (Pharmacy/Treatment Component Order) <b>optional repeating</b> </li>
61  		                 * <li>13: DSC (Continuation Pointer) <b>optional </b> </li>
62   * </ul>
63   */
64  //@SuppressWarnings("unused")
65  public class RDR_RDR extends AbstractMessage  {
66  
67      /**
68       * Creates a new RDR_RDR message with DefaultModelClassFactory. 
69       */ 
70      public RDR_RDR() { 
71         this(new DefaultModelClassFactory());
72      }
73  
74      /** 
75       * Creates a new RDR_RDR message with custom ModelClassFactory.
76       */
77      public RDR_RDR(ModelClassFactory factory) {
78         super(factory);
79         init(factory);
80      }
81  
82      private void init(ModelClassFactory factory) {
83         try {
84                            this.add(MSH.class, true, false);
85  	                          this.add(MSA.class, true, false);
86  	                          this.add(ERR.class, false, true);
87  	                          this.add(SFT.class, false, true);
88  	                          this.add(SFT.class, false, false);
89  	                          this.add(UAC.class, false, false);
90  	                          this.add(RDR_RDR_DEFINITION.class, true, true);
91  	                          this.add(RXC.class, false, true);
92  	                          this.add(DSC.class, false, false);
93  	                          this.add(RXD.class, true, false);
94  	                          this.add(RXR.class, true, true);
95  	                          this.add(RXC.class, false, true);
96  	                          this.add(DSC.class, false, false);
97  	       } catch(HL7Exception e) {
98            log.error("Unexpected error creating RDR_RDR - this is probably a bug in the source code generator.", e);
99         }
100     }
101 
102 
103     /** 
104      * Returns "2.6"
105      */
106     public String getVersion() {
107        return "2.6";
108     }
109 
110 
111 
112 
113     /**
114      * <p>
115      * Returns
116      * MSH (Message Header) - creates it if necessary
117      * </p>
118      * 
119      *
120      */
121     public MSH getMSH() { 
122        return getTyped("MSH", MSH.class);
123     }
124 
125 
126 
127 
128 
129     /**
130      * <p>
131      * Returns
132      * MSA (Message Acknowledgment) - creates it if necessary
133      * </p>
134      * 
135      *
136      */
137     public MSA getMSA() { 
138        return getTyped("MSA", MSA.class);
139     }
140 
141 
142 
143 
144 
145     /**
146      * <p>
147      * Returns
148      * the first repetition of 
149      * ERR (Error) - creates it if necessary
150      * </p>
151      * 
152      *
153      */
154     public ERR getERR() { 
155        return getTyped("ERR", ERR.class);
156     }
157 
158 
159     /**
160      * <p>
161      * Returns a specific repetition of
162      * ERR (Error) - creates it if necessary
163      * </p>
164      * 
165      *
166      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
167      * @throws HL7Exception if the repetition requested is more than one 
168      *     greater than the number of existing repetitions.
169      */
170     public ERR getERR(int rep) { 
171        return getTyped("ERR", rep, ERR.class);
172     }
173 
174     /** 
175      * <p>
176      * Returns the number of existing repetitions of ERR 
177      * </p>
178      * 
179      */ 
180     public int getERRReps() { 
181     	return getReps("ERR");
182     } 
183 
184     /** 
185      * <p>
186      * Returns a non-modifiable List containing all current existing repetitions of ERR.
187      * <p>
188      * <p>
189      * Note that unlike {@link #getERR()}, this method will not create any reps
190      * if none are already present, so an empty list may be returned.
191      * </p>
192      * 
193      */ 
194     public java.util.List<ERR> getERRAll() throws HL7Exception {
195     	return getAllAsList("ERR", ERR.class);
196     } 
197 
198     /**
199      * <p>
200      * Inserts a specific repetition of ERR (Error)
201      * </p>
202      * 
203      *
204      * @see AbstractGroup#insertRepetition(Structure, int) 
205      */
206     public void insertERR(ERR structure, int rep) throws HL7Exception { 
207        super.insertRepetition( "ERR", structure, rep);
208     }
209 
210 
211     /**
212      * <p>
213      * Inserts a specific repetition of ERR (Error)
214      * </p>
215      * 
216      *
217      * @see AbstractGroup#insertRepetition(Structure, int) 
218      */
219     public ERR insertERR(int rep) throws HL7Exception { 
220        return (ERR)super.insertRepetition("ERR", rep);
221     }
222 
223 
224     /**
225      * <p>
226      * Removes a specific repetition of ERR (Error)
227      * </p>
228      * 
229      *
230      * @see AbstractGroup#removeRepetition(String, int) 
231      */
232     public ERR removeERR(int rep) throws HL7Exception { 
233        return (ERR)super.removeRepetition("ERR", rep);
234     }
235 
236 
237 
238 
239     /**
240      * <p>
241      * Returns
242      * the first repetition of 
243      * SFT (Software Segment) - creates it if necessary
244      * </p>
245      * 
246      *
247      */
248     public SFT getSFT() { 
249        return getTyped("SFT", SFT.class);
250     }
251 
252 
253     /**
254      * <p>
255      * Returns a specific repetition of
256      * SFT (Software Segment) - creates it if necessary
257      * </p>
258      * 
259      *
260      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
261      * @throws HL7Exception if the repetition requested is more than one 
262      *     greater than the number of existing repetitions.
263      */
264     public SFT getSFT(int rep) { 
265        return getTyped("SFT", rep, SFT.class);
266     }
267 
268     /** 
269      * <p>
270      * Returns the number of existing repetitions of SFT 
271      * </p>
272      * 
273      */ 
274     public int getSFTReps() { 
275     	return getReps("SFT");
276     } 
277 
278     /** 
279      * <p>
280      * Returns a non-modifiable List containing all current existing repetitions of SFT.
281      * <p>
282      * <p>
283      * Note that unlike {@link #getSFT()}, this method will not create any reps
284      * if none are already present, so an empty list may be returned.
285      * </p>
286      * 
287      */ 
288     public java.util.List<SFT> getSFTAll() throws HL7Exception {
289     	return getAllAsList("SFT", SFT.class);
290     } 
291 
292     /**
293      * <p>
294      * Inserts a specific repetition of SFT (Software Segment)
295      * </p>
296      * 
297      *
298      * @see AbstractGroup#insertRepetition(Structure, int) 
299      */
300     public void insertSFT(SFT structure, int rep) throws HL7Exception { 
301        super.insertRepetition( "SFT", structure, rep);
302     }
303 
304 
305     /**
306      * <p>
307      * Inserts a specific repetition of SFT (Software Segment)
308      * </p>
309      * 
310      *
311      * @see AbstractGroup#insertRepetition(Structure, int) 
312      */
313     public SFT insertSFT(int rep) throws HL7Exception { 
314        return (SFT)super.insertRepetition("SFT", rep);
315     }
316 
317 
318     /**
319      * <p>
320      * Removes a specific repetition of SFT (Software Segment)
321      * </p>
322      * 
323      *
324      * @see AbstractGroup#removeRepetition(String, int) 
325      */
326     public SFT removeSFT(int rep) throws HL7Exception { 
327        return (SFT)super.removeRepetition("SFT", rep);
328     }
329 
330 
331 
332 
333     /**
334      * <p>
335      * Returns
336      * SFT2 (Software Segment) - creates it if necessary
337      * </p>
338      * 
339      *
340      */
341     public SFT getSFT2() { 
342        return getTyped("SFT2", SFT.class);
343     }
344 
345 
346 
347 
348 
349     /**
350      * <p>
351      * Returns
352      * UAC (User Authentication Credential Segment) - creates it if necessary
353      * </p>
354      * 
355      *
356      */
357     public UAC getUAC() { 
358        return getTyped("UAC", UAC.class);
359     }
360 
361 
362 
363 
364 
365     /**
366      * <p>
367      * Returns
368      * the first repetition of 
369      * DEFINITION (a Group object) - creates it if necessary
370      * </p>
371      * 
372      *
373      */
374     public RDR_RDR_DEFINITION getDEFINITION() { 
375        return getTyped("DEFINITION", RDR_RDR_DEFINITION.class);
376     }
377 
378 
379     /**
380      * <p>
381      * Returns a specific repetition of
382      * DEFINITION (a Group object) - creates it if necessary
383      * </p>
384      * 
385      *
386      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
387      * @throws HL7Exception if the repetition requested is more than one 
388      *     greater than the number of existing repetitions.
389      */
390     public RDR_RDR_DEFINITION getDEFINITION(int rep) { 
391        return getTyped("DEFINITION", rep, RDR_RDR_DEFINITION.class);
392     }
393 
394     /** 
395      * <p>
396      * Returns the number of existing repetitions of DEFINITION 
397      * </p>
398      * 
399      */ 
400     public int getDEFINITIONReps() { 
401     	return getReps("DEFINITION");
402     } 
403 
404     /** 
405      * <p>
406      * Returns a non-modifiable List containing all current existing repetitions of DEFINITION.
407      * <p>
408      * <p>
409      * Note that unlike {@link #getDEFINITION()}, this method will not create any reps
410      * if none are already present, so an empty list may be returned.
411      * </p>
412      * 
413      */ 
414     public java.util.List<RDR_RDR_DEFINITION> getDEFINITIONAll() throws HL7Exception {
415     	return getAllAsList("DEFINITION", RDR_RDR_DEFINITION.class);
416     } 
417 
418     /**
419      * <p>
420      * Inserts a specific repetition of DEFINITION (a Group object)
421      * </p>
422      * 
423      *
424      * @see AbstractGroup#insertRepetition(Structure, int) 
425      */
426     public void insertDEFINITION(RDR_RDR_DEFINITION structure, int rep) throws HL7Exception { 
427        super.insertRepetition( "DEFINITION", structure, rep);
428     }
429 
430 
431     /**
432      * <p>
433      * Inserts a specific repetition of DEFINITION (a Group object)
434      * </p>
435      * 
436      *
437      * @see AbstractGroup#insertRepetition(Structure, int) 
438      */
439     public RDR_RDR_DEFINITION insertDEFINITION(int rep) throws HL7Exception { 
440        return (RDR_RDR_DEFINITION)super.insertRepetition("DEFINITION", rep);
441     }
442 
443 
444     /**
445      * <p>
446      * Removes a specific repetition of DEFINITION (a Group object)
447      * </p>
448      * 
449      *
450      * @see AbstractGroup#removeRepetition(String, int) 
451      */
452     public RDR_RDR_DEFINITION removeDEFINITION(int rep) throws HL7Exception { 
453        return (RDR_RDR_DEFINITION)super.removeRepetition("DEFINITION", rep);
454     }
455 
456 
457 
458 
459     /**
460      * <p>
461      * Returns
462      * the first repetition of 
463      * RXC (Pharmacy/Treatment Component Order) - creates it if necessary
464      * </p>
465      * 
466      *
467      */
468     public RXC getRXC() { 
469        return getTyped("RXC", RXC.class);
470     }
471 
472 
473     /**
474      * <p>
475      * Returns a specific repetition of
476      * RXC (Pharmacy/Treatment Component Order) - creates it if necessary
477      * </p>
478      * 
479      *
480      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
481      * @throws HL7Exception if the repetition requested is more than one 
482      *     greater than the number of existing repetitions.
483      */
484     public RXC getRXC(int rep) { 
485        return getTyped("RXC", rep, RXC.class);
486     }
487 
488     /** 
489      * <p>
490      * Returns the number of existing repetitions of RXC 
491      * </p>
492      * 
493      */ 
494     public int getRXCReps() { 
495     	return getReps("RXC");
496     } 
497 
498     /** 
499      * <p>
500      * Returns a non-modifiable List containing all current existing repetitions of RXC.
501      * <p>
502      * <p>
503      * Note that unlike {@link #getRXC()}, this method will not create any reps
504      * if none are already present, so an empty list may be returned.
505      * </p>
506      * 
507      */ 
508     public java.util.List<RXC> getRXCAll() throws HL7Exception {
509     	return getAllAsList("RXC", RXC.class);
510     } 
511 
512     /**
513      * <p>
514      * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order)
515      * </p>
516      * 
517      *
518      * @see AbstractGroup#insertRepetition(Structure, int) 
519      */
520     public void insertRXC(RXC structure, int rep) throws HL7Exception { 
521        super.insertRepetition( "RXC", structure, rep);
522     }
523 
524 
525     /**
526      * <p>
527      * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order)
528      * </p>
529      * 
530      *
531      * @see AbstractGroup#insertRepetition(Structure, int) 
532      */
533     public RXC insertRXC(int rep) throws HL7Exception { 
534        return (RXC)super.insertRepetition("RXC", rep);
535     }
536 
537 
538     /**
539      * <p>
540      * Removes a specific repetition of RXC (Pharmacy/Treatment Component Order)
541      * </p>
542      * 
543      *
544      * @see AbstractGroup#removeRepetition(String, int) 
545      */
546     public RXC removeRXC(int rep) throws HL7Exception { 
547        return (RXC)super.removeRepetition("RXC", rep);
548     }
549 
550 
551 
552 
553     /**
554      * <p>
555      * Returns
556      * DSC (Continuation Pointer) - creates it if necessary
557      * </p>
558      * 
559      *
560      */
561     public DSC getDSC() { 
562        return getTyped("DSC", DSC.class);
563     }
564 
565 
566 
567 
568 
569     /**
570      * <p>
571      * Returns
572      * RXD (Pharmacy/Treatment Dispense) - creates it if necessary
573      * </p>
574      * 
575      *
576      */
577     public RXD getRXD() { 
578        return getTyped("RXD", RXD.class);
579     }
580 
581 
582 
583 
584 
585     /**
586      * <p>
587      * Returns
588      * the first repetition of 
589      * RXR (Pharmacy/Treatment Route) - creates it if necessary
590      * </p>
591      * 
592      *
593      */
594     public RXR getRXR() { 
595        return getTyped("RXR", RXR.class);
596     }
597 
598 
599     /**
600      * <p>
601      * Returns a specific repetition of
602      * RXR (Pharmacy/Treatment Route) - creates it if necessary
603      * </p>
604      * 
605      *
606      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
607      * @throws HL7Exception if the repetition requested is more than one 
608      *     greater than the number of existing repetitions.
609      */
610     public RXR getRXR(int rep) { 
611        return getTyped("RXR", rep, RXR.class);
612     }
613 
614     /** 
615      * <p>
616      * Returns the number of existing repetitions of RXR 
617      * </p>
618      * 
619      */ 
620     public int getRXRReps() { 
621     	return getReps("RXR");
622     } 
623 
624     /** 
625      * <p>
626      * Returns a non-modifiable List containing all current existing repetitions of RXR.
627      * <p>
628      * <p>
629      * Note that unlike {@link #getRXR()}, this method will not create any reps
630      * if none are already present, so an empty list may be returned.
631      * </p>
632      * 
633      */ 
634     public java.util.List<RXR> getRXRAll() throws HL7Exception {
635     	return getAllAsList("RXR", RXR.class);
636     } 
637 
638     /**
639      * <p>
640      * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
641      * </p>
642      * 
643      *
644      * @see AbstractGroup#insertRepetition(Structure, int) 
645      */
646     public void insertRXR(RXR structure, int rep) throws HL7Exception { 
647        super.insertRepetition( "RXR", structure, rep);
648     }
649 
650 
651     /**
652      * <p>
653      * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
654      * </p>
655      * 
656      *
657      * @see AbstractGroup#insertRepetition(Structure, int) 
658      */
659     public RXR insertRXR(int rep) throws HL7Exception { 
660        return (RXR)super.insertRepetition("RXR", rep);
661     }
662 
663 
664     /**
665      * <p>
666      * Removes a specific repetition of RXR (Pharmacy/Treatment Route)
667      * </p>
668      * 
669      *
670      * @see AbstractGroup#removeRepetition(String, int) 
671      */
672     public RXR removeRXR(int rep) throws HL7Exception { 
673        return (RXR)super.removeRepetition("RXR", rep);
674     }
675 
676 
677 
678 
679     /**
680      * <p>
681      * Returns
682      * the first repetition of 
683      * RXC2 (Pharmacy/Treatment Component Order) - creates it if necessary
684      * </p>
685      * 
686      *
687      */
688     public RXC getRXC2() { 
689        return getTyped("RXC2", RXC.class);
690     }
691 
692 
693     /**
694      * <p>
695      * Returns a specific repetition of
696      * RXC2 (Pharmacy/Treatment Component Order) - creates it if necessary
697      * </p>
698      * 
699      *
700      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
701      * @throws HL7Exception if the repetition requested is more than one 
702      *     greater than the number of existing repetitions.
703      */
704     public RXC getRXC2(int rep) { 
705        return getTyped("RXC2", rep, RXC.class);
706     }
707 
708     /** 
709      * <p>
710      * Returns the number of existing repetitions of RXC2 
711      * </p>
712      * 
713      */ 
714     public int getRXC2Reps() { 
715     	return getReps("RXC2");
716     } 
717 
718     /** 
719      * <p>
720      * Returns a non-modifiable List containing all current existing repetitions of RXC2.
721      * <p>
722      * <p>
723      * Note that unlike {@link #getRXC2()}, this method will not create any reps
724      * if none are already present, so an empty list may be returned.
725      * </p>
726      * 
727      */ 
728     public java.util.List<RXC> getRXC2All() throws HL7Exception {
729     	return getAllAsList("RXC2", RXC.class);
730     } 
731 
732     /**
733      * <p>
734      * Inserts a specific repetition of RXC2 (Pharmacy/Treatment Component Order)
735      * </p>
736      * 
737      *
738      * @see AbstractGroup#insertRepetition(Structure, int) 
739      */
740     public void insertRXC2(RXC structure, int rep) throws HL7Exception { 
741        super.insertRepetition( "RXC2", structure, rep);
742     }
743 
744 
745     /**
746      * <p>
747      * Inserts a specific repetition of RXC2 (Pharmacy/Treatment Component Order)
748      * </p>
749      * 
750      *
751      * @see AbstractGroup#insertRepetition(Structure, int) 
752      */
753     public RXC insertRXC2(int rep) throws HL7Exception { 
754        return (RXC)super.insertRepetition("RXC2", rep);
755     }
756 
757 
758     /**
759      * <p>
760      * Removes a specific repetition of RXC2 (Pharmacy/Treatment Component Order)
761      * </p>
762      * 
763      *
764      * @see AbstractGroup#removeRepetition(String, int) 
765      */
766     public RXC removeRXC2(int rep) throws HL7Exception { 
767        return (RXC)super.removeRepetition("RXC2", rep);
768     }
769 
770 
771 
772 
773     /**
774      * <p>
775      * Returns
776      * DSC2 (Continuation Pointer) - creates it if necessary
777      * </p>
778      * 
779      *
780      */
781     public DSC getDSC2() { 
782        return getTyped("DSC2", DSC.class);
783     }
784 
785 
786 
787 
788 }
789