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.v24.segment;
35  
36  // import ca.uhn.hl7v2.model.v24.group.*;
37  import ca.uhn.hl7v2.model.v24.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   * </ul>
61   */
62  @SuppressWarnings("unused")
63  public class EDU extends AbstractSegment {
64  
65      /** 
66       * Creates a new EDU segment
67       */
68      public EDU(Group parent, ModelClassFactory factory) {
69         super(parent, factory);
70         init(factory);
71      }
72  
73      private void init(ModelClassFactory factory) {
74         try {
75                                    this.add(SI.class, true, 1, 60, new Object[]{ getMessage() }, "Set ID - EDU");
76                                                this.add(IS.class, false, 1, 10, new Object[]{ getMessage(), new Integer(360) }, "Academic Degree");
77                                    this.add(DR.class, false, 1, 52, new Object[]{ getMessage() }, "Academic Degree Program Date Range");
78                                    this.add(DR.class, false, 1, 52, new Object[]{ getMessage() }, "Academic Degree Program Participation Date Range");
79                                    this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Academic Degree Granted Date");
80                                    this.add(XON.class, false, 1, 250, new Object[]{ getMessage() }, "School");
81                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "School Type Code");
82                                    this.add(XAD.class, false, 1, 250, new Object[]{ getMessage() }, "School Address");
83         } catch(HL7Exception e) {
84            log.error("Unexpected error creating EDU - this is probably a bug in the source code generator.", e);
85         }
86      }
87  
88  
89  
90      /**
91       * Returns
92       * EDU-1: "Set ID - EDU" - creates it if necessary
93       */
94      public SI getSetIDEDU() { 
95  		SI retVal = this.getTypedField(1, 0);
96  		return retVal;
97      }
98      
99      /**
100      * Returns
101      * EDU-1: "Set ID - EDU" - creates it if necessary
102      */
103     public SI getEdu1_SetIDEDU() { 
104 		SI retVal = this.getTypedField(1, 0);
105 		return retVal;
106     }
107 
108 
109 
110     /**
111      * Returns
112      * EDU-2: "Academic Degree" - creates it if necessary
113      */
114     public IS getAcademicDegree() { 
115 		IS retVal = this.getTypedField(2, 0);
116 		return retVal;
117     }
118     
119     /**
120      * Returns
121      * EDU-2: "Academic Degree" - creates it if necessary
122      */
123     public IS getEdu2_AcademicDegree() { 
124 		IS retVal = this.getTypedField(2, 0);
125 		return retVal;
126     }
127 
128 
129 
130     /**
131      * Returns
132      * EDU-3: "Academic Degree Program Date Range" - creates it if necessary
133      */
134     public DR getAcademicDegreeProgramDateRange() { 
135 		DR retVal = this.getTypedField(3, 0);
136 		return retVal;
137     }
138     
139     /**
140      * Returns
141      * EDU-3: "Academic Degree Program Date Range" - creates it if necessary
142      */
143     public DR getEdu3_AcademicDegreeProgramDateRange() { 
144 		DR retVal = this.getTypedField(3, 0);
145 		return retVal;
146     }
147 
148 
149 
150     /**
151      * Returns
152      * EDU-4: "Academic Degree Program Participation Date Range" - creates it if necessary
153      */
154     public DR getAcademicDegreeProgramParticipationDateRange() { 
155 		DR retVal = this.getTypedField(4, 0);
156 		return retVal;
157     }
158     
159     /**
160      * Returns
161      * EDU-4: "Academic Degree Program Participation Date Range" - creates it if necessary
162      */
163     public DR getEdu4_AcademicDegreeProgramParticipationDateRange() { 
164 		DR retVal = this.getTypedField(4, 0);
165 		return retVal;
166     }
167 
168 
169 
170     /**
171      * Returns
172      * EDU-5: "Academic Degree Granted Date" - creates it if necessary
173      */
174     public DT getAcademicDegreeGrantedDate() { 
175 		DT retVal = this.getTypedField(5, 0);
176 		return retVal;
177     }
178     
179     /**
180      * Returns
181      * EDU-5: "Academic Degree Granted Date" - creates it if necessary
182      */
183     public DT getEdu5_AcademicDegreeGrantedDate() { 
184 		DT retVal = this.getTypedField(5, 0);
185 		return retVal;
186     }
187 
188 
189 
190     /**
191      * Returns
192      * EDU-6: "School" - creates it if necessary
193      */
194     public XON getSchool() { 
195 		XON retVal = this.getTypedField(6, 0);
196 		return retVal;
197     }
198     
199     /**
200      * Returns
201      * EDU-6: "School" - creates it if necessary
202      */
203     public XON getEdu6_School() { 
204 		XON retVal = this.getTypedField(6, 0);
205 		return retVal;
206     }
207 
208 
209 
210     /**
211      * Returns
212      * EDU-7: "School Type Code" - creates it if necessary
213      */
214     public CE getSchoolTypeCode() { 
215 		CE retVal = this.getTypedField(7, 0);
216 		return retVal;
217     }
218     
219     /**
220      * Returns
221      * EDU-7: "School Type Code" - creates it if necessary
222      */
223     public CE getEdu7_SchoolTypeCode() { 
224 		CE retVal = this.getTypedField(7, 0);
225 		return retVal;
226     }
227 
228 
229 
230     /**
231      * Returns
232      * EDU-8: "School Address" - creates it if necessary
233      */
234     public XAD getSchoolAddress() { 
235 		XAD retVal = this.getTypedField(8, 0);
236 		return retVal;
237     }
238     
239     /**
240      * Returns
241      * EDU-8: "School Address" - creates it if necessary
242      */
243     public XAD getEdu8_SchoolAddress() { 
244 		XAD retVal = this.getTypedField(8, 0);
245 		return retVal;
246     }
247 
248 
249 
250 
251 
252     /** {@inheritDoc} */   
253     protected Type createNewTypeWithoutReflection(int field) {
254        switch (field) {
255           case 0: return new SI(getMessage());
256           case 1: return new IS(getMessage(), new Integer( 360 ));
257           case 2: return new DR(getMessage());
258           case 3: return new DR(getMessage());
259           case 4: return new DT(getMessage());
260           case 5: return new XON(getMessage());
261           case 6: return new CE(getMessage());
262           case 7: return new XAD(getMessage());
263           default: return null;
264        }
265    }
266 
267 
268 }
269