View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v24.message;
35  
36  import ca.uhn.hl7v2.model.v24.group.*;
37  import ca.uhn.hl7v2.model.v24.segment.*;
38  
39  import ca.uhn.hl7v2.HL7Exception;
40  import ca.uhn.hl7v2.parser.ModelClassFactory;
41  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
42  import ca.uhn.hl7v2.model.*;
43  
44  
45  /**
46   * <p>Represents a MFR_M01 message structure (see chapter 8). This structure contains the 
47   * following elements: </p>
48   * <ul>
49  		                 * <li>1: MSH (Message Header) <b> </b> </li>
50  		                 * <li>2: MSA (Message Acknowledgment) <b> </b> </li>
51  		                 * <li>3: ERR (Error) <b>optional </b> </li>
52  		                 * <li>4: QAK (Query Acknowledgment) <b>optional </b> </li>
53  		                 * <li>5: QRD (Original-Style Query Definition) <b> </b> </li>
54  		                 * <li>6: QRF (Original Style Query Filter) <b>optional </b> </li>
55  		                 * <li>7: MFI (Master File Identification) <b> </b> </li>
56  		                 * <li>8: MFR_M01_MF_QUERY (a Group object) <b> repeating</b> </li>
57  		                 * <li>9: DSC (Continuation Pointer) <b>optional </b> </li>
58   * </ul>
59   */
60  //@SuppressWarnings("unused")
61  public class MFR_M01 extends AbstractMessage  {
62  
63      /**
64       * Creates a new MFR_M01 message with DefaultModelClassFactory. 
65       */ 
66      public MFR_M01() { 
67         this(new DefaultModelClassFactory());
68      }
69  
70      /** 
71       * Creates a new MFR_M01 message with custom ModelClassFactory.
72       */
73      public MFR_M01(ModelClassFactory factory) {
74         super(factory);
75         init(factory);
76      }
77  
78      private void init(ModelClassFactory factory) {
79         try {
80                            this.add(MSH.class, true, false);
81  	                          this.add(MSA.class, true, false);
82  	                          this.add(ERR.class, false, false);
83  	                          this.add(QAK.class, false, false);
84  	                          this.add(QRD.class, true, false);
85  	                          this.add(QRF.class, false, false);
86  	                          this.add(MFI.class, true, false);
87  	                          this.add(MFR_M01_MF_QUERY.class, true, true);
88  	                          this.add(DSC.class, false, false);
89  	       } catch(HL7Exception e) {
90            log.error("Unexpected error creating MFR_M01 - this is probably a bug in the source code generator.", e);
91         }
92      }
93  
94  
95      /** 
96       * Returns "2.4"
97       */
98      public String getVersion() {
99         return "2.4";
100     }
101 
102 
103 
104 
105     /**
106      * <p>
107      * Returns
108      * MSH (Message Header) - 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 (Message Acknowledgment) - 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 (Error) - 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 Acknowledgment) - 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 (Original-Style Query Definition) - 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 (Original Style Query Filter) - 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 (Master File Identification) - 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      * MF_QUERY (a Group object) - creates it if necessary
222      * </p>
223      * 
224      *
225      */
226     public MFR_M01_MF_QUERY getMF_QUERY() { 
227        return getTyped("MF_QUERY", MFR_M01_MF_QUERY.class);
228     }
229 
230 
231     /**
232      * <p>
233      * Returns a specific repetition of
234      * MF_QUERY (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_MF_QUERY getMF_QUERY(int rep) { 
243        return getTyped("MF_QUERY", rep, MFR_M01_MF_QUERY.class);
244     }
245 
246     /** 
247      * <p>
248      * Returns the number of existing repetitions of MF_QUERY 
249      * </p>
250      * 
251      */ 
252     public int getMF_QUERYReps() { 
253     	return getReps("MF_QUERY");
254     } 
255 
256     /** 
257      * <p>
258      * Returns a non-modifiable List containing all current existing repetitions of MF_QUERY.
259      * <p>
260      * <p>
261      * Note that unlike {@link #getMF_QUERY()}, 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_MF_QUERY> getMF_QUERYAll() throws HL7Exception {
267     	return getAllAsList("MF_QUERY", MFR_M01_MF_QUERY.class);
268     } 
269 
270     /**
271      * <p>
272      * Inserts a specific repetition of MF_QUERY (a Group object)
273      * </p>
274      * 
275      *
276      * @see AbstractGroup#insertRepetition(Structure, int) 
277      */
278     public void insertMF_QUERY(MFR_M01_MF_QUERY structure, int rep) throws HL7Exception { 
279        super.insertRepetition( "MF_QUERY", structure, rep);
280     }
281 
282 
283     /**
284      * <p>
285      * Inserts a specific repetition of MF_QUERY (a Group object)
286      * </p>
287      * 
288      *
289      * @see AbstractGroup#insertRepetition(Structure, int) 
290      */
291     public MFR_M01_MF_QUERY insertMF_QUERY(int rep) throws HL7Exception { 
292        return (MFR_M01_MF_QUERY)super.insertRepetition("MF_QUERY", rep);
293     }
294 
295 
296     /**
297      * <p>
298      * Removes a specific repetition of MF_QUERY (a Group object)
299      * </p>
300      * 
301      *
302      * @see AbstractGroup#removeRepetition(String, int) 
303      */
304     public MFR_M01_MF_QUERY removeMF_QUERY(int rep) throws HL7Exception { 
305        return (MFR_M01_MF_QUERY)super.removeRepetition("MF_QUERY", rep);
306     }
307 
308 
309 
310 
311     /**
312      * <p>
313      * Returns
314      * DSC (Continuation Pointer) - 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