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.segment;
035
036// import ca.uhn.hl7v2.model.v231.group.*;
037import ca.uhn.hl7v2.model.v231.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047
048/**
049 *<p>Represents an HL7 MFE message segment (MFE - master file entry segment). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>MFE-1: Record-Level Event Code (ID) <b> </b>
053     * <li>MFE-2: MFN Control ID (ST) <b>optional </b>
054     * <li>MFE-3: Effective Date/Time (TS) <b>optional </b>
055     * <li>MFE-4: Primary Key Value - MFE (Varies) <b> repeating</b>
056     * <li>MFE-5: Primary Key Value Type (ID) <b> repeating</b>
057 * </ul>
058 */
059@SuppressWarnings("unused")
060public class MFE extends AbstractSegment {
061
062    /** 
063     * Creates a new MFE segment
064     */
065    public MFE(Group parent, ModelClassFactory factory) {
066       super(parent, factory);
067       init(factory);
068    }
069
070    private void init(ModelClassFactory factory) {
071       try {
072                                              this.add(ID.class, true, 1, 3, new Object[]{ getMessage(), new Integer(180) }, "Record-Level Event Code");
073                                  this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "MFN Control ID");
074                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Effective Date/Time");
075                                  this.add(Varies.class, true, 0, 200, new Object[]{ getMessage() }, "Primary Key Value - MFE");
076                                              this.add(ID.class, true, 0, 3, new Object[]{ getMessage(), new Integer(355) }, "Primary Key Value Type");
077       } catch(HL7Exception e) {
078          log.error("Unexpected error creating MFE - this is probably a bug in the source code generator.", e);
079       }
080    }
081
082
083
084    /**
085     * Returns
086     * MFE-1: "Record-Level Event Code" - creates it if necessary
087     */
088    public ID getRecordLevelEventCode() { 
089                ID retVal = this.getTypedField(1, 0);
090                return retVal;
091    }
092    
093    /**
094     * Returns
095     * MFE-1: "Record-Level Event Code" - creates it if necessary
096     */
097    public ID getMfe1_RecordLevelEventCode() { 
098                ID retVal = this.getTypedField(1, 0);
099                return retVal;
100    }
101
102
103
104    /**
105     * Returns
106     * MFE-2: "MFN Control ID" - creates it if necessary
107     */
108    public ST getMFNControlID() { 
109                ST retVal = this.getTypedField(2, 0);
110                return retVal;
111    }
112    
113    /**
114     * Returns
115     * MFE-2: "MFN Control ID" - creates it if necessary
116     */
117    public ST getMfe2_MFNControlID() { 
118                ST retVal = this.getTypedField(2, 0);
119                return retVal;
120    }
121
122
123
124    /**
125     * Returns
126     * MFE-3: "Effective Date/Time" - creates it if necessary
127     */
128    public TS getEffectiveDateTime() { 
129                TS retVal = this.getTypedField(3, 0);
130                return retVal;
131    }
132    
133    /**
134     * Returns
135     * MFE-3: "Effective Date/Time" - creates it if necessary
136     */
137    public TS getMfe3_EffectiveDateTime() { 
138                TS retVal = this.getTypedField(3, 0);
139                return retVal;
140    }
141
142
143    /**
144     * Returns all repetitions of Primary Key Value - MFE (MFE-4).
145     */
146    public Varies[] getPrimaryKeyValueMFE() {
147        Varies[] retVal = this.getTypedField(4, new Varies[0]);
148        return retVal;
149    }
150
151
152    /**
153     * Returns all repetitions of Primary Key Value - MFE (MFE-4).
154     */
155    public Varies[] getMfe4_PrimaryKeyValueMFE() {
156        Varies[] retVal = this.getTypedField(4, new Varies[0]);
157        return retVal;
158    }
159
160
161    /**
162     * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4).
163     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
164     * it will return zero.
165     */
166    public int getPrimaryKeyValueMFEReps() {
167        return this.getReps(4);
168    }
169
170
171    /**
172     * Returns a specific repetition of
173     * MFE-4: "Primary Key Value - MFE" - creates it if necessary
174     *
175     * @param rep The repetition index (0-indexed)
176     */
177    public Varies getPrimaryKeyValueMFE(int rep) { 
178                Varies retVal = this.getTypedField(4, rep);
179                return retVal;
180    }
181
182    /**
183     * Returns a specific repetition of
184     * MFE-4: "Primary Key Value - MFE" - creates it if necessary
185     *
186     * @param rep The repetition index (0-indexed)
187     */
188    public Varies getMfe4_PrimaryKeyValueMFE(int rep) { 
189                Varies retVal = this.getTypedField(4, rep);
190                return retVal;
191    }
192
193    /**
194     * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4).
195     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
196     * it will return zero.
197     */
198    public int getMfe4_PrimaryKeyValueMFEReps() {
199        return this.getReps(4);
200    }
201
202
203    /**
204     * Inserts a repetition of
205     * MFE-4: "Primary Key Value - MFE" at a specific index
206     *
207     * @param rep The repetition index (0-indexed)
208     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
209     */
210    public Varies insertPrimaryKeyValueMFE(int rep) throws HL7Exception { 
211        return (Varies) super.insertRepetition(4, rep);
212    }
213
214
215    /**
216     * Inserts a repetition of
217     * MFE-4: "Primary Key Value - MFE" at a specific index
218     *
219     * @param rep The repetition index (0-indexed)
220     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
221     */
222    public Varies insertMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 
223        return (Varies) super.insertRepetition(4, rep);
224    }
225
226
227    /**
228     * Removes a repetition of
229     * MFE-4: "Primary Key Value - MFE" at a specific index
230     *
231     * @param rep The repetition index (0-indexed)
232     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
233     */
234    public Varies removePrimaryKeyValueMFE(int rep) throws HL7Exception { 
235        return (Varies) super.removeRepetition(4, rep);
236    }
237
238
239    /**
240     * Removes a repetition of
241     * MFE-4: "Primary Key Value - MFE" at a specific index
242     *
243     * @param rep The repetition index (0-indexed)
244     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
245     */
246    public Varies removeMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 
247        return (Varies) super.removeRepetition(4, rep);
248    }
249
250
251
252    /**
253     * Returns all repetitions of Primary Key Value Type (MFE-5).
254     */
255    public ID[] getPrimaryKeyValueType() {
256        ID[] retVal = this.getTypedField(5, new ID[0]);
257        return retVal;
258    }
259
260
261    /**
262     * Returns all repetitions of Primary Key Value Type (MFE-5).
263     */
264    public ID[] getMfe5_PrimaryKeyValueType() {
265        ID[] retVal = this.getTypedField(5, new ID[0]);
266        return retVal;
267    }
268
269
270    /**
271     * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5).
272     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
273     * it will return zero.
274     */
275    public int getPrimaryKeyValueTypeReps() {
276        return this.getReps(5);
277    }
278
279
280    /**
281     * Returns a specific repetition of
282     * MFE-5: "Primary Key Value Type" - creates it if necessary
283     *
284     * @param rep The repetition index (0-indexed)
285     */
286    public ID getPrimaryKeyValueType(int rep) { 
287                ID retVal = this.getTypedField(5, rep);
288                return retVal;
289    }
290
291    /**
292     * Returns a specific repetition of
293     * MFE-5: "Primary Key Value Type" - creates it if necessary
294     *
295     * @param rep The repetition index (0-indexed)
296     */
297    public ID getMfe5_PrimaryKeyValueType(int rep) { 
298                ID retVal = this.getTypedField(5, rep);
299                return retVal;
300    }
301
302    /**
303     * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5).
304     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
305     * it will return zero.
306     */
307    public int getMfe5_PrimaryKeyValueTypeReps() {
308        return this.getReps(5);
309    }
310
311
312    /**
313     * Inserts a repetition of
314     * MFE-5: "Primary Key Value Type" at a specific index
315     *
316     * @param rep The repetition index (0-indexed)
317     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
318     */
319    public ID insertPrimaryKeyValueType(int rep) throws HL7Exception { 
320        return (ID) super.insertRepetition(5, rep);
321    }
322
323
324    /**
325     * Inserts a repetition of
326     * MFE-5: "Primary Key Value Type" at a specific index
327     *
328     * @param rep The repetition index (0-indexed)
329     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
330     */
331    public ID insertMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 
332        return (ID) super.insertRepetition(5, rep);
333    }
334
335
336    /**
337     * Removes a repetition of
338     * MFE-5: "Primary Key Value Type" at a specific index
339     *
340     * @param rep The repetition index (0-indexed)
341     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
342     */
343    public ID removePrimaryKeyValueType(int rep) throws HL7Exception { 
344        return (ID) super.removeRepetition(5, rep);
345    }
346
347
348    /**
349     * Removes a repetition of
350     * MFE-5: "Primary Key Value Type" at a specific index
351     *
352     * @param rep The repetition index (0-indexed)
353     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
354     */
355    public ID removeMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 
356        return (ID) super.removeRepetition(5, rep);
357    }
358
359
360
361
362
363
364    /** {@inheritDoc} */   
365    protected Type createNewTypeWithoutReflection(int field) {
366       switch (field) {
367          case 0: return new ID(getMessage(), new Integer( 180 ));
368          case 1: return new ST(getMessage());
369          case 2: return new TS(getMessage());
370          case 3: return new Varies(getMessage());
371          case 4: return new ID(getMessage(), new Integer( 355 ));
372          default: return null;
373       }
374   }
375
376
377}
378