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