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.v281.message;
35  
36  import ca.uhn.hl7v2.model.v281.group.*;
37  import ca.uhn.hl7v2.model.v281.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_A38 message structure (see chapter 3.3.38). 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: UAC (User Authentication Credential Segment) <b>optional </b> </li>
52  		                 * <li>4: EVN (Event Type) <b> </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: PV1 (Patient Visit) <b> </b> </li>
56  		                 * <li>8: PV2 (Patient Visit - Additional Information) <b>optional </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_A38 extends AbstractMessage  {
65  
66      /**
67       * Creates a new ADT_A38 message with DefaultModelClassFactory. 
68       */ 
69      public ADT_A38() { 
70         this(new DefaultModelClassFactory());
71      }
72  
73      /** 
74       * Creates a new ADT_A38 message with custom ModelClassFactory.
75       */
76      public ADT_A38(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(UAC.class, false, 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(PV1.class, true, false);
90  	                          this.add(PV2.class, false, false);
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_A38 - this is probably a bug in the source code generator.", e);
97         }
98      }
99  
100 
101     /** 
102      * Returns "2.8.1"
103      */
104     public String getVersion() {
105        return "2.8.1";
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      * UAC (User Authentication Credential Segment) - creates it if necessary
225      * </p>
226      * 
227      *
228      */
229     public UAC getUAC() { 
230        return getTyped("UAC", UAC.class);
231     }
232 
233 
234 
235 
236 
237     /**
238      * <p>
239      * Returns
240      * EVN (Event Type) - creates it if necessary
241      * </p>
242      * 
243      *
244      */
245     public EVN getEVN() { 
246        return getTyped("EVN", EVN.class);
247     }
248 
249 
250 
251 
252 
253     /**
254      * <p>
255      * Returns
256      * PID (Patient Identification) - creates it if necessary
257      * </p>
258      * 
259      *
260      */
261     public PID getPID() { 
262        return getTyped("PID", PID.class);
263     }
264 
265 
266 
267 
268 
269     /**
270      * <p>
271      * Returns
272      * PD1 (Patient Additional Demographic) - creates it if necessary
273      * </p>
274      * 
275      *
276      */
277     public PD1 getPD1() { 
278        return getTyped("PD1", PD1.class);
279     }
280 
281 
282 
283 
284 
285     /**
286      * <p>
287      * Returns
288      * PV1 (Patient Visit) - creates it if necessary
289      * </p>
290      * 
291      *
292      */
293     public PV1 getPV1() { 
294        return getTyped("PV1", PV1.class);
295     }
296 
297 
298 
299 
300 
301     /**
302      * <p>
303      * Returns
304      * PV2 (Patient Visit - Additional Information) - creates it if necessary
305      * </p>
306      * 
307      *
308      */
309     public PV2 getPV2() { 
310        return getTyped("PV2", PV2.class);
311     }
312 
313 
314 
315 
316 
317     /**
318      * <p>
319      * Returns
320      * the first repetition of 
321      * DB1 (Disability) - creates it if necessary
322      * </p>
323      * 
324      *
325      */
326     public DB1 getDB1() { 
327        return getTyped("DB1", DB1.class);
328     }
329 
330 
331     /**
332      * <p>
333      * Returns a specific repetition of
334      * DB1 (Disability) - creates it if necessary
335      * </p>
336      * 
337      *
338      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
339      * @throws HL7Exception if the repetition requested is more than one 
340      *     greater than the number of existing repetitions.
341      */
342     public DB1 getDB1(int rep) { 
343        return getTyped("DB1", rep, DB1.class);
344     }
345 
346     /** 
347      * <p>
348      * Returns the number of existing repetitions of DB1 
349      * </p>
350      * 
351      */ 
352     public int getDB1Reps() { 
353     	return getReps("DB1");
354     } 
355 
356     /** 
357      * <p>
358      * Returns a non-modifiable List containing all current existing repetitions of DB1.
359      * <p>
360      * <p>
361      * Note that unlike {@link #getDB1()}, this method will not create any reps
362      * if none are already present, so an empty list may be returned.
363      * </p>
364      * 
365      */ 
366     public java.util.List<DB1> getDB1All() throws HL7Exception {
367     	return getAllAsList("DB1", DB1.class);
368     } 
369 
370     /**
371      * <p>
372      * Inserts a specific repetition of DB1 (Disability)
373      * </p>
374      * 
375      *
376      * @see AbstractGroup#insertRepetition(Structure, int) 
377      */
378     public void insertDB1(DB1 structure, int rep) throws HL7Exception { 
379        super.insertRepetition( "DB1", structure, rep);
380     }
381 
382 
383     /**
384      * <p>
385      * Inserts a specific repetition of DB1 (Disability)
386      * </p>
387      * 
388      *
389      * @see AbstractGroup#insertRepetition(Structure, int) 
390      */
391     public DB1 insertDB1(int rep) throws HL7Exception { 
392        return (DB1)super.insertRepetition("DB1", rep);
393     }
394 
395 
396     /**
397      * <p>
398      * Removes a specific repetition of DB1 (Disability)
399      * </p>
400      * 
401      *
402      * @see AbstractGroup#removeRepetition(String, int) 
403      */
404     public DB1 removeDB1(int rep) throws HL7Exception { 
405        return (DB1)super.removeRepetition("DB1", rep);
406     }
407 
408 
409 
410 
411     /**
412      * <p>
413      * Returns
414      * the first repetition of 
415      * OBX (Observation/Result) - creates it if necessary
416      * </p>
417      * 
418      *
419      */
420     public OBX getOBX() { 
421        return getTyped("OBX", OBX.class);
422     }
423 
424 
425     /**
426      * <p>
427      * Returns a specific repetition of
428      * OBX (Observation/Result) - creates it if necessary
429      * </p>
430      * 
431      *
432      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
433      * @throws HL7Exception if the repetition requested is more than one 
434      *     greater than the number of existing repetitions.
435      */
436     public OBX getOBX(int rep) { 
437        return getTyped("OBX", rep, OBX.class);
438     }
439 
440     /** 
441      * <p>
442      * Returns the number of existing repetitions of OBX 
443      * </p>
444      * 
445      */ 
446     public int getOBXReps() { 
447     	return getReps("OBX");
448     } 
449 
450     /** 
451      * <p>
452      * Returns a non-modifiable List containing all current existing repetitions of OBX.
453      * <p>
454      * <p>
455      * Note that unlike {@link #getOBX()}, this method will not create any reps
456      * if none are already present, so an empty list may be returned.
457      * </p>
458      * 
459      */ 
460     public java.util.List<OBX> getOBXAll() throws HL7Exception {
461     	return getAllAsList("OBX", OBX.class);
462     } 
463 
464     /**
465      * <p>
466      * Inserts a specific repetition of OBX (Observation/Result)
467      * </p>
468      * 
469      *
470      * @see AbstractGroup#insertRepetition(Structure, int) 
471      */
472     public void insertOBX(OBX structure, int rep) throws HL7Exception { 
473        super.insertRepetition( "OBX", structure, rep);
474     }
475 
476 
477     /**
478      * <p>
479      * Inserts a specific repetition of OBX (Observation/Result)
480      * </p>
481      * 
482      *
483      * @see AbstractGroup#insertRepetition(Structure, int) 
484      */
485     public OBX insertOBX(int rep) throws HL7Exception { 
486        return (OBX)super.insertRepetition("OBX", rep);
487     }
488 
489 
490     /**
491      * <p>
492      * Removes a specific repetition of OBX (Observation/Result)
493      * </p>
494      * 
495      *
496      * @see AbstractGroup#removeRepetition(String, int) 
497      */
498     public OBX removeOBX(int rep) throws HL7Exception { 
499        return (OBX)super.removeRepetition("OBX", rep);
500     }
501 
502 
503 
504 
505     /**
506      * <p>
507      * Returns
508      * the first repetition of 
509      * DG1 (Diagnosis) - creates it if necessary
510      * </p>
511      * 
512      *
513      */
514     public DG1 getDG1() { 
515        return getTyped("DG1", DG1.class);
516     }
517 
518 
519     /**
520      * <p>
521      * Returns a specific repetition of
522      * DG1 (Diagnosis) - creates it if necessary
523      * </p>
524      * 
525      *
526      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
527      * @throws HL7Exception if the repetition requested is more than one 
528      *     greater than the number of existing repetitions.
529      */
530     public DG1 getDG1(int rep) { 
531        return getTyped("DG1", rep, DG1.class);
532     }
533 
534     /** 
535      * <p>
536      * Returns the number of existing repetitions of DG1 
537      * </p>
538      * 
539      */ 
540     public int getDG1Reps() { 
541     	return getReps("DG1");
542     } 
543 
544     /** 
545      * <p>
546      * Returns a non-modifiable List containing all current existing repetitions of DG1.
547      * <p>
548      * <p>
549      * Note that unlike {@link #getDG1()}, this method will not create any reps
550      * if none are already present, so an empty list may be returned.
551      * </p>
552      * 
553      */ 
554     public java.util.List<DG1> getDG1All() throws HL7Exception {
555     	return getAllAsList("DG1", DG1.class);
556     } 
557 
558     /**
559      * <p>
560      * Inserts a specific repetition of DG1 (Diagnosis)
561      * </p>
562      * 
563      *
564      * @see AbstractGroup#insertRepetition(Structure, int) 
565      */
566     public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
567        super.insertRepetition( "DG1", structure, rep);
568     }
569 
570 
571     /**
572      * <p>
573      * Inserts a specific repetition of DG1 (Diagnosis)
574      * </p>
575      * 
576      *
577      * @see AbstractGroup#insertRepetition(Structure, int) 
578      */
579     public DG1 insertDG1(int rep) throws HL7Exception { 
580        return (DG1)super.insertRepetition("DG1", rep);
581     }
582 
583 
584     /**
585      * <p>
586      * Removes a specific repetition of DG1 (Diagnosis)
587      * </p>
588      * 
589      *
590      * @see AbstractGroup#removeRepetition(String, int) 
591      */
592     public DG1 removeDG1(int rep) throws HL7Exception { 
593        return (DG1)super.removeRepetition("DG1", rep);
594     }
595 
596 
597 
598 
599     /**
600      * <p>
601      * Returns
602      * DRG (Diagnosis Related Group) - creates it if necessary
603      * </p>
604      * 
605      *
606      */
607     public DRG getDRG() { 
608        return getTyped("DRG", DRG.class);
609     }
610 
611 
612 
613 
614 }
615