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 java.util.List;
040
041import ca.uhn.hl7v2.HL7Exception;
042import ca.uhn.hl7v2.parser.ModelClassFactory;
043import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
044import ca.uhn.hl7v2.model.AbstractMessage;
045
046/**
047 * <p>Represents a ADT_A17 message structure (see chapter 3.3.17). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (Message Header) <b> </b></li>
051                 * <li>2: SFT (Software Segment) <b>optional repeating</b></li>
052                 * <li>3: UAC (User Authentication Credential Segment) <b>optional </b></li>
053                 * <li>4: EVN (Event Type) <b> </b></li>
054                 * <li>5: PID (Patient Identification) <b> </b></li>
055                 * <li>6: PD1 (Patient Additional Demographic) <b>optional </b></li>
056                 * <li>7: PV1 (Patient Visit) <b> </b></li>
057                 * <li>8: PV2 (Patient Visit - Additional Information) <b>optional </b></li>
058                 * <li>9: DB1 (Disability) <b>optional repeating</b></li>
059                 * <li>10: OBX (Observation/Result) <b>optional repeating</b></li>
060                 * <li>11: PID (Patient Identification) <b> </b></li>
061                 * <li>12: PD1 (Patient Additional Demographic) <b>optional </b></li>
062                 * <li>13: PV1 (Patient Visit) <b> </b></li>
063                 * <li>14: PV2 (Patient Visit - Additional Information) <b>optional </b></li>
064                 * <li>15: DB1 (Disability) <b>optional repeating</b></li>
065                 * <li>16: OBX (Observation/Result) <b>optional repeating</b></li>
066 * </ul>
067 */
068@SuppressWarnings("unused")
069public class ADT_A17 extends AbstractMessage  {
070
071    /**
072     * Creates a new ADT_A17 message with DefaultModelClassFactory. 
073     */ 
074    public ADT_A17() { 
075       this(new DefaultModelClassFactory());
076    }
077
078    /** 
079     * Creates a new ADT_A17 message with custom ModelClassFactory.
080     */
081    public ADT_A17(ModelClassFactory factory) {
082       super(factory);
083       init(factory);
084    }
085
086    private void init(ModelClassFactory factory) {
087       try {
088                          this.add(MSH.class, true, false);
089                          this.add(SFT.class, false, true);
090                          this.add(UAC.class, false, false);
091                          this.add(EVN.class, true, false);
092                          this.add(PID.class, true, false);
093                          this.add(PD1.class, false, false);
094                          this.add(PV1.class, true, false);
095                          this.add(PV2.class, false, false);
096                          this.add(DB1.class, false, true);
097                          this.add(OBX.class, false, true);
098                          this.add(PID.class, true, false);
099                          this.add(PD1.class, false, false);
100                          this.add(PV1.class, true, false);
101                          this.add(PV2.class, false, false);
102                          this.add(DB1.class, false, true);
103                          this.add(OBX.class, false, true);
104       } catch(HL7Exception e) {
105          log.error("Unexpected error creating ADT_A17 - this is probably a bug in the source code generator.", e);
106       }
107    }
108
109    /** 
110     * Returns "2.6"
111     */
112    public String getVersion() {
113       return "2.6";
114    }
115
116
117
118    /**
119     * Returns
120     * MSH (Message Header) - creates it if necessary
121     */
122    public MSH getMSH() { 
123       return getTyped("MSH", MSH.class);
124    }
125
126
127
128
129    /**
130     * Returns
131     * the first repetition of 
132     * SFT (Software Segment) - creates it if necessary
133     */
134    public SFT getSFT() { 
135       return getTyped("SFT", SFT.class);
136    }
137
138
139    /**
140     * Returns a specific repetition of
141     * SFT (Software Segment) - creates it if necessary
142     *
143     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
144     * @throws HL7Exception if the repetition requested is more than one 
145     *     greater than the number of existing repetitions.
146     */
147    public SFT getSFT(int rep) { 
148       return getTyped("SFT", rep, SFT.class);
149    }
150
151    /** 
152     * Returns the number of existing repetitions of SFT 
153     */ 
154    public int getSFTReps() { 
155        return getReps("SFT");
156    } 
157
158    /** 
159     * <p>
160     * Returns a non-modifiable List containing all current existing repetitions of SFT.
161     * <p>
162     * <p>
163     * Note that unlike {@link #getSFT()}, this method will not create any reps
164     * if none are already present, so an empty list may be returned.
165     * </p>
166     */ 
167    public List<SFT> getSFTAll() throws HL7Exception {
168        return getAllAsList("SFT", SFT.class);
169    } 
170
171    /**
172     * Inserts a specific repetition of SFT (Software Segment)
173     * @see AbstractGroup#insertRepetition(Structure, int) 
174     */
175    public void insertSFT(SFT structure, int rep) throws HL7Exception { 
176       super.insertRepetition( "SFT", structure, rep);
177    }
178
179
180    /**
181     * Inserts a specific repetition of SFT (Software Segment)
182     * @see AbstractGroup#insertRepetition(Structure, int) 
183     */
184    public SFT insertSFT(int rep) throws HL7Exception { 
185       return (SFT)super.insertRepetition("SFT", rep);
186    }
187
188
189    /**
190     * Removes a specific repetition of SFT (Software Segment)
191     * @see AbstractGroup#removeRepetition(String, int) 
192     */
193    public SFT removeSFT(int rep) throws HL7Exception { 
194       return (SFT)super.removeRepetition("SFT", rep);
195    }
196
197
198
199    /**
200     * Returns
201     * UAC (User Authentication Credential Segment) - creates it if necessary
202     */
203    public UAC getUAC() { 
204       return getTyped("UAC", UAC.class);
205    }
206
207
208
209
210    /**
211     * Returns
212     * EVN (Event Type) - creates it if necessary
213     */
214    public EVN getEVN() { 
215       return getTyped("EVN", EVN.class);
216    }
217
218
219
220
221    /**
222     * Returns
223     * PID (Patient Identification) - creates it if necessary
224     */
225    public PID getPID() { 
226       return getTyped("PID", PID.class);
227    }
228
229
230
231
232    /**
233     * Returns
234     * PD1 (Patient Additional Demographic) - creates it if necessary
235     */
236    public PD1 getPD1() { 
237       return getTyped("PD1", PD1.class);
238    }
239
240
241
242
243    /**
244     * Returns
245     * PV1 (Patient Visit) - creates it if necessary
246     */
247    public PV1 getPV1() { 
248       return getTyped("PV1", PV1.class);
249    }
250
251
252
253
254    /**
255     * Returns
256     * PV2 (Patient Visit - Additional Information) - creates it if necessary
257     */
258    public PV2 getPV2() { 
259       return getTyped("PV2", PV2.class);
260    }
261
262
263
264
265    /**
266     * Returns
267     * the first repetition of 
268     * DB1 (Disability) - creates it if necessary
269     */
270    public DB1 getDB1() { 
271       return getTyped("DB1", DB1.class);
272    }
273
274
275    /**
276     * Returns a specific repetition of
277     * DB1 (Disability) - creates it if necessary
278     *
279     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
280     * @throws HL7Exception if the repetition requested is more than one 
281     *     greater than the number of existing repetitions.
282     */
283    public DB1 getDB1(int rep) { 
284       return getTyped("DB1", rep, DB1.class);
285    }
286
287    /** 
288     * Returns the number of existing repetitions of DB1 
289     */ 
290    public int getDB1Reps() { 
291        return getReps("DB1");
292    } 
293
294    /** 
295     * <p>
296     * Returns a non-modifiable List containing all current existing repetitions of DB1.
297     * <p>
298     * <p>
299     * Note that unlike {@link #getDB1()}, this method will not create any reps
300     * if none are already present, so an empty list may be returned.
301     * </p>
302     */ 
303    public List<DB1> getDB1All() throws HL7Exception {
304        return getAllAsList("DB1", DB1.class);
305    } 
306
307    /**
308     * Inserts a specific repetition of DB1 (Disability)
309     * @see AbstractGroup#insertRepetition(Structure, int) 
310     */
311    public void insertDB1(DB1 structure, int rep) throws HL7Exception { 
312       super.insertRepetition( "DB1", structure, rep);
313    }
314
315
316    /**
317     * Inserts a specific repetition of DB1 (Disability)
318     * @see AbstractGroup#insertRepetition(Structure, int) 
319     */
320    public DB1 insertDB1(int rep) throws HL7Exception { 
321       return (DB1)super.insertRepetition("DB1", rep);
322    }
323
324
325    /**
326     * Removes a specific repetition of DB1 (Disability)
327     * @see AbstractGroup#removeRepetition(String, int) 
328     */
329    public DB1 removeDB1(int rep) throws HL7Exception { 
330       return (DB1)super.removeRepetition("DB1", rep);
331    }
332
333
334
335    /**
336     * Returns
337     * the first repetition of 
338     * OBX (Observation/Result) - creates it if necessary
339     */
340    public OBX getOBX() { 
341       return getTyped("OBX", OBX.class);
342    }
343
344
345    /**
346     * Returns a specific repetition of
347     * OBX (Observation/Result) - creates it if necessary
348     *
349     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
350     * @throws HL7Exception if the repetition requested is more than one 
351     *     greater than the number of existing repetitions.
352     */
353    public OBX getOBX(int rep) { 
354       return getTyped("OBX", rep, OBX.class);
355    }
356
357    /** 
358     * Returns the number of existing repetitions of OBX 
359     */ 
360    public int getOBXReps() { 
361        return getReps("OBX");
362    } 
363
364    /** 
365     * <p>
366     * Returns a non-modifiable List containing all current existing repetitions of OBX.
367     * <p>
368     * <p>
369     * Note that unlike {@link #getOBX()}, this method will not create any reps
370     * if none are already present, so an empty list may be returned.
371     * </p>
372     */ 
373    public List<OBX> getOBXAll() throws HL7Exception {
374        return getAllAsList("OBX", OBX.class);
375    } 
376
377    /**
378     * Inserts a specific repetition of OBX (Observation/Result)
379     * @see AbstractGroup#insertRepetition(Structure, int) 
380     */
381    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
382       super.insertRepetition( "OBX", structure, rep);
383    }
384
385
386    /**
387     * Inserts a specific repetition of OBX (Observation/Result)
388     * @see AbstractGroup#insertRepetition(Structure, int) 
389     */
390    public OBX insertOBX(int rep) throws HL7Exception { 
391       return (OBX)super.insertRepetition("OBX", rep);
392    }
393
394
395    /**
396     * Removes a specific repetition of OBX (Observation/Result)
397     * @see AbstractGroup#removeRepetition(String, int) 
398     */
399    public OBX removeOBX(int rep) throws HL7Exception { 
400       return (OBX)super.removeRepetition("OBX", rep);
401    }
402
403
404
405    /**
406     * Returns
407     * PID2 (Patient Identification) - creates it if necessary
408     */
409    public PID getPID2() { 
410       return getTyped("PID2", PID.class);
411    }
412
413
414
415
416    /**
417     * Returns
418     * PD12 (Patient Additional Demographic) - creates it if necessary
419     */
420    public PD1 getPD12() { 
421       return getTyped("PD12", PD1.class);
422    }
423
424
425
426
427    /**
428     * Returns
429     * PV12 (Patient Visit) - creates it if necessary
430     */
431    public PV1 getPV12() { 
432       return getTyped("PV12", PV1.class);
433    }
434
435
436
437
438    /**
439     * Returns
440     * PV22 (Patient Visit - Additional Information) - creates it if necessary
441     */
442    public PV2 getPV22() { 
443       return getTyped("PV22", PV2.class);
444    }
445
446
447
448
449    /**
450     * Returns
451     * the first repetition of 
452     * DB12 (Disability) - creates it if necessary
453     */
454    public DB1 getDB12() { 
455       return getTyped("DB12", DB1.class);
456    }
457
458
459    /**
460     * Returns a specific repetition of
461     * DB12 (Disability) - creates it if necessary
462     *
463     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
464     * @throws HL7Exception if the repetition requested is more than one 
465     *     greater than the number of existing repetitions.
466     */
467    public DB1 getDB12(int rep) { 
468       return getTyped("DB12", rep, DB1.class);
469    }
470
471    /** 
472     * Returns the number of existing repetitions of DB12 
473     */ 
474    public int getDB12Reps() { 
475        return getReps("DB12");
476    } 
477
478    /** 
479     * <p>
480     * Returns a non-modifiable List containing all current existing repetitions of DB12.
481     * <p>
482     * <p>
483     * Note that unlike {@link #getDB12()}, this method will not create any reps
484     * if none are already present, so an empty list may be returned.
485     * </p>
486     */ 
487    public List<DB1> getDB12All() throws HL7Exception {
488        return getAllAsList("DB12", DB1.class);
489    } 
490
491    /**
492     * Inserts a specific repetition of DB12 (Disability)
493     * @see AbstractGroup#insertRepetition(Structure, int) 
494     */
495    public void insertDB12(DB1 structure, int rep) throws HL7Exception { 
496       super.insertRepetition( "DB12", structure, rep);
497    }
498
499
500    /**
501     * Inserts a specific repetition of DB12 (Disability)
502     * @see AbstractGroup#insertRepetition(Structure, int) 
503     */
504    public DB1 insertDB12(int rep) throws HL7Exception { 
505       return (DB1)super.insertRepetition("DB12", rep);
506    }
507
508
509    /**
510     * Removes a specific repetition of DB12 (Disability)
511     * @see AbstractGroup#removeRepetition(String, int) 
512     */
513    public DB1 removeDB12(int rep) throws HL7Exception { 
514       return (DB1)super.removeRepetition("DB12", rep);
515    }
516
517
518
519    /**
520     * Returns
521     * the first repetition of 
522     * OBX2 (Observation/Result) - creates it if necessary
523     */
524    public OBX getOBX2() { 
525       return getTyped("OBX2", OBX.class);
526    }
527
528
529    /**
530     * Returns a specific repetition of
531     * OBX2 (Observation/Result) - creates it if necessary
532     *
533     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
534     * @throws HL7Exception if the repetition requested is more than one 
535     *     greater than the number of existing repetitions.
536     */
537    public OBX getOBX2(int rep) { 
538       return getTyped("OBX2", rep, OBX.class);
539    }
540
541    /** 
542     * Returns the number of existing repetitions of OBX2 
543     */ 
544    public int getOBX2Reps() { 
545        return getReps("OBX2");
546    } 
547
548    /** 
549     * <p>
550     * Returns a non-modifiable List containing all current existing repetitions of OBX2.
551     * <p>
552     * <p>
553     * Note that unlike {@link #getOBX2()}, this method will not create any reps
554     * if none are already present, so an empty list may be returned.
555     * </p>
556     */ 
557    public List<OBX> getOBX2All() throws HL7Exception {
558        return getAllAsList("OBX2", OBX.class);
559    } 
560
561    /**
562     * Inserts a specific repetition of OBX2 (Observation/Result)
563     * @see AbstractGroup#insertRepetition(Structure, int) 
564     */
565    public void insertOBX2(OBX structure, int rep) throws HL7Exception { 
566       super.insertRepetition( "OBX2", structure, rep);
567    }
568
569
570    /**
571     * Inserts a specific repetition of OBX2 (Observation/Result)
572     * @see AbstractGroup#insertRepetition(Structure, int) 
573     */
574    public OBX insertOBX2(int rep) throws HL7Exception { 
575       return (OBX)super.insertRepetition("OBX2", rep);
576    }
577
578
579    /**
580     * Removes a specific repetition of OBX2 (Observation/Result)
581     * @see AbstractGroup#removeRepetition(String, int) 
582     */
583    public OBX removeOBX2(int rep) throws HL7Exception { 
584       return (OBX)super.removeRepetition("OBX2", rep);
585    }
586
587
588
589}
590