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.v281.segment;
35  
36  // import ca.uhn.hl7v2.model.v281.group.*;
37  import ca.uhn.hl7v2.model.v281.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 MFE message segment (Master File Entry). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>MFE-1: Record-Level Event Code (ID) <b> </b>
53       * <li>MFE-2: MFN Control ID (ST) <b>optional </b>
54       * <li>MFE-3: Effective Date/Time (DTM) <b>optional </b>
55       * <li>MFE-4: Primary Key Value - MFE (Varies) <b> repeating</b>
56       * <li>MFE-5: Primary Key Value Type (ID) <b> repeating</b>
57       * <li>MFE-6: Entered Date/Time (DTM) <b>optional </b>
58       * <li>MFE-7: Entered By (XCN) <b>optional </b>
59   * </ul>
60   */
61  @SuppressWarnings("unused")
62  public class MFE extends AbstractSegment {
63  
64      /** 
65       * Creates a new MFE segment
66       */
67      public MFE(Group parent, ModelClassFactory factory) {
68         super(parent, factory);
69         init(factory);
70      }
71  
72      private void init(ModelClassFactory factory) {
73         try {
74                                                this.add(ID.class, true, 1, 0, new Object[]{ getMessage(), new Integer(180) }, "Record-Level Event Code");
75                                    this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "MFN Control ID");
76                                    this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Effective Date/Time");
77                                    this.add(Varies.class, true, 0, 0, new Object[]{ getMessage() }, "Primary Key Value - MFE");
78                                                this.add(ID.class, true, 0, 0, new Object[]{ getMessage(), new Integer(355) }, "Primary Key Value Type");
79                                    this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Entered Date/Time");
80                                    this.add(XCN.class, false, 1, 0, new Object[]{ getMessage() }, "Entered By");
81         } catch(HL7Exception e) {
82            log.error("Unexpected error creating MFE - this is probably a bug in the source code generator.", e);
83         }
84      }
85  
86  
87  
88      /**
89       * Returns
90       * MFE-1: "Record-Level Event Code" - creates it if necessary
91       */
92      public ID getRecordLevelEventCode() { 
93  		ID retVal = this.getTypedField(1, 0);
94  		return retVal;
95      }
96      
97      /**
98       * Returns
99       * MFE-1: "Record-Level Event Code" - creates it if necessary
100      */
101     public ID getMfe1_RecordLevelEventCode() { 
102 		ID retVal = this.getTypedField(1, 0);
103 		return retVal;
104     }
105 
106 
107 
108     /**
109      * Returns
110      * MFE-2: "MFN Control ID" - creates it if necessary
111      */
112     public ST getMFNControlID() { 
113 		ST retVal = this.getTypedField(2, 0);
114 		return retVal;
115     }
116     
117     /**
118      * Returns
119      * MFE-2: "MFN Control ID" - creates it if necessary
120      */
121     public ST getMfe2_MFNControlID() { 
122 		ST retVal = this.getTypedField(2, 0);
123 		return retVal;
124     }
125 
126 
127 
128     /**
129      * Returns
130      * MFE-3: "Effective Date/Time" - creates it if necessary
131      */
132     public DTM getEffectiveDateTime() { 
133 		DTM retVal = this.getTypedField(3, 0);
134 		return retVal;
135     }
136     
137     /**
138      * Returns
139      * MFE-3: "Effective Date/Time" - creates it if necessary
140      */
141     public DTM getMfe3_EffectiveDateTime() { 
142 		DTM retVal = this.getTypedField(3, 0);
143 		return retVal;
144     }
145 
146 
147     /**
148      * Returns all repetitions of Primary Key Value - MFE (MFE-4).
149      */
150     public Varies[] getPrimaryKeyValueMFE() {
151     	Varies[] retVal = this.getTypedField(4, new Varies[0]);
152     	return retVal;
153     }
154 
155 
156     /**
157      * Returns all repetitions of Primary Key Value - MFE (MFE-4).
158      */
159     public Varies[] getMfe4_PrimaryKeyValueMFE() {
160     	Varies[] retVal = this.getTypedField(4, new Varies[0]);
161     	return retVal;
162     }
163 
164 
165     /**
166      * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4).
167      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
168      * it will return zero.
169      */
170     public int getPrimaryKeyValueMFEReps() {
171     	return this.getReps(4);
172     }
173 
174 
175     /**
176      * Returns a specific repetition of
177      * MFE-4: "Primary Key Value - MFE" - creates it if necessary
178      *
179      * @param rep The repetition index (0-indexed)
180      */
181     public Varies getPrimaryKeyValueMFE(int rep) { 
182 		Varies retVal = this.getTypedField(4, rep);
183 		return retVal;
184     }
185 
186     /**
187      * Returns a specific repetition of
188      * MFE-4: "Primary Key Value - MFE" - creates it if necessary
189      *
190      * @param rep The repetition index (0-indexed)
191      */
192     public Varies getMfe4_PrimaryKeyValueMFE(int rep) { 
193 		Varies retVal = this.getTypedField(4, rep);
194 		return retVal;
195     }
196 
197     /**
198      * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4).
199      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
200      * it will return zero.
201      */
202     public int getMfe4_PrimaryKeyValueMFEReps() {
203     	return this.getReps(4);
204     }
205 
206 
207     /**
208      * Inserts a repetition of
209      * MFE-4: "Primary Key Value - MFE" at a specific index
210      *
211      * @param rep The repetition index (0-indexed)
212      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
213      */
214     public Varies insertPrimaryKeyValueMFE(int rep) throws HL7Exception { 
215         return (Varies) super.insertRepetition(4, rep);
216     }
217 
218 
219     /**
220      * Inserts a repetition of
221      * MFE-4: "Primary Key Value - MFE" at a specific index
222      *
223      * @param rep The repetition index (0-indexed)
224      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
225      */
226     public Varies insertMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 
227         return (Varies) super.insertRepetition(4, rep);
228     }
229 
230 
231     /**
232      * Removes a repetition of
233      * MFE-4: "Primary Key Value - MFE" at a specific index
234      *
235      * @param rep The repetition index (0-indexed)
236      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
237      */
238     public Varies removePrimaryKeyValueMFE(int rep) throws HL7Exception { 
239         return (Varies) super.removeRepetition(4, rep);
240     }
241 
242 
243     /**
244      * Removes a repetition of
245      * MFE-4: "Primary Key Value - MFE" at a specific index
246      *
247      * @param rep The repetition index (0-indexed)
248      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
249      */
250     public Varies removeMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 
251         return (Varies) super.removeRepetition(4, rep);
252     }
253 
254 
255 
256     /**
257      * Returns all repetitions of Primary Key Value Type (MFE-5).
258      */
259     public ID[] getPrimaryKeyValueType() {
260     	ID[] retVal = this.getTypedField(5, new ID[0]);
261     	return retVal;
262     }
263 
264 
265     /**
266      * Returns all repetitions of Primary Key Value Type (MFE-5).
267      */
268     public ID[] getMfe5_PrimaryKeyValueType() {
269     	ID[] retVal = this.getTypedField(5, new ID[0]);
270     	return retVal;
271     }
272 
273 
274     /**
275      * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5).
276      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
277      * it will return zero.
278      */
279     public int getPrimaryKeyValueTypeReps() {
280     	return this.getReps(5);
281     }
282 
283 
284     /**
285      * Returns a specific repetition of
286      * MFE-5: "Primary Key Value Type" - creates it if necessary
287      *
288      * @param rep The repetition index (0-indexed)
289      */
290     public ID getPrimaryKeyValueType(int rep) { 
291 		ID retVal = this.getTypedField(5, rep);
292 		return retVal;
293     }
294 
295     /**
296      * Returns a specific repetition of
297      * MFE-5: "Primary Key Value Type" - creates it if necessary
298      *
299      * @param rep The repetition index (0-indexed)
300      */
301     public ID getMfe5_PrimaryKeyValueType(int rep) { 
302 		ID retVal = this.getTypedField(5, rep);
303 		return retVal;
304     }
305 
306     /**
307      * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5).
308      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
309      * it will return zero.
310      */
311     public int getMfe5_PrimaryKeyValueTypeReps() {
312     	return this.getReps(5);
313     }
314 
315 
316     /**
317      * Inserts a repetition of
318      * MFE-5: "Primary Key Value Type" at a specific index
319      *
320      * @param rep The repetition index (0-indexed)
321      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
322      */
323     public ID insertPrimaryKeyValueType(int rep) throws HL7Exception { 
324         return (ID) super.insertRepetition(5, rep);
325     }
326 
327 
328     /**
329      * Inserts a repetition of
330      * MFE-5: "Primary Key Value Type" at a specific index
331      *
332      * @param rep The repetition index (0-indexed)
333      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
334      */
335     public ID insertMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 
336         return (ID) super.insertRepetition(5, rep);
337     }
338 
339 
340     /**
341      * Removes a repetition of
342      * MFE-5: "Primary Key Value Type" at a specific index
343      *
344      * @param rep The repetition index (0-indexed)
345      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
346      */
347     public ID removePrimaryKeyValueType(int rep) throws HL7Exception { 
348         return (ID) super.removeRepetition(5, rep);
349     }
350 
351 
352     /**
353      * Removes a repetition of
354      * MFE-5: "Primary Key Value Type" at a specific index
355      *
356      * @param rep The repetition index (0-indexed)
357      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
358      */
359     public ID removeMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 
360         return (ID) super.removeRepetition(5, rep);
361     }
362 
363 
364 
365 
366     /**
367      * Returns
368      * MFE-6: "Entered Date/Time" - creates it if necessary
369      */
370     public DTM getEnteredDateTime() { 
371 		DTM retVal = this.getTypedField(6, 0);
372 		return retVal;
373     }
374     
375     /**
376      * Returns
377      * MFE-6: "Entered Date/Time" - creates it if necessary
378      */
379     public DTM getMfe6_EnteredDateTime() { 
380 		DTM retVal = this.getTypedField(6, 0);
381 		return retVal;
382     }
383 
384 
385 
386     /**
387      * Returns
388      * MFE-7: "Entered By" - creates it if necessary
389      */
390     public XCN getEnteredBy() { 
391 		XCN retVal = this.getTypedField(7, 0);
392 		return retVal;
393     }
394     
395     /**
396      * Returns
397      * MFE-7: "Entered By" - creates it if necessary
398      */
399     public XCN getMfe7_EnteredBy() { 
400 		XCN retVal = this.getTypedField(7, 0);
401 		return retVal;
402     }
403 
404 
405 
406 
407 
408     /** {@inheritDoc} */   
409     protected Type createNewTypeWithoutReflection(int field) {
410        switch (field) {
411           case 0: return new ID(getMessage(), new Integer( 180 ));
412           case 1: return new ST(getMessage());
413           case 2: return new DTM(getMessage());
414           case 3: return new Varies(getMessage());
415           case 4: return new ID(getMessage(), new Integer( 355 ));
416           case 5: return new DTM(getMessage());
417           case 6: return new XCN(getMessage());
418           default: return null;
419        }
420    }
421 
422 
423 }
424