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.v26.message;
35  
36  import ca.uhn.hl7v2.model.v26.group.*;
37  import ca.uhn.hl7v2.model.v26.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_M05 message structure (see chapter 8.9.1). This structure contains the 
47   * following elements: </p>
48   * <ul>
49  		                 * <li>1: MSH (Message Header) <b> </b> </li>
50  		                 * <li>2: SFT (Software Segment) <b>optional repeating</b> </li>
51  		                 * <li>3: UAC (User Authentication Credential Segment) <b>optional </b> </li>
52  		                 * <li>4: MSA (Message Acknowledgment) <b> </b> </li>
53  		                 * <li>5: ERR (Error) <b>optional repeating</b> </li>
54  		                 * <li>6: QAK (Query Acknowledgment) <b>optional </b> </li>
55  		                 * <li>7: QRD (Original-Style Query Definition) <b> </b> </li>
56  		                 * <li>8: QRF (Original style query filter) <b>optional </b> </li>
57  		                 * <li>9: MFI (Master File Identification) <b> </b> </li>
58  		                 * <li>10: MFR_M05_MF_QUERY (a Group object) <b> repeating</b> </li>
59  		                 * <li>11: DSC (Continuation Pointer) <b>optional </b> </li>
60   * </ul>
61   */
62  //@SuppressWarnings("unused")
63  public class MFR_M05 extends AbstractMessage  {
64  
65      /**
66       * Creates a new MFR_M05 message with DefaultModelClassFactory. 
67       */ 
68      public MFR_M05() { 
69         this(new DefaultModelClassFactory());
70      }
71  
72      /** 
73       * Creates a new MFR_M05 message with custom ModelClassFactory.
74       */
75      public MFR_M05(ModelClassFactory factory) {
76         super(factory);
77         init(factory);
78      }
79  
80      private void init(ModelClassFactory factory) {
81         try {
82                            this.add(MSH.class, true, false);
83  	                          this.add(SFT.class, false, true);
84  	                          this.add(UAC.class, false, false);
85  	                          this.add(MSA.class, true, false);
86  	                          this.add(ERR.class, false, true);
87  	                          this.add(QAK.class, false, false);
88  	                          this.add(QRD.class, true, false);
89  	                          this.add(QRF.class, false, false);
90  	                          this.add(MFI.class, true, false);
91  	                          this.add(MFR_M05_MF_QUERY.class, true, true);
92  	                          this.add(DSC.class, false, false);
93  	       } catch(HL7Exception e) {
94            log.error("Unexpected error creating MFR_M05 - this is probably a bug in the source code generator.", e);
95         }
96      }
97  
98  
99      /** 
100      * Returns "2.6"
101      */
102     public String getVersion() {
103        return "2.6";
104     }
105 
106 
107 
108 
109     /**
110      * <p>
111      * Returns
112      * MSH (Message Header) - creates it if necessary
113      * </p>
114      * 
115      *
116      */
117     public MSH getMSH() { 
118        return getTyped("MSH", MSH.class);
119     }
120 
121 
122 
123 
124 
125     /**
126      * <p>
127      * Returns
128      * the first repetition of 
129      * SFT (Software Segment) - creates it if necessary
130      * </p>
131      * 
132      *
133      */
134     public SFT getSFT() { 
135        return getTyped("SFT", SFT.class);
136     }
137 
138 
139     /**
140      * <p>
141      * Returns a specific repetition of
142      * SFT (Software Segment) - creates it if necessary
143      * </p>
144      * 
145      *
146      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
147      * @throws HL7Exception if the repetition requested is more than one 
148      *     greater than the number of existing repetitions.
149      */
150     public SFT getSFT(int rep) { 
151        return getTyped("SFT", rep, SFT.class);
152     }
153 
154     /** 
155      * <p>
156      * Returns the number of existing repetitions of SFT 
157      * </p>
158      * 
159      */ 
160     public int getSFTReps() { 
161     	return getReps("SFT");
162     } 
163 
164     /** 
165      * <p>
166      * Returns a non-modifiable List containing all current existing repetitions of SFT.
167      * <p>
168      * <p>
169      * Note that unlike {@link #getSFT()}, this method will not create any reps
170      * if none are already present, so an empty list may be returned.
171      * </p>
172      * 
173      */ 
174     public java.util.List<SFT> getSFTAll() throws HL7Exception {
175     	return getAllAsList("SFT", SFT.class);
176     } 
177 
178     /**
179      * <p>
180      * Inserts a specific repetition of SFT (Software Segment)
181      * </p>
182      * 
183      *
184      * @see AbstractGroup#insertRepetition(Structure, int) 
185      */
186     public void insertSFT(SFT structure, int rep) throws HL7Exception { 
187        super.insertRepetition( "SFT", structure, rep);
188     }
189 
190 
191     /**
192      * <p>
193      * Inserts a specific repetition of SFT (Software Segment)
194      * </p>
195      * 
196      *
197      * @see AbstractGroup#insertRepetition(Structure, int) 
198      */
199     public SFT insertSFT(int rep) throws HL7Exception { 
200        return (SFT)super.insertRepetition("SFT", rep);
201     }
202 
203 
204     /**
205      * <p>
206      * Removes a specific repetition of SFT (Software Segment)
207      * </p>
208      * 
209      *
210      * @see AbstractGroup#removeRepetition(String, int) 
211      */
212     public SFT removeSFT(int rep) throws HL7Exception { 
213        return (SFT)super.removeRepetition("SFT", rep);
214     }
215 
216 
217 
218 
219     /**
220      * <p>
221      * Returns
222      * UAC (User Authentication Credential Segment) - creates it if necessary
223      * </p>
224      * 
225      *
226      */
227     public UAC getUAC() { 
228        return getTyped("UAC", UAC.class);
229     }
230 
231 
232 
233 
234 
235     /**
236      * <p>
237      * Returns
238      * MSA (Message Acknowledgment) - creates it if necessary
239      * </p>
240      * 
241      *
242      */
243     public MSA getMSA() { 
244        return getTyped("MSA", MSA.class);
245     }
246 
247 
248 
249 
250 
251     /**
252      * <p>
253      * Returns
254      * the first repetition of 
255      * ERR (Error) - creates it if necessary
256      * </p>
257      * 
258      *
259      */
260     public ERR getERR() { 
261        return getTyped("ERR", ERR.class);
262     }
263 
264 
265     /**
266      * <p>
267      * Returns a specific repetition of
268      * ERR (Error) - creates it if necessary
269      * </p>
270      * 
271      *
272      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
273      * @throws HL7Exception if the repetition requested is more than one 
274      *     greater than the number of existing repetitions.
275      */
276     public ERR getERR(int rep) { 
277        return getTyped("ERR", rep, ERR.class);
278     }
279 
280     /** 
281      * <p>
282      * Returns the number of existing repetitions of ERR 
283      * </p>
284      * 
285      */ 
286     public int getERRReps() { 
287     	return getReps("ERR");
288     } 
289 
290     /** 
291      * <p>
292      * Returns a non-modifiable List containing all current existing repetitions of ERR.
293      * <p>
294      * <p>
295      * Note that unlike {@link #getERR()}, this method will not create any reps
296      * if none are already present, so an empty list may be returned.
297      * </p>
298      * 
299      */ 
300     public java.util.List<ERR> getERRAll() throws HL7Exception {
301     	return getAllAsList("ERR", ERR.class);
302     } 
303 
304     /**
305      * <p>
306      * Inserts a specific repetition of ERR (Error)
307      * </p>
308      * 
309      *
310      * @see AbstractGroup#insertRepetition(Structure, int) 
311      */
312     public void insertERR(ERR structure, int rep) throws HL7Exception { 
313        super.insertRepetition( "ERR", structure, rep);
314     }
315 
316 
317     /**
318      * <p>
319      * Inserts a specific repetition of ERR (Error)
320      * </p>
321      * 
322      *
323      * @see AbstractGroup#insertRepetition(Structure, int) 
324      */
325     public ERR insertERR(int rep) throws HL7Exception { 
326        return (ERR)super.insertRepetition("ERR", rep);
327     }
328 
329 
330     /**
331      * <p>
332      * Removes a specific repetition of ERR (Error)
333      * </p>
334      * 
335      *
336      * @see AbstractGroup#removeRepetition(String, int) 
337      */
338     public ERR removeERR(int rep) throws HL7Exception { 
339        return (ERR)super.removeRepetition("ERR", rep);
340     }
341 
342 
343 
344 
345     /**
346      * <p>
347      * Returns
348      * QAK (Query Acknowledgment) - creates it if necessary
349      * </p>
350      * 
351      *
352      */
353     public QAK getQAK() { 
354        return getTyped("QAK", QAK.class);
355     }
356 
357 
358 
359 
360 
361     /**
362      * <p>
363      * Returns
364      * QRD (Original-Style Query Definition) - creates it if necessary
365      * </p>
366      * 
367      *
368      */
369     public QRD getQRD() { 
370        return getTyped("QRD", QRD.class);
371     }
372 
373 
374 
375 
376 
377     /**
378      * <p>
379      * Returns
380      * QRF (Original style query filter) - creates it if necessary
381      * </p>
382      * 
383      *
384      */
385     public QRF getQRF() { 
386        return getTyped("QRF", QRF.class);
387     }
388 
389 
390 
391 
392 
393     /**
394      * <p>
395      * Returns
396      * MFI (Master File Identification) - creates it if necessary
397      * </p>
398      * 
399      *
400      */
401     public MFI getMFI() { 
402        return getTyped("MFI", MFI.class);
403     }
404 
405 
406 
407 
408 
409     /**
410      * <p>
411      * Returns
412      * the first repetition of 
413      * MF_QUERY (a Group object) - creates it if necessary
414      * </p>
415      * 
416      *
417      */
418     public MFR_M05_MF_QUERY getMF_QUERY() { 
419        return getTyped("MF_QUERY", MFR_M05_MF_QUERY.class);
420     }
421 
422 
423     /**
424      * <p>
425      * Returns a specific repetition of
426      * MF_QUERY (a Group object) - creates it if necessary
427      * </p>
428      * 
429      *
430      * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
431      * @throws HL7Exception if the repetition requested is more than one 
432      *     greater than the number of existing repetitions.
433      */
434     public MFR_M05_MF_QUERY getMF_QUERY(int rep) { 
435        return getTyped("MF_QUERY", rep, MFR_M05_MF_QUERY.class);
436     }
437 
438     /** 
439      * <p>
440      * Returns the number of existing repetitions of MF_QUERY 
441      * </p>
442      * 
443      */ 
444     public int getMF_QUERYReps() { 
445     	return getReps("MF_QUERY");
446     } 
447 
448     /** 
449      * <p>
450      * Returns a non-modifiable List containing all current existing repetitions of MF_QUERY.
451      * <p>
452      * <p>
453      * Note that unlike {@link #getMF_QUERY()}, this method will not create any reps
454      * if none are already present, so an empty list may be returned.
455      * </p>
456      * 
457      */ 
458     public java.util.List<MFR_M05_MF_QUERY> getMF_QUERYAll() throws HL7Exception {
459     	return getAllAsList("MF_QUERY", MFR_M05_MF_QUERY.class);
460     } 
461 
462     /**
463      * <p>
464      * Inserts a specific repetition of MF_QUERY (a Group object)
465      * </p>
466      * 
467      *
468      * @see AbstractGroup#insertRepetition(Structure, int) 
469      */
470     public void insertMF_QUERY(MFR_M05_MF_QUERY structure, int rep) throws HL7Exception { 
471        super.insertRepetition( "MF_QUERY", structure, rep);
472     }
473 
474 
475     /**
476      * <p>
477      * Inserts a specific repetition of MF_QUERY (a Group object)
478      * </p>
479      * 
480      *
481      * @see AbstractGroup#insertRepetition(Structure, int) 
482      */
483     public MFR_M05_MF_QUERY insertMF_QUERY(int rep) throws HL7Exception { 
484        return (MFR_M05_MF_QUERY)super.insertRepetition("MF_QUERY", rep);
485     }
486 
487 
488     /**
489      * <p>
490      * Removes a specific repetition of MF_QUERY (a Group object)
491      * </p>
492      * 
493      *
494      * @see AbstractGroup#removeRepetition(String, int) 
495      */
496     public MFR_M05_MF_QUERY removeMF_QUERY(int rep) throws HL7Exception { 
497        return (MFR_M05_MF_QUERY)super.removeRepetition("MF_QUERY", rep);
498     }
499 
500 
501 
502 
503     /**
504      * <p>
505      * Returns
506      * DSC (Continuation Pointer) - creates it if necessary
507      * </p>
508      * 
509      *
510      */
511     public DSC getDSC() { 
512        return getTyped("DSC", DSC.class);
513     }
514 
515 
516 
517 
518 }
519