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.v27.segment;
35  
36  // import ca.uhn.hl7v2.model.v27.group.*;
37  import ca.uhn.hl7v2.model.v27.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 ACC message segment (Accident). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>ACC-1: Accident Date/Time (DTM) <b>optional </b>
53       * <li>ACC-2: Accident Code (CWE) <b>optional </b>
54       * <li>ACC-3: Accident Location (ST) <b>optional </b>
55       * <li>ACC-4: Auto Accident State (CWE) <b>optional </b>
56       * <li>ACC-5: Accident Job Related Indicator (ID) <b>optional </b>
57       * <li>ACC-6: Accident Death Indicator (ID) <b>optional </b>
58       * <li>ACC-7: Entered By (XCN) <b>optional </b>
59       * <li>ACC-8: Accident Description (ST) <b>optional </b>
60       * <li>ACC-9: Brought In By (ST) <b>optional </b>
61       * <li>ACC-10: Police Notified Indicator (ID) <b>optional </b>
62       * <li>ACC-11: Accident Address (XAD) <b>optional </b>
63       * <li>ACC-12: Degree of patient liability (NM) <b>optional </b>
64   * </ul>
65   */
66  @SuppressWarnings("unused")
67  public class ACC extends AbstractSegment {
68  
69      /** 
70       * Creates a new ACC segment
71       */
72      public ACC(Group parent, ModelClassFactory factory) {
73         super(parent, factory);
74         init(factory);
75      }
76  
77      private void init(ModelClassFactory factory) {
78         try {
79                                    this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Accident Date/Time");
80                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Accident Code");
81                                    this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Accident Location");
82                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Auto Accident State");
83                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Accident Job Related Indicator");
84                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Accident Death Indicator");
85                                    this.add(XCN.class, false, 1, 0, new Object[]{ getMessage() }, "Entered By");
86                                    this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Accident Description");
87                                    this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Brought In By");
88                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Police Notified Indicator");
89                                    this.add(XAD.class, false, 1, 0, new Object[]{ getMessage() }, "Accident Address");
90                                    this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Degree of patient liability");
91         } catch(HL7Exception e) {
92            log.error("Unexpected error creating ACC - this is probably a bug in the source code generator.", e);
93         }
94      }
95  
96  
97  
98      /**
99       * Returns
100      * ACC-1: "Accident Date/Time" - creates it if necessary
101      */
102     public DTM getAccidentDateTime() { 
103 		DTM retVal = this.getTypedField(1, 0);
104 		return retVal;
105     }
106     
107     /**
108      * Returns
109      * ACC-1: "Accident Date/Time" - creates it if necessary
110      */
111     public DTM getAcc1_AccidentDateTime() { 
112 		DTM retVal = this.getTypedField(1, 0);
113 		return retVal;
114     }
115 
116 
117 
118     /**
119      * Returns
120      * ACC-2: "Accident Code" - creates it if necessary
121      */
122     public CWE getAccidentCode() { 
123 		CWE retVal = this.getTypedField(2, 0);
124 		return retVal;
125     }
126     
127     /**
128      * Returns
129      * ACC-2: "Accident Code" - creates it if necessary
130      */
131     public CWE getAcc2_AccidentCode() { 
132 		CWE retVal = this.getTypedField(2, 0);
133 		return retVal;
134     }
135 
136 
137 
138     /**
139      * Returns
140      * ACC-3: "Accident Location" - creates it if necessary
141      */
142     public ST getAccidentLocation() { 
143 		ST retVal = this.getTypedField(3, 0);
144 		return retVal;
145     }
146     
147     /**
148      * Returns
149      * ACC-3: "Accident Location" - creates it if necessary
150      */
151     public ST getAcc3_AccidentLocation() { 
152 		ST retVal = this.getTypedField(3, 0);
153 		return retVal;
154     }
155 
156 
157 
158     /**
159      * Returns
160      * ACC-4: "Auto Accident State" - creates it if necessary
161      */
162     public CWE getAutoAccidentState() { 
163 		CWE retVal = this.getTypedField(4, 0);
164 		return retVal;
165     }
166     
167     /**
168      * Returns
169      * ACC-4: "Auto Accident State" - creates it if necessary
170      */
171     public CWE getAcc4_AutoAccidentState() { 
172 		CWE retVal = this.getTypedField(4, 0);
173 		return retVal;
174     }
175 
176 
177 
178     /**
179      * Returns
180      * ACC-5: "Accident Job Related Indicator" - creates it if necessary
181      */
182     public ID getAccidentJobRelatedIndicator() { 
183 		ID retVal = this.getTypedField(5, 0);
184 		return retVal;
185     }
186     
187     /**
188      * Returns
189      * ACC-5: "Accident Job Related Indicator" - creates it if necessary
190      */
191     public ID getAcc5_AccidentJobRelatedIndicator() { 
192 		ID retVal = this.getTypedField(5, 0);
193 		return retVal;
194     }
195 
196 
197 
198     /**
199      * Returns
200      * ACC-6: "Accident Death Indicator" - creates it if necessary
201      */
202     public ID getAccidentDeathIndicator() { 
203 		ID retVal = this.getTypedField(6, 0);
204 		return retVal;
205     }
206     
207     /**
208      * Returns
209      * ACC-6: "Accident Death Indicator" - creates it if necessary
210      */
211     public ID getAcc6_AccidentDeathIndicator() { 
212 		ID retVal = this.getTypedField(6, 0);
213 		return retVal;
214     }
215 
216 
217 
218     /**
219      * Returns
220      * ACC-7: "Entered By" - creates it if necessary
221      */
222     public XCN getEnteredBy() { 
223 		XCN retVal = this.getTypedField(7, 0);
224 		return retVal;
225     }
226     
227     /**
228      * Returns
229      * ACC-7: "Entered By" - creates it if necessary
230      */
231     public XCN getAcc7_EnteredBy() { 
232 		XCN retVal = this.getTypedField(7, 0);
233 		return retVal;
234     }
235 
236 
237 
238     /**
239      * Returns
240      * ACC-8: "Accident Description" - creates it if necessary
241      */
242     public ST getAccidentDescription() { 
243 		ST retVal = this.getTypedField(8, 0);
244 		return retVal;
245     }
246     
247     /**
248      * Returns
249      * ACC-8: "Accident Description" - creates it if necessary
250      */
251     public ST getAcc8_AccidentDescription() { 
252 		ST retVal = this.getTypedField(8, 0);
253 		return retVal;
254     }
255 
256 
257 
258     /**
259      * Returns
260      * ACC-9: "Brought In By" - creates it if necessary
261      */
262     public ST getBroughtInBy() { 
263 		ST retVal = this.getTypedField(9, 0);
264 		return retVal;
265     }
266     
267     /**
268      * Returns
269      * ACC-9: "Brought In By" - creates it if necessary
270      */
271     public ST getAcc9_BroughtInBy() { 
272 		ST retVal = this.getTypedField(9, 0);
273 		return retVal;
274     }
275 
276 
277 
278     /**
279      * Returns
280      * ACC-10: "Police Notified Indicator" - creates it if necessary
281      */
282     public ID getPoliceNotifiedIndicator() { 
283 		ID retVal = this.getTypedField(10, 0);
284 		return retVal;
285     }
286     
287     /**
288      * Returns
289      * ACC-10: "Police Notified Indicator" - creates it if necessary
290      */
291     public ID getAcc10_PoliceNotifiedIndicator() { 
292 		ID retVal = this.getTypedField(10, 0);
293 		return retVal;
294     }
295 
296 
297 
298     /**
299      * Returns
300      * ACC-11: "Accident Address" - creates it if necessary
301      */
302     public XAD getAccidentAddress() { 
303 		XAD retVal = this.getTypedField(11, 0);
304 		return retVal;
305     }
306     
307     /**
308      * Returns
309      * ACC-11: "Accident Address" - creates it if necessary
310      */
311     public XAD getAcc11_AccidentAddress() { 
312 		XAD retVal = this.getTypedField(11, 0);
313 		return retVal;
314     }
315 
316 
317 
318     /**
319      * Returns
320      * ACC-12: "Degree of patient liability" - creates it if necessary
321      */
322     public NM getDegreeOfPatientLiability() { 
323 		NM retVal = this.getTypedField(12, 0);
324 		return retVal;
325     }
326     
327     /**
328      * Returns
329      * ACC-12: "Degree of patient liability" - creates it if necessary
330      */
331     public NM getAcc12_DegreeOfPatientLiability() { 
332 		NM retVal = this.getTypedField(12, 0);
333 		return retVal;
334     }
335 
336 
337 
338 
339 
340     /** {@inheritDoc} */   
341     protected Type createNewTypeWithoutReflection(int field) {
342        switch (field) {
343           case 0: return new DTM(getMessage());
344           case 1: return new CWE(getMessage());
345           case 2: return new ST(getMessage());
346           case 3: return new CWE(getMessage());
347           case 4: return new ID(getMessage(), new Integer( 136 ));
348           case 5: return new ID(getMessage(), new Integer( 136 ));
349           case 6: return new XCN(getMessage());
350           case 7: return new ST(getMessage());
351           case 8: return new ST(getMessage());
352           case 9: return new ID(getMessage(), new Integer( 136 ));
353           case 10: return new XAD(getMessage());
354           case 11: return new NM(getMessage());
355           default: return null;
356        }
357    }
358 
359 
360 }
361