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