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_A37 message structure (see chapter 3.3.37). 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>optional </b> </li>
056                                 * <li>8: DB1 (Disability) <b>optional repeating</b> </li>
057                                 * <li>9: PID (Patient Identification) <b> </b> </li>
058                                 * <li>10: PD1 (Patient Additional Demographic) <b>optional </b> </li>
059                                 * <li>11: PV1 (Patient Visit) <b>optional </b> </li>
060                                 * <li>12: DB1 (Disability) <b>optional repeating</b> </li>
061 * </ul>
062 */
063//@SuppressWarnings("unused")
064public class ADT_A37 extends AbstractMessage  {
065
066    /**
067     * Creates a new ADT_A37 message with DefaultModelClassFactory. 
068     */ 
069    public ADT_A37() { 
070       this(new DefaultModelClassFactory());
071    }
072
073    /** 
074     * Creates a new ADT_A37 message with custom ModelClassFactory.
075     */
076    public ADT_A37(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, false, false);
090                                  this.add(DB1.class, false, true);
091                                  this.add(PID.class, true, false);
092                                  this.add(PD1.class, false, false);
093                                  this.add(PV1.class, false, false);
094                                  this.add(DB1.class, false, true);
095               } catch(HL7Exception e) {
096          log.error("Unexpected error creating ADT_A37 - 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     * the first repetition of 
305     * DB1 (Disability) - creates it if necessary
306     * </p>
307     * 
308     *
309     */
310    public DB1 getDB1() { 
311       return getTyped("DB1", DB1.class);
312    }
313
314
315    /**
316     * <p>
317     * Returns a specific repetition of
318     * DB1 (Disability) - 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 DB1 getDB1(int rep) { 
327       return getTyped("DB1", rep, DB1.class);
328    }
329
330    /** 
331     * <p>
332     * Returns the number of existing repetitions of DB1 
333     * </p>
334     * 
335     */ 
336    public int getDB1Reps() { 
337        return getReps("DB1");
338    } 
339
340    /** 
341     * <p>
342     * Returns a non-modifiable List containing all current existing repetitions of DB1.
343     * <p>
344     * <p>
345     * Note that unlike {@link #getDB1()}, 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<DB1> getDB1All() throws HL7Exception {
351        return getAllAsList("DB1", DB1.class);
352    } 
353
354    /**
355     * <p>
356     * Inserts a specific repetition of DB1 (Disability)
357     * </p>
358     * 
359     *
360     * @see AbstractGroup#insertRepetition(Structure, int) 
361     */
362    public void insertDB1(DB1 structure, int rep) throws HL7Exception { 
363       super.insertRepetition( "DB1", structure, rep);
364    }
365
366
367    /**
368     * <p>
369     * Inserts a specific repetition of DB1 (Disability)
370     * </p>
371     * 
372     *
373     * @see AbstractGroup#insertRepetition(Structure, int) 
374     */
375    public DB1 insertDB1(int rep) throws HL7Exception { 
376       return (DB1)super.insertRepetition("DB1", rep);
377    }
378
379
380    /**
381     * <p>
382     * Removes a specific repetition of DB1 (Disability)
383     * </p>
384     * 
385     *
386     * @see AbstractGroup#removeRepetition(String, int) 
387     */
388    public DB1 removeDB1(int rep) throws HL7Exception { 
389       return (DB1)super.removeRepetition("DB1", rep);
390    }
391
392
393
394
395    /**
396     * <p>
397     * Returns
398     * PID2 (Patient Identification) - creates it if necessary
399     * </p>
400     * 
401     *
402     */
403    public PID getPID2() { 
404       return getTyped("PID2", PID.class);
405    }
406
407
408
409
410
411    /**
412     * <p>
413     * Returns
414     * PD12 (Patient Additional Demographic) - creates it if necessary
415     * </p>
416     * 
417     *
418     */
419    public PD1 getPD12() { 
420       return getTyped("PD12", PD1.class);
421    }
422
423
424
425
426
427    /**
428     * <p>
429     * Returns
430     * PV12 (Patient Visit) - creates it if necessary
431     * </p>
432     * 
433     *
434     */
435    public PV1 getPV12() { 
436       return getTyped("PV12", PV1.class);
437    }
438
439
440
441
442
443    /**
444     * <p>
445     * Returns
446     * the first repetition of 
447     * DB12 (Disability) - creates it if necessary
448     * </p>
449     * 
450     *
451     */
452    public DB1 getDB12() { 
453       return getTyped("DB12", DB1.class);
454    }
455
456
457    /**
458     * <p>
459     * Returns a specific repetition of
460     * DB12 (Disability) - creates it if necessary
461     * </p>
462     * 
463     *
464     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
465     * @throws HL7Exception if the repetition requested is more than one 
466     *     greater than the number of existing repetitions.
467     */
468    public DB1 getDB12(int rep) { 
469       return getTyped("DB12", rep, DB1.class);
470    }
471
472    /** 
473     * <p>
474     * Returns the number of existing repetitions of DB12 
475     * </p>
476     * 
477     */ 
478    public int getDB12Reps() { 
479        return getReps("DB12");
480    } 
481
482    /** 
483     * <p>
484     * Returns a non-modifiable List containing all current existing repetitions of DB12.
485     * <p>
486     * <p>
487     * Note that unlike {@link #getDB12()}, this method will not create any reps
488     * if none are already present, so an empty list may be returned.
489     * </p>
490     * 
491     */ 
492    public java.util.List<DB1> getDB12All() throws HL7Exception {
493        return getAllAsList("DB12", DB1.class);
494    } 
495
496    /**
497     * <p>
498     * Inserts a specific repetition of DB12 (Disability)
499     * </p>
500     * 
501     *
502     * @see AbstractGroup#insertRepetition(Structure, int) 
503     */
504    public void insertDB12(DB1 structure, int rep) throws HL7Exception { 
505       super.insertRepetition( "DB12", structure, rep);
506    }
507
508
509    /**
510     * <p>
511     * Inserts a specific repetition of DB12 (Disability)
512     * </p>
513     * 
514     *
515     * @see AbstractGroup#insertRepetition(Structure, int) 
516     */
517    public DB1 insertDB12(int rep) throws HL7Exception { 
518       return (DB1)super.insertRepetition("DB12", rep);
519    }
520
521
522    /**
523     * <p>
524     * Removes a specific repetition of DB12 (Disability)
525     * </p>
526     * 
527     *
528     * @see AbstractGroup#removeRepetition(String, int) 
529     */
530    public DB1 removeDB12(int rep) throws HL7Exception { 
531       return (DB1)super.removeRepetition("DB12", rep);
532    }
533
534
535
536}
537