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