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