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