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.v231.message;
035
036import ca.uhn.hl7v2.model.v231.group.*;
037import ca.uhn.hl7v2.model.v231.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 MFR_M01 message structure. This structure contains the 
047 * following elements: </p>
048 * <ul>
049                                 * <li>1: MSH (MSH - message header segment) <b> </b> </li>
050                                 * <li>2: MSA (MSA - message acknowledgment segment) <b> </b> </li>
051                                 * <li>3: ERR (ERR - error segment) <b>optional </b> </li>
052                                 * <li>4: QAK (Query Acknowledgement) <b>optional </b> </li>
053                                 * <li>5: QRD (QRD - original-style query definition segment) <b> </b> </li>
054                                 * <li>6: QRF (QRF - original style query filter segment) <b>optional </b> </li>
055                                 * <li>7: MFI (MFI - master file identification segment) <b> </b> </li>
056                                 * <li>8: MFR_M01_MFEZxx (a Group object) <b> repeating</b> </li>
057                                 * <li>9: DSC (DSC - Continuation pointer segment) <b>optional </b> </li>
058 * </ul>
059 */
060//@SuppressWarnings("unused")
061public class MFR_M01 extends AbstractMessage  {
062
063    /**
064     * Creates a new MFR_M01 message with DefaultModelClassFactory. 
065     */ 
066    public MFR_M01() { 
067       this(new DefaultModelClassFactory());
068    }
069
070    /** 
071     * Creates a new MFR_M01 message with custom ModelClassFactory.
072     */
073    public MFR_M01(ModelClassFactory factory) {
074       super(factory);
075       init(factory);
076    }
077
078    private void init(ModelClassFactory factory) {
079       try {
080                          this.add(MSH.class, true, false);
081                                  this.add(MSA.class, true, false);
082                                  this.add(ERR.class, false, false);
083                                  this.add(QAK.class, false, false);
084                                  this.add(QRD.class, true, false);
085                                  this.add(QRF.class, false, false);
086                                  this.add(MFI.class, true, false);
087                                  this.add(MFR_M01_MFEZxx.class, true, true);
088                                  this.add(DSC.class, false, false);
089               } catch(HL7Exception e) {
090          log.error("Unexpected error creating MFR_M01 - this is probably a bug in the source code generator.", e);
091       }
092    }
093
094
095    /** 
096     * Returns "2.3.1"
097     */
098    public String getVersion() {
099       return "2.3.1";
100    }
101
102
103
104
105    /**
106     * <p>
107     * Returns
108     * MSH (MSH - message header segment) - creates it if necessary
109     * </p>
110     * 
111     *
112     */
113    public MSH getMSH() { 
114       return getTyped("MSH", MSH.class);
115    }
116
117
118
119
120
121    /**
122     * <p>
123     * Returns
124     * MSA (MSA - message acknowledgment segment) - creates it if necessary
125     * </p>
126     * 
127     *
128     */
129    public MSA getMSA() { 
130       return getTyped("MSA", MSA.class);
131    }
132
133
134
135
136
137    /**
138     * <p>
139     * Returns
140     * ERR (ERR - error segment) - creates it if necessary
141     * </p>
142     * 
143     *
144     */
145    public ERR getERR() { 
146       return getTyped("ERR", ERR.class);
147    }
148
149
150
151
152
153    /**
154     * <p>
155     * Returns
156     * QAK (Query Acknowledgement) - creates it if necessary
157     * </p>
158     * 
159     *
160     */
161    public QAK getQAK() { 
162       return getTyped("QAK", QAK.class);
163    }
164
165
166
167
168
169    /**
170     * <p>
171     * Returns
172     * QRD (QRD - original-style query definition segment) - creates it if necessary
173     * </p>
174     * 
175     *
176     */
177    public QRD getQRD() { 
178       return getTyped("QRD", QRD.class);
179    }
180
181
182
183
184
185    /**
186     * <p>
187     * Returns
188     * QRF (QRF - original style query filter segment) - creates it if necessary
189     * </p>
190     * 
191     *
192     */
193    public QRF getQRF() { 
194       return getTyped("QRF", QRF.class);
195    }
196
197
198
199
200
201    /**
202     * <p>
203     * Returns
204     * MFI (MFI - master file identification segment) - creates it if necessary
205     * </p>
206     * 
207     *
208     */
209    public MFI getMFI() { 
210       return getTyped("MFI", MFI.class);
211    }
212
213
214
215
216
217    /**
218     * <p>
219     * Returns
220     * the first repetition of 
221     * MFEZxx (a Group object) - creates it if necessary
222     * </p>
223     * 
224     *
225     */
226    public MFR_M01_MFEZxx getMFEZxx() { 
227       return getTyped("MFEZxx", MFR_M01_MFEZxx.class);
228    }
229
230
231    /**
232     * <p>
233     * Returns a specific repetition of
234     * MFEZxx (a Group object) - creates it if necessary
235     * </p>
236     * 
237     *
238     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
239     * @throws HL7Exception if the repetition requested is more than one 
240     *     greater than the number of existing repetitions.
241     */
242    public MFR_M01_MFEZxx getMFEZxx(int rep) { 
243       return getTyped("MFEZxx", rep, MFR_M01_MFEZxx.class);
244    }
245
246    /** 
247     * <p>
248     * Returns the number of existing repetitions of MFEZxx 
249     * </p>
250     * 
251     */ 
252    public int getMFEZxxReps() { 
253        return getReps("MFEZxx");
254    } 
255
256    /** 
257     * <p>
258     * Returns a non-modifiable List containing all current existing repetitions of MFEZxx.
259     * <p>
260     * <p>
261     * Note that unlike {@link #getMFEZxx()}, this method will not create any reps
262     * if none are already present, so an empty list may be returned.
263     * </p>
264     * 
265     */ 
266    public java.util.List<MFR_M01_MFEZxx> getMFEZxxAll() throws HL7Exception {
267        return getAllAsList("MFEZxx", MFR_M01_MFEZxx.class);
268    } 
269
270    /**
271     * <p>
272     * Inserts a specific repetition of MFEZxx (a Group object)
273     * </p>
274     * 
275     *
276     * @see AbstractGroup#insertRepetition(Structure, int) 
277     */
278    public void insertMFEZxx(MFR_M01_MFEZxx structure, int rep) throws HL7Exception { 
279       super.insertRepetition( "MFEZxx", structure, rep);
280    }
281
282
283    /**
284     * <p>
285     * Inserts a specific repetition of MFEZxx (a Group object)
286     * </p>
287     * 
288     *
289     * @see AbstractGroup#insertRepetition(Structure, int) 
290     */
291    public MFR_M01_MFEZxx insertMFEZxx(int rep) throws HL7Exception { 
292       return (MFR_M01_MFEZxx)super.insertRepetition("MFEZxx", rep);
293    }
294
295
296    /**
297     * <p>
298     * Removes a specific repetition of MFEZxx (a Group object)
299     * </p>
300     * 
301     *
302     * @see AbstractGroup#removeRepetition(String, int) 
303     */
304    public MFR_M01_MFEZxx removeMFEZxx(int rep) throws HL7Exception { 
305       return (MFR_M01_MFEZxx)super.removeRepetition("MFEZxx", rep);
306    }
307
308
309
310
311    /**
312     * <p>
313     * Returns
314     * DSC (DSC - Continuation pointer segment) - creates it if necessary
315     * </p>
316     * 
317     *
318     */
319    public DSC getDSC() { 
320       return getTyped("DSC", DSC.class);
321    }
322
323
324
325
326}
327