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.v251.segment;
035
036// import ca.uhn.hl7v2.model.v251.group.*;
037import ca.uhn.hl7v2.model.v251.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 ACC message segment (Accident). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>ACC-1: Accident Date/Time (TS) <b>optional </b>
053     * <li>ACC-2: Accident Code (CE) <b>optional </b>
054     * <li>ACC-3: Accident Location (ST) <b>optional </b>
055     * <li>ACC-4: Auto Accident State (CE) <b>optional </b>
056     * <li>ACC-5: Accident Job Related Indicator (ID) <b>optional </b>
057     * <li>ACC-6: Accident Death Indicator (ID) <b>optional </b>
058     * <li>ACC-7: Entered By (XCN) <b>optional </b>
059     * <li>ACC-8: Accident Description (ST) <b>optional </b>
060     * <li>ACC-9: Brought In By (ST) <b>optional </b>
061     * <li>ACC-10: Police Notified Indicator (ID) <b>optional </b>
062     * <li>ACC-11: Accident Address (XAD) <b>optional </b>
063 * </ul>
064 */
065@SuppressWarnings("unused")
066public class ACC extends AbstractSegment {
067
068    /** 
069     * Creates a new ACC segment
070     */
071    public ACC(Group parent, ModelClassFactory factory) {
072       super(parent, factory);
073       init(factory);
074    }
075
076    private void init(ModelClassFactory factory) {
077       try {
078                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Accident Date/Time");
079                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Accident Code");
080                                  this.add(ST.class, false, 1, 25, new Object[]{ getMessage() }, "Accident Location");
081                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Auto Accident State");
082                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Accident Job Related Indicator");
083                                              this.add(ID.class, false, 1, 12, new Object[]{ getMessage(), new Integer(136) }, "Accident Death Indicator");
084                                  this.add(XCN.class, false, 1, 250, new Object[]{ getMessage() }, "Entered By");
085                                  this.add(ST.class, false, 1, 25, new Object[]{ getMessage() }, "Accident Description");
086                                  this.add(ST.class, false, 1, 80, new Object[]{ getMessage() }, "Brought In By");
087                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Police Notified Indicator");
088                                  this.add(XAD.class, false, 1, 250, new Object[]{ getMessage() }, "Accident Address");
089       } catch(HL7Exception e) {
090          log.error("Unexpected error creating ACC - this is probably a bug in the source code generator.", e);
091       }
092    }
093
094
095
096    /**
097     * Returns
098     * ACC-1: "Accident Date/Time" - creates it if necessary
099     */
100    public TS getAccidentDateTime() { 
101                TS retVal = this.getTypedField(1, 0);
102                return retVal;
103    }
104    
105    /**
106     * Returns
107     * ACC-1: "Accident Date/Time" - creates it if necessary
108     */
109    public TS getAcc1_AccidentDateTime() { 
110                TS retVal = this.getTypedField(1, 0);
111                return retVal;
112    }
113
114
115
116    /**
117     * Returns
118     * ACC-2: "Accident Code" - creates it if necessary
119     */
120    public CE getAccidentCode() { 
121                CE retVal = this.getTypedField(2, 0);
122                return retVal;
123    }
124    
125    /**
126     * Returns
127     * ACC-2: "Accident Code" - creates it if necessary
128     */
129    public CE getAcc2_AccidentCode() { 
130                CE retVal = this.getTypedField(2, 0);
131                return retVal;
132    }
133
134
135
136    /**
137     * Returns
138     * ACC-3: "Accident Location" - creates it if necessary
139     */
140    public ST getAccidentLocation() { 
141                ST retVal = this.getTypedField(3, 0);
142                return retVal;
143    }
144    
145    /**
146     * Returns
147     * ACC-3: "Accident Location" - creates it if necessary
148     */
149    public ST getAcc3_AccidentLocation() { 
150                ST retVal = this.getTypedField(3, 0);
151                return retVal;
152    }
153
154
155
156    /**
157     * Returns
158     * ACC-4: "Auto Accident State" - creates it if necessary
159     */
160    public CE getAutoAccidentState() { 
161                CE retVal = this.getTypedField(4, 0);
162                return retVal;
163    }
164    
165    /**
166     * Returns
167     * ACC-4: "Auto Accident State" - creates it if necessary
168     */
169    public CE getAcc4_AutoAccidentState() { 
170                CE retVal = this.getTypedField(4, 0);
171                return retVal;
172    }
173
174
175
176    /**
177     * Returns
178     * ACC-5: "Accident Job Related Indicator" - creates it if necessary
179     */
180    public ID getAccidentJobRelatedIndicator() { 
181                ID retVal = this.getTypedField(5, 0);
182                return retVal;
183    }
184    
185    /**
186     * Returns
187     * ACC-5: "Accident Job Related Indicator" - creates it if necessary
188     */
189    public ID getAcc5_AccidentJobRelatedIndicator() { 
190                ID retVal = this.getTypedField(5, 0);
191                return retVal;
192    }
193
194
195
196    /**
197     * Returns
198     * ACC-6: "Accident Death Indicator" - creates it if necessary
199     */
200    public ID getAccidentDeathIndicator() { 
201                ID retVal = this.getTypedField(6, 0);
202                return retVal;
203    }
204    
205    /**
206     * Returns
207     * ACC-6: "Accident Death Indicator" - creates it if necessary
208     */
209    public ID getAcc6_AccidentDeathIndicator() { 
210                ID retVal = this.getTypedField(6, 0);
211                return retVal;
212    }
213
214
215
216    /**
217     * Returns
218     * ACC-7: "Entered By" - creates it if necessary
219     */
220    public XCN getEnteredBy() { 
221                XCN retVal = this.getTypedField(7, 0);
222                return retVal;
223    }
224    
225    /**
226     * Returns
227     * ACC-7: "Entered By" - creates it if necessary
228     */
229    public XCN getAcc7_EnteredBy() { 
230                XCN retVal = this.getTypedField(7, 0);
231                return retVal;
232    }
233
234
235
236    /**
237     * Returns
238     * ACC-8: "Accident Description" - creates it if necessary
239     */
240    public ST getAccidentDescription() { 
241                ST retVal = this.getTypedField(8, 0);
242                return retVal;
243    }
244    
245    /**
246     * Returns
247     * ACC-8: "Accident Description" - creates it if necessary
248     */
249    public ST getAcc8_AccidentDescription() { 
250                ST retVal = this.getTypedField(8, 0);
251                return retVal;
252    }
253
254
255
256    /**
257     * Returns
258     * ACC-9: "Brought In By" - creates it if necessary
259     */
260    public ST getBroughtInBy() { 
261                ST retVal = this.getTypedField(9, 0);
262                return retVal;
263    }
264    
265    /**
266     * Returns
267     * ACC-9: "Brought In By" - creates it if necessary
268     */
269    public ST getAcc9_BroughtInBy() { 
270                ST retVal = this.getTypedField(9, 0);
271                return retVal;
272    }
273
274
275
276    /**
277     * Returns
278     * ACC-10: "Police Notified Indicator" - creates it if necessary
279     */
280    public ID getPoliceNotifiedIndicator() { 
281                ID retVal = this.getTypedField(10, 0);
282                return retVal;
283    }
284    
285    /**
286     * Returns
287     * ACC-10: "Police Notified Indicator" - creates it if necessary
288     */
289    public ID getAcc10_PoliceNotifiedIndicator() { 
290                ID retVal = this.getTypedField(10, 0);
291                return retVal;
292    }
293
294
295
296    /**
297     * Returns
298     * ACC-11: "Accident Address" - creates it if necessary
299     */
300    public XAD getAccidentAddress() { 
301                XAD retVal = this.getTypedField(11, 0);
302                return retVal;
303    }
304    
305    /**
306     * Returns
307     * ACC-11: "Accident Address" - creates it if necessary
308     */
309    public XAD getAcc11_AccidentAddress() { 
310                XAD retVal = this.getTypedField(11, 0);
311                return retVal;
312    }
313
314
315
316
317
318    /** {@inheritDoc} */   
319    protected Type createNewTypeWithoutReflection(int field) {
320       switch (field) {
321          case 0: return new TS(getMessage());
322          case 1: return new CE(getMessage());
323          case 2: return new ST(getMessage());
324          case 3: return new CE(getMessage());
325          case 4: return new ID(getMessage(), new Integer( 136 ));
326          case 5: return new ID(getMessage(), new Integer( 136 ));
327          case 6: return new XCN(getMessage());
328          case 7: return new ST(getMessage());
329          case 8: return new ST(getMessage());
330          case 9: return new ID(getMessage(), new Integer( 136 ));
331          case 10: return new XAD(getMessage());
332          default: return null;
333       }
334   }
335
336
337}
338