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 VXR_V03 message structure (see chapter ?). 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: PID (Patient identification) <b> </b> </li>
54  		                 * <li>6: PD1 (patient additional demographic) <b>optional </b> </li>
55  		                 * <li>7: NK1 (Next of kin / associated parties) <b>optional repeating</b> </li>
56  		                 * <li>8: VXR_V03_PATIENT_VISIT (a Group object) <b>optional </b> </li>
57  		                 * <li>9: GT1 (Guarantor) <b>optional repeating</b> </li>
58  		                 * <li>10: VXR_V03_INSURANCE (a Group object) <b>optional repeating</b> </li>
59  		                 * <li>11: VXR_V03_ORDER (a Group object) <b>optional repeating</b> </li>
60   * </ul>
61   */
62  //@SuppressWarnings("unused")
63  public class VXR_V03 extends AbstractMessage  {
64  
65      /**
66       * Creates a new VXR_V03 message with DefaultModelClassFactory. 
67       */ 
68      public VXR_V03() { 
69         this(new DefaultModelClassFactory());
70      }
71  
72      /** 
73       * Creates a new VXR_V03 message with custom ModelClassFactory.
74       */
75      public VXR_V03(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(PID.class, true, false);
87  	                          this.add(PD1.class, false, false);
88  	                          this.add(NK1.class, false, true);
89  	                          this.add(VXR_V03_PATIENT_VISIT.class, false, false);
90  	                          this.add(GT1.class, false, true);
91  	                          this.add(VXR_V03_INSURANCE.class, false, true);
92  	                          this.add(VXR_V03_ORDER.class, false, true);
93  	       } catch(HL7Exception e) {
94            log.error("Unexpected error creating VXR_V03 - 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      * PID (Patient identification) - creates it if necessary
177      * </p>
178      * 
179      *
180      */
181     public PID getPID() { 
182        return getTyped("PID", PID.class);
183     }
184 
185 
186 
187 
188 
189     /**
190      * <p>
191      * Returns
192      * PD1 (patient additional demographic) - creates it if necessary
193      * </p>
194      * 
195      *
196      */
197     public PD1 getPD1() { 
198        return getTyped("PD1", PD1.class);
199     }
200 
201 
202 
203 
204 
205     /**
206      * <p>
207      * Returns
208      * the first repetition of 
209      * NK1 (Next of kin / associated parties) - creates it if necessary
210      * </p>
211      * 
212      *
213      */
214     public NK1 getNK1() { 
215        return getTyped("NK1", NK1.class);
216     }
217 
218 
219     /**
220      * <p>
221      * Returns a specific repetition of
222      * NK1 (Next of kin / associated parties) - creates it if necessary
223      * </p>
224      * 
225      *
226      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
227      * @throws HL7Exception if the repetition requested is more than one 
228      *     greater than the number of existing repetitions.
229      */
230     public NK1 getNK1(int rep) { 
231        return getTyped("NK1", rep, NK1.class);
232     }
233 
234     /** 
235      * <p>
236      * Returns the number of existing repetitions of NK1 
237      * </p>
238      * 
239      */ 
240     public int getNK1Reps() { 
241     	return getReps("NK1");
242     } 
243 
244     /** 
245      * <p>
246      * Returns a non-modifiable List containing all current existing repetitions of NK1.
247      * <p>
248      * <p>
249      * Note that unlike {@link #getNK1()}, this method will not create any reps
250      * if none are already present, so an empty list may be returned.
251      * </p>
252      * 
253      */ 
254     public java.util.List<NK1> getNK1All() throws HL7Exception {
255     	return getAllAsList("NK1", NK1.class);
256     } 
257 
258     /**
259      * <p>
260      * Inserts a specific repetition of NK1 (Next of kin / associated parties)
261      * </p>
262      * 
263      *
264      * @see AbstractGroup#insertRepetition(Structure, int) 
265      */
266     public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
267        super.insertRepetition( "NK1", structure, rep);
268     }
269 
270 
271     /**
272      * <p>
273      * Inserts a specific repetition of NK1 (Next of kin / associated parties)
274      * </p>
275      * 
276      *
277      * @see AbstractGroup#insertRepetition(Structure, int) 
278      */
279     public NK1 insertNK1(int rep) throws HL7Exception { 
280        return (NK1)super.insertRepetition("NK1", rep);
281     }
282 
283 
284     /**
285      * <p>
286      * Removes a specific repetition of NK1 (Next of kin / associated parties)
287      * </p>
288      * 
289      *
290      * @see AbstractGroup#removeRepetition(String, int) 
291      */
292     public NK1 removeNK1(int rep) throws HL7Exception { 
293        return (NK1)super.removeRepetition("NK1", rep);
294     }
295 
296 
297 
298 
299     /**
300      * <p>
301      * Returns
302      * PATIENT_VISIT (a Group object) - creates it if necessary
303      * </p>
304      * 
305      *
306      */
307     public VXR_V03_PATIENT_VISIT getPATIENT_VISIT() { 
308        return getTyped("PATIENT_VISIT", VXR_V03_PATIENT_VISIT.class);
309     }
310 
311 
312 
313 
314 
315     /**
316      * <p>
317      * Returns
318      * the first repetition of 
319      * GT1 (Guarantor) - creates it if necessary
320      * </p>
321      * 
322      *
323      */
324     public GT1 getGT1() { 
325        return getTyped("GT1", GT1.class);
326     }
327 
328 
329     /**
330      * <p>
331      * Returns a specific repetition of
332      * GT1 (Guarantor) - creates it if necessary
333      * </p>
334      * 
335      *
336      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
337      * @throws HL7Exception if the repetition requested is more than one 
338      *     greater than the number of existing repetitions.
339      */
340     public GT1 getGT1(int rep) { 
341        return getTyped("GT1", rep, GT1.class);
342     }
343 
344     /** 
345      * <p>
346      * Returns the number of existing repetitions of GT1 
347      * </p>
348      * 
349      */ 
350     public int getGT1Reps() { 
351     	return getReps("GT1");
352     } 
353 
354     /** 
355      * <p>
356      * Returns a non-modifiable List containing all current existing repetitions of GT1.
357      * <p>
358      * <p>
359      * Note that unlike {@link #getGT1()}, this method will not create any reps
360      * if none are already present, so an empty list may be returned.
361      * </p>
362      * 
363      */ 
364     public java.util.List<GT1> getGT1All() throws HL7Exception {
365     	return getAllAsList("GT1", GT1.class);
366     } 
367 
368     /**
369      * <p>
370      * Inserts a specific repetition of GT1 (Guarantor)
371      * </p>
372      * 
373      *
374      * @see AbstractGroup#insertRepetition(Structure, int) 
375      */
376     public void insertGT1(GT1 structure, int rep) throws HL7Exception { 
377        super.insertRepetition( "GT1", structure, rep);
378     }
379 
380 
381     /**
382      * <p>
383      * Inserts a specific repetition of GT1 (Guarantor)
384      * </p>
385      * 
386      *
387      * @see AbstractGroup#insertRepetition(Structure, int) 
388      */
389     public GT1 insertGT1(int rep) throws HL7Exception { 
390        return (GT1)super.insertRepetition("GT1", rep);
391     }
392 
393 
394     /**
395      * <p>
396      * Removes a specific repetition of GT1 (Guarantor)
397      * </p>
398      * 
399      *
400      * @see AbstractGroup#removeRepetition(String, int) 
401      */
402     public GT1 removeGT1(int rep) throws HL7Exception { 
403        return (GT1)super.removeRepetition("GT1", rep);
404     }
405 
406 
407 
408 
409     /**
410      * <p>
411      * Returns
412      * the first repetition of 
413      * INSURANCE (a Group object) - creates it if necessary
414      * </p>
415      * 
416      *
417      */
418     public VXR_V03_INSURANCE getINSURANCE() { 
419        return getTyped("INSURANCE", VXR_V03_INSURANCE.class);
420     }
421 
422 
423     /**
424      * <p>
425      * Returns a specific repetition of
426      * INSURANCE (a Group object) - creates it if necessary
427      * </p>
428      * 
429      *
430      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
431      * @throws HL7Exception if the repetition requested is more than one 
432      *     greater than the number of existing repetitions.
433      */
434     public VXR_V03_INSURANCE getINSURANCE(int rep) { 
435        return getTyped("INSURANCE", rep, VXR_V03_INSURANCE.class);
436     }
437 
438     /** 
439      * <p>
440      * Returns the number of existing repetitions of INSURANCE 
441      * </p>
442      * 
443      */ 
444     public int getINSURANCEReps() { 
445     	return getReps("INSURANCE");
446     } 
447 
448     /** 
449      * <p>
450      * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
451      * <p>
452      * <p>
453      * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
454      * if none are already present, so an empty list may be returned.
455      * </p>
456      * 
457      */ 
458     public java.util.List<VXR_V03_INSURANCE> getINSURANCEAll() throws HL7Exception {
459     	return getAllAsList("INSURANCE", VXR_V03_INSURANCE.class);
460     } 
461 
462     /**
463      * <p>
464      * Inserts a specific repetition of INSURANCE (a Group object)
465      * </p>
466      * 
467      *
468      * @see AbstractGroup#insertRepetition(Structure, int) 
469      */
470     public void insertINSURANCE(VXR_V03_INSURANCE structure, int rep) throws HL7Exception { 
471        super.insertRepetition( "INSURANCE", structure, rep);
472     }
473 
474 
475     /**
476      * <p>
477      * Inserts a specific repetition of INSURANCE (a Group object)
478      * </p>
479      * 
480      *
481      * @see AbstractGroup#insertRepetition(Structure, int) 
482      */
483     public VXR_V03_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
484        return (VXR_V03_INSURANCE)super.insertRepetition("INSURANCE", rep);
485     }
486 
487 
488     /**
489      * <p>
490      * Removes a specific repetition of INSURANCE (a Group object)
491      * </p>
492      * 
493      *
494      * @see AbstractGroup#removeRepetition(String, int) 
495      */
496     public VXR_V03_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
497        return (VXR_V03_INSURANCE)super.removeRepetition("INSURANCE", rep);
498     }
499 
500 
501 
502 
503     /**
504      * <p>
505      * Returns
506      * the first repetition of 
507      * ORDER (a Group object) - creates it if necessary
508      * </p>
509      * 
510      *
511      */
512     public VXR_V03_ORDER getORDER() { 
513        return getTyped("ORDER", VXR_V03_ORDER.class);
514     }
515 
516 
517     /**
518      * <p>
519      * Returns a specific repetition of
520      * ORDER (a Group object) - creates it if necessary
521      * </p>
522      * 
523      *
524      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
525      * @throws HL7Exception if the repetition requested is more than one 
526      *     greater than the number of existing repetitions.
527      */
528     public VXR_V03_ORDER getORDER(int rep) { 
529        return getTyped("ORDER", rep, VXR_V03_ORDER.class);
530     }
531 
532     /** 
533      * <p>
534      * Returns the number of existing repetitions of ORDER 
535      * </p>
536      * 
537      */ 
538     public int getORDERReps() { 
539     	return getReps("ORDER");
540     } 
541 
542     /** 
543      * <p>
544      * Returns a non-modifiable List containing all current existing repetitions of ORDER.
545      * <p>
546      * <p>
547      * Note that unlike {@link #getORDER()}, this method will not create any reps
548      * if none are already present, so an empty list may be returned.
549      * </p>
550      * 
551      */ 
552     public java.util.List<VXR_V03_ORDER> getORDERAll() throws HL7Exception {
553     	return getAllAsList("ORDER", VXR_V03_ORDER.class);
554     } 
555 
556     /**
557      * <p>
558      * Inserts a specific repetition of ORDER (a Group object)
559      * </p>
560      * 
561      *
562      * @see AbstractGroup#insertRepetition(Structure, int) 
563      */
564     public void insertORDER(VXR_V03_ORDER structure, int rep) throws HL7Exception { 
565        super.insertRepetition( "ORDER", structure, rep);
566     }
567 
568 
569     /**
570      * <p>
571      * Inserts a specific repetition of ORDER (a Group object)
572      * </p>
573      * 
574      *
575      * @see AbstractGroup#insertRepetition(Structure, int) 
576      */
577     public VXR_V03_ORDER insertORDER(int rep) throws HL7Exception { 
578        return (VXR_V03_ORDER)super.insertRepetition("ORDER", rep);
579     }
580 
581 
582     /**
583      * <p>
584      * Removes a specific repetition of ORDER (a Group object)
585      * </p>
586      * 
587      *
588      * @see AbstractGroup#removeRepetition(String, int) 
589      */
590     public VXR_V03_ORDER removeORDER(int rep) throws HL7Exception { 
591        return (VXR_V03_ORDER)super.removeRepetition("ORDER", rep);
592     }
593 
594 
595 
596 }
597