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.v26.message;
035
036import ca.uhn.hl7v2.model.v26.group.*;
037import ca.uhn.hl7v2.model.v26.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_A12 message structure (see chapter 3.3.12). 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 </b> </li>
060 * </ul>
061 */
062//@SuppressWarnings("unused")
063public class ADT_A12 extends AbstractMessage  {
064
065    /**
066     * Creates a new ADT_A12 message with DefaultModelClassFactory. 
067     */ 
068    public ADT_A12() { 
069       this(new DefaultModelClassFactory());
070    }
071
072    /** 
073     * Creates a new ADT_A12 message with custom ModelClassFactory.
074     */
075    public ADT_A12(ModelClassFactory factory) {
076       super(factory);
077       init(factory);
078    }
079
080    private void init(ModelClassFactory factory) {
081       try {
082                          this.add(MSH.class, true, false);
083                                  this.add(SFT.class, false, true);
084                                  this.add(UAC.class, false, false);
085                                  this.add(EVN.class, true, false);
086                                  this.add(PID.class, true, false);
087                                  this.add(PD1.class, false, false);
088                                  this.add(PV1.class, true, false);
089                                  this.add(PV2.class, false, false);
090                                  this.add(DB1.class, false, true);
091                                  this.add(OBX.class, false, true);
092                                  this.add(DG1.class, false, false);
093               } catch(HL7Exception e) {
094          log.error("Unexpected error creating ADT_A12 - this is probably a bug in the source code generator.", e);
095       }
096    }
097
098
099    /** 
100     * Returns "2.6"
101     */
102    public String getVersion() {
103       return "2.6";
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     * the first repetition of 
129     * SFT (Software Segment) - creates it if necessary
130     * </p>
131     * 
132     *
133     */
134    public SFT getSFT() { 
135       return getTyped("SFT", SFT.class);
136    }
137
138
139    /**
140     * <p>
141     * Returns a specific repetition of
142     * SFT (Software Segment) - creates it if necessary
143     * </p>
144     * 
145     *
146     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
147     * @throws HL7Exception if the repetition requested is more than one 
148     *     greater than the number of existing repetitions.
149     */
150    public SFT getSFT(int rep) { 
151       return getTyped("SFT", rep, SFT.class);
152    }
153
154    /** 
155     * <p>
156     * Returns the number of existing repetitions of SFT 
157     * </p>
158     * 
159     */ 
160    public int getSFTReps() { 
161        return getReps("SFT");
162    } 
163
164    /** 
165     * <p>
166     * Returns a non-modifiable List containing all current existing repetitions of SFT.
167     * <p>
168     * <p>
169     * Note that unlike {@link #getSFT()}, this method will not create any reps
170     * if none are already present, so an empty list may be returned.
171     * </p>
172     * 
173     */ 
174    public java.util.List<SFT> getSFTAll() throws HL7Exception {
175        return getAllAsList("SFT", SFT.class);
176    } 
177
178    /**
179     * <p>
180     * Inserts a specific repetition of SFT (Software Segment)
181     * </p>
182     * 
183     *
184     * @see AbstractGroup#insertRepetition(Structure, int) 
185     */
186    public void insertSFT(SFT structure, int rep) throws HL7Exception { 
187       super.insertRepetition( "SFT", structure, rep);
188    }
189
190
191    /**
192     * <p>
193     * Inserts a specific repetition of SFT (Software Segment)
194     * </p>
195     * 
196     *
197     * @see AbstractGroup#insertRepetition(Structure, int) 
198     */
199    public SFT insertSFT(int rep) throws HL7Exception { 
200       return (SFT)super.insertRepetition("SFT", rep);
201    }
202
203
204    /**
205     * <p>
206     * Removes a specific repetition of SFT (Software Segment)
207     * </p>
208     * 
209     *
210     * @see AbstractGroup#removeRepetition(String, int) 
211     */
212    public SFT removeSFT(int rep) throws HL7Exception { 
213       return (SFT)super.removeRepetition("SFT", rep);
214    }
215
216
217
218
219    /**
220     * <p>
221     * Returns
222     * UAC (User Authentication Credential Segment) - creates it if necessary
223     * </p>
224     * 
225     *
226     */
227    public UAC getUAC() { 
228       return getTyped("UAC", UAC.class);
229    }
230
231
232
233
234
235    /**
236     * <p>
237     * Returns
238     * EVN (Event Type) - creates it if necessary
239     * </p>
240     * 
241     *
242     */
243    public EVN getEVN() { 
244       return getTyped("EVN", EVN.class);
245    }
246
247
248
249
250
251    /**
252     * <p>
253     * Returns
254     * PID (Patient Identification) - creates it if necessary
255     * </p>
256     * 
257     *
258     */
259    public PID getPID() { 
260       return getTyped("PID", PID.class);
261    }
262
263
264
265
266
267    /**
268     * <p>
269     * Returns
270     * PD1 (Patient Additional Demographic) - creates it if necessary
271     * </p>
272     * 
273     *
274     */
275    public PD1 getPD1() { 
276       return getTyped("PD1", PD1.class);
277    }
278
279
280
281
282
283    /**
284     * <p>
285     * Returns
286     * PV1 (Patient Visit) - creates it if necessary
287     * </p>
288     * 
289     *
290     */
291    public PV1 getPV1() { 
292       return getTyped("PV1", PV1.class);
293    }
294
295
296
297
298
299    /**
300     * <p>
301     * Returns
302     * PV2 (Patient Visit - Additional Information) - creates it if necessary
303     * </p>
304     * 
305     *
306     */
307    public PV2 getPV2() { 
308       return getTyped("PV2", PV2.class);
309    }
310
311
312
313
314
315    /**
316     * <p>
317     * Returns
318     * the first repetition of 
319     * DB1 (Disability) - creates it if necessary
320     * </p>
321     * 
322     *
323     */
324    public DB1 getDB1() { 
325       return getTyped("DB1", DB1.class);
326    }
327
328
329    /**
330     * <p>
331     * Returns a specific repetition of
332     * DB1 (Disability) - 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 DB1 getDB1(int rep) { 
341       return getTyped("DB1", rep, DB1.class);
342    }
343
344    /** 
345     * <p>
346     * Returns the number of existing repetitions of DB1 
347     * </p>
348     * 
349     */ 
350    public int getDB1Reps() { 
351        return getReps("DB1");
352    } 
353
354    /** 
355     * <p>
356     * Returns a non-modifiable List containing all current existing repetitions of DB1.
357     * <p>
358     * <p>
359     * Note that unlike {@link #getDB1()}, 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<DB1> getDB1All() throws HL7Exception {
365        return getAllAsList("DB1", DB1.class);
366    } 
367
368    /**
369     * <p>
370     * Inserts a specific repetition of DB1 (Disability)
371     * </p>
372     * 
373     *
374     * @see AbstractGroup#insertRepetition(Structure, int) 
375     */
376    public void insertDB1(DB1 structure, int rep) throws HL7Exception { 
377       super.insertRepetition( "DB1", structure, rep);
378    }
379
380
381    /**
382     * <p>
383     * Inserts a specific repetition of DB1 (Disability)
384     * </p>
385     * 
386     *
387     * @see AbstractGroup#insertRepetition(Structure, int) 
388     */
389    public DB1 insertDB1(int rep) throws HL7Exception { 
390       return (DB1)super.insertRepetition("DB1", rep);
391    }
392
393
394    /**
395     * <p>
396     * Removes a specific repetition of DB1 (Disability)
397     * </p>
398     * 
399     *
400     * @see AbstractGroup#removeRepetition(String, int) 
401     */
402    public DB1 removeDB1(int rep) throws HL7Exception { 
403       return (DB1)super.removeRepetition("DB1", rep);
404    }
405
406
407
408
409    /**
410     * <p>
411     * Returns
412     * the first repetition of 
413     * OBX (Observation/Result) - creates it if necessary
414     * </p>
415     * 
416     *
417     */
418    public OBX getOBX() { 
419       return getTyped("OBX", OBX.class);
420    }
421
422
423    /**
424     * <p>
425     * Returns a specific repetition of
426     * OBX (Observation/Result) - 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 OBX getOBX(int rep) { 
435       return getTyped("OBX", rep, OBX.class);
436    }
437
438    /** 
439     * <p>
440     * Returns the number of existing repetitions of OBX 
441     * </p>
442     * 
443     */ 
444    public int getOBXReps() { 
445        return getReps("OBX");
446    } 
447
448    /** 
449     * <p>
450     * Returns a non-modifiable List containing all current existing repetitions of OBX.
451     * <p>
452     * <p>
453     * Note that unlike {@link #getOBX()}, 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<OBX> getOBXAll() throws HL7Exception {
459        return getAllAsList("OBX", OBX.class);
460    } 
461
462    /**
463     * <p>
464     * Inserts a specific repetition of OBX (Observation/Result)
465     * </p>
466     * 
467     *
468     * @see AbstractGroup#insertRepetition(Structure, int) 
469     */
470    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
471       super.insertRepetition( "OBX", structure, rep);
472    }
473
474
475    /**
476     * <p>
477     * Inserts a specific repetition of OBX (Observation/Result)
478     * </p>
479     * 
480     *
481     * @see AbstractGroup#insertRepetition(Structure, int) 
482     */
483    public OBX insertOBX(int rep) throws HL7Exception { 
484       return (OBX)super.insertRepetition("OBX", rep);
485    }
486
487
488    /**
489     * <p>
490     * Removes a specific repetition of OBX (Observation/Result)
491     * </p>
492     * 
493     *
494     * @see AbstractGroup#removeRepetition(String, int) 
495     */
496    public OBX removeOBX(int rep) throws HL7Exception { 
497       return (OBX)super.removeRepetition("OBX", rep);
498    }
499
500
501
502
503    /**
504     * <p>
505     * Returns
506     * DG1 (Diagnosis) - creates it if necessary
507     * </p>
508     * 
509     *
510     */
511    public DG1 getDG1() { 
512       return getTyped("DG1", DG1.class);
513    }
514
515
516
517
518}
519