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.v23.message;
035
036import ca.uhn.hl7v2.model.v23.group.*;
037import ca.uhn.hl7v2.model.v23.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_A03 message structure (see chapter ?). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (Message header segment) <b> </b></li>
051                 * <li>2: EVN (Event type) <b> </b></li>
052                 * <li>3: PID (Patient Identification) <b> </b></li>
053                 * <li>4: PD1 (Patient Demographic) <b>optional </b></li>
054                 * <li>5: PV1 (Patient visit) <b> </b></li>
055                 * <li>6: PV2 (Patient visit - additional information) <b>optional </b></li>
056                 * <li>7: DB1 (Disability Segment) <b>optional repeating</b></li>
057                 * <li>8: DG1 (Diagnosis) <b>optional repeating</b></li>
058                 * <li>9: DRG (Diagnosis Related Group) <b>optional </b></li>
059                 * <li>10: ADT_A03_PROCEDURE (a Group object) <b>optional repeating</b></li>
060                 * <li>11: OBX (Observation segment) <b>optional repeating</b></li>
061 * </ul>
062 */
063@SuppressWarnings("unused")
064public class ADT_A03 extends AbstractMessage  {
065
066    /**
067     * Creates a new ADT_A03 message with DefaultModelClassFactory. 
068     */ 
069    public ADT_A03() { 
070       this(new DefaultModelClassFactory());
071    }
072
073    /** 
074     * Creates a new ADT_A03 message with custom ModelClassFactory.
075     */
076    public ADT_A03(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(EVN.class, true, false);
085                          this.add(PID.class, true, false);
086                          this.add(PD1.class, false, false);
087                          this.add(PV1.class, true, false);
088                          this.add(PV2.class, false, false);
089                          this.add(DB1.class, false, true);
090                          this.add(DG1.class, false, true);
091                          this.add(DRG.class, false, false);
092                          this.add(ADT_A03_PROCEDURE.class, false, true);
093                          this.add(OBX.class, false, true);
094       } catch(HL7Exception e) {
095          log.error("Unexpected error creating ADT_A03 - this is probably a bug in the source code generator.", e);
096       }
097    }
098
099    /** 
100     * Returns "2.3"
101     */
102    public String getVersion() {
103       return "2.3";
104    }
105
106
107
108    /**
109     * Returns
110     * MSH (Message header segment) - creates it if necessary
111     */
112    public MSH getMSH() { 
113       return getTyped("MSH", MSH.class);
114    }
115
116
117
118
119    /**
120     * Returns
121     * EVN (Event type) - creates it if necessary
122     */
123    public EVN getEVN() { 
124       return getTyped("EVN", EVN.class);
125    }
126
127
128
129
130    /**
131     * Returns
132     * PID (Patient Identification) - creates it if necessary
133     */
134    public PID getPID() { 
135       return getTyped("PID", PID.class);
136    }
137
138
139
140
141    /**
142     * Returns
143     * PD1 (Patient Demographic) - creates it if necessary
144     */
145    public PD1 getPD1() { 
146       return getTyped("PD1", PD1.class);
147    }
148
149
150
151
152    /**
153     * Returns
154     * PV1 (Patient visit) - creates it if necessary
155     */
156    public PV1 getPV1() { 
157       return getTyped("PV1", PV1.class);
158    }
159
160
161
162
163    /**
164     * Returns
165     * PV2 (Patient visit - additional information) - creates it if necessary
166     */
167    public PV2 getPV2() { 
168       return getTyped("PV2", PV2.class);
169    }
170
171
172
173
174    /**
175     * Returns
176     * the first repetition of 
177     * DB1 (Disability Segment) - creates it if necessary
178     */
179    public DB1 getDB1() { 
180       return getTyped("DB1", DB1.class);
181    }
182
183
184    /**
185     * Returns a specific repetition of
186     * DB1 (Disability Segment) - creates it if necessary
187     *
188     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
189     * @throws HL7Exception if the repetition requested is more than one 
190     *     greater than the number of existing repetitions.
191     */
192    public DB1 getDB1(int rep) { 
193       return getTyped("DB1", rep, DB1.class);
194    }
195
196    /** 
197     * Returns the number of existing repetitions of DB1 
198     */ 
199    public int getDB1Reps() { 
200        return getReps("DB1");
201    } 
202
203    /** 
204     * <p>
205     * Returns a non-modifiable List containing all current existing repetitions of DB1.
206     * <p>
207     * <p>
208     * Note that unlike {@link #getDB1()}, this method will not create any reps
209     * if none are already present, so an empty list may be returned.
210     * </p>
211     */ 
212    public List<DB1> getDB1All() throws HL7Exception {
213        return getAllAsList("DB1", DB1.class);
214    } 
215
216    /**
217     * Inserts a specific repetition of DB1 (Disability Segment)
218     * @see AbstractGroup#insertRepetition(Structure, int) 
219     */
220    public void insertDB1(DB1 structure, int rep) throws HL7Exception { 
221       super.insertRepetition( "DB1", structure, rep);
222    }
223
224
225    /**
226     * Inserts a specific repetition of DB1 (Disability Segment)
227     * @see AbstractGroup#insertRepetition(Structure, int) 
228     */
229    public DB1 insertDB1(int rep) throws HL7Exception { 
230       return (DB1)super.insertRepetition("DB1", rep);
231    }
232
233
234    /**
235     * Removes a specific repetition of DB1 (Disability Segment)
236     * @see AbstractGroup#removeRepetition(String, int) 
237     */
238    public DB1 removeDB1(int rep) throws HL7Exception { 
239       return (DB1)super.removeRepetition("DB1", rep);
240    }
241
242
243
244    /**
245     * Returns
246     * the first repetition of 
247     * DG1 (Diagnosis) - creates it if necessary
248     */
249    public DG1 getDG1() { 
250       return getTyped("DG1", DG1.class);
251    }
252
253
254    /**
255     * Returns a specific repetition of
256     * DG1 (Diagnosis) - creates it if necessary
257     *
258     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
259     * @throws HL7Exception if the repetition requested is more than one 
260     *     greater than the number of existing repetitions.
261     */
262    public DG1 getDG1(int rep) { 
263       return getTyped("DG1", rep, DG1.class);
264    }
265
266    /** 
267     * Returns the number of existing repetitions of DG1 
268     */ 
269    public int getDG1Reps() { 
270        return getReps("DG1");
271    } 
272
273    /** 
274     * <p>
275     * Returns a non-modifiable List containing all current existing repetitions of DG1.
276     * <p>
277     * <p>
278     * Note that unlike {@link #getDG1()}, this method will not create any reps
279     * if none are already present, so an empty list may be returned.
280     * </p>
281     */ 
282    public List<DG1> getDG1All() throws HL7Exception {
283        return getAllAsList("DG1", DG1.class);
284    } 
285
286    /**
287     * Inserts a specific repetition of DG1 (Diagnosis)
288     * @see AbstractGroup#insertRepetition(Structure, int) 
289     */
290    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
291       super.insertRepetition( "DG1", structure, rep);
292    }
293
294
295    /**
296     * Inserts a specific repetition of DG1 (Diagnosis)
297     * @see AbstractGroup#insertRepetition(Structure, int) 
298     */
299    public DG1 insertDG1(int rep) throws HL7Exception { 
300       return (DG1)super.insertRepetition("DG1", rep);
301    }
302
303
304    /**
305     * Removes a specific repetition of DG1 (Diagnosis)
306     * @see AbstractGroup#removeRepetition(String, int) 
307     */
308    public DG1 removeDG1(int rep) throws HL7Exception { 
309       return (DG1)super.removeRepetition("DG1", rep);
310    }
311
312
313
314    /**
315     * Returns
316     * DRG (Diagnosis Related Group) - creates it if necessary
317     */
318    public DRG getDRG() { 
319       return getTyped("DRG", DRG.class);
320    }
321
322
323
324
325    /**
326     * Returns
327     * the first repetition of 
328     * PROCEDURE (a Group object) - creates it if necessary
329     */
330    public ADT_A03_PROCEDURE getPROCEDURE() { 
331       return getTyped("PROCEDURE", ADT_A03_PROCEDURE.class);
332    }
333
334
335    /**
336     * Returns a specific repetition of
337     * PROCEDURE (a Group object) - creates it if necessary
338     *
339     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
340     * @throws HL7Exception if the repetition requested is more than one 
341     *     greater than the number of existing repetitions.
342     */
343    public ADT_A03_PROCEDURE getPROCEDURE(int rep) { 
344       return getTyped("PROCEDURE", rep, ADT_A03_PROCEDURE.class);
345    }
346
347    /** 
348     * Returns the number of existing repetitions of PROCEDURE 
349     */ 
350    public int getPROCEDUREReps() { 
351        return getReps("PROCEDURE");
352    } 
353
354    /** 
355     * <p>
356     * Returns a non-modifiable List containing all current existing repetitions of PROCEDURE.
357     * <p>
358     * <p>
359     * Note that unlike {@link #getPROCEDURE()}, this method will not create any reps
360     * if none are already present, so an empty list may be returned.
361     * </p>
362     */ 
363    public List<ADT_A03_PROCEDURE> getPROCEDUREAll() throws HL7Exception {
364        return getAllAsList("PROCEDURE", ADT_A03_PROCEDURE.class);
365    } 
366
367    /**
368     * Inserts a specific repetition of PROCEDURE (a Group object)
369     * @see AbstractGroup#insertRepetition(Structure, int) 
370     */
371    public void insertPROCEDURE(ADT_A03_PROCEDURE structure, int rep) throws HL7Exception { 
372       super.insertRepetition( "PROCEDURE", structure, rep);
373    }
374
375
376    /**
377     * Inserts a specific repetition of PROCEDURE (a Group object)
378     * @see AbstractGroup#insertRepetition(Structure, int) 
379     */
380    public ADT_A03_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception { 
381       return (ADT_A03_PROCEDURE)super.insertRepetition("PROCEDURE", rep);
382    }
383
384
385    /**
386     * Removes a specific repetition of PROCEDURE (a Group object)
387     * @see AbstractGroup#removeRepetition(String, int) 
388     */
389    public ADT_A03_PROCEDURE removePROCEDURE(int rep) throws HL7Exception { 
390       return (ADT_A03_PROCEDURE)super.removeRepetition("PROCEDURE", rep);
391    }
392
393
394
395    /**
396     * Returns
397     * the first repetition of 
398     * OBX (Observation segment) - creates it if necessary
399     */
400    public OBX getOBX() { 
401       return getTyped("OBX", OBX.class);
402    }
403
404
405    /**
406     * Returns a specific repetition of
407     * OBX (Observation segment) - creates it if necessary
408     *
409     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
410     * @throws HL7Exception if the repetition requested is more than one 
411     *     greater than the number of existing repetitions.
412     */
413    public OBX getOBX(int rep) { 
414       return getTyped("OBX", rep, OBX.class);
415    }
416
417    /** 
418     * Returns the number of existing repetitions of OBX 
419     */ 
420    public int getOBXReps() { 
421        return getReps("OBX");
422    } 
423
424    /** 
425     * <p>
426     * Returns a non-modifiable List containing all current existing repetitions of OBX.
427     * <p>
428     * <p>
429     * Note that unlike {@link #getOBX()}, this method will not create any reps
430     * if none are already present, so an empty list may be returned.
431     * </p>
432     */ 
433    public List<OBX> getOBXAll() throws HL7Exception {
434        return getAllAsList("OBX", OBX.class);
435    } 
436
437    /**
438     * Inserts a specific repetition of OBX (Observation segment)
439     * @see AbstractGroup#insertRepetition(Structure, int) 
440     */
441    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
442       super.insertRepetition( "OBX", structure, rep);
443    }
444
445
446    /**
447     * Inserts a specific repetition of OBX (Observation segment)
448     * @see AbstractGroup#insertRepetition(Structure, int) 
449     */
450    public OBX insertOBX(int rep) throws HL7Exception { 
451       return (OBX)super.insertRepetition("OBX", rep);
452    }
453
454
455    /**
456     * Removes a specific repetition of OBX (Observation segment)
457     * @see AbstractGroup#removeRepetition(String, int) 
458     */
459    public OBX removeOBX(int rep) throws HL7Exception { 
460       return (OBX)super.removeRepetition("OBX", rep);
461    }
462
463
464
465}
466