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