001/*
002 * This class is an auto-generated source file for a HAPI
003 * HL7 v2.x standard structure class.
004 *
005 * For more information, visit: http://hl7api.sourceforge.net/
006 * 
007 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033
034package ca.uhn.hl7v2.model.v27.message;
035
036import ca.uhn.hl7v2.model.v27.group.*;
037import ca.uhn.hl7v2.model.v27.segment.*;
038
039import ca.uhn.hl7v2.HL7Exception;
040import ca.uhn.hl7v2.parser.ModelClassFactory;
041import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
042import ca.uhn.hl7v2.model.*;
043
044
045/**
046 * <p>Represents a ADT_A38 message structure (see chapter 3.3.38). This structure contains the 
047 * following elements: </p>
048 * <ul>
049                                 * <li>1: MSH (Message Header) <b> </b> </li>
050                                 * <li>2: SFT (Software Segment) <b>optional repeating</b> </li>
051                                 * <li>3: UAC (User Authentication Credential Segment) <b>optional </b> </li>
052                                 * <li>4: EVN (Event Type) <b> </b> </li>
053                                 * <li>5: PID (Patient Identification) <b> </b> </li>
054                                 * <li>6: PD1 (Patient Additional Demographic) <b>optional </b> </li>
055                                 * <li>7: PV1 (Patient Visit) <b> </b> </li>
056                                 * <li>8: PV2 (Patient Visit - Additional Information) <b>optional </b> </li>
057                                 * <li>9: DB1 (Disability) <b>optional repeating</b> </li>
058                                 * <li>10: OBX (Observation/Result) <b>optional repeating</b> </li>
059                                 * <li>11: DG1 (Diagnosis) <b>optional repeating</b> </li>
060                                 * <li>12: DRG (Diagnosis Related Group) <b>optional </b> </li>
061 * </ul>
062 */
063//@SuppressWarnings("unused")
064public class ADT_A38 extends AbstractMessage  {
065
066    /**
067     * Creates a new ADT_A38 message with DefaultModelClassFactory. 
068     */ 
069    public ADT_A38() { 
070       this(new DefaultModelClassFactory());
071    }
072
073    /** 
074     * Creates a new ADT_A38 message with custom ModelClassFactory.
075     */
076    public ADT_A38(ModelClassFactory factory) {
077       super(factory);
078       init(factory);
079    }
080
081    private void init(ModelClassFactory factory) {
082       try {
083                          this.add(MSH.class, true, false);
084                                  this.add(SFT.class, false, true);
085                                  this.add(UAC.class, false, false);
086                                  this.add(EVN.class, true, false);
087                                  this.add(PID.class, true, false);
088                                  this.add(PD1.class, false, false);
089                                  this.add(PV1.class, true, false);
090                                  this.add(PV2.class, false, false);
091                                  this.add(DB1.class, false, true);
092                                  this.add(OBX.class, false, true);
093                                  this.add(DG1.class, false, true);
094                                  this.add(DRG.class, false, false);
095               } catch(HL7Exception e) {
096          log.error("Unexpected error creating ADT_A38 - this is probably a bug in the source code generator.", e);
097       }
098    }
099
100
101    /** 
102     * Returns "2.7"
103     */
104    public String getVersion() {
105       return "2.7";
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