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.v22.segment;
35  
36  // import ca.uhn.hl7v2.model.v22.group.*;
37  import ca.uhn.hl7v2.model.v22.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 DG1 message segment (DIAGNOSIS). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>DG1-1: Set ID - diagnosis (SI) <b> </b>
53       * <li>DG1-2: Diagnosis coding method (ID) <b> </b>
54       * <li>DG1-3: Diagnosis code (ID) <b>optional </b>
55       * <li>DG1-4: Diagnosis description (ST) <b>optional </b>
56       * <li>DG1-5: Diagnosis date / time (TS) <b>optional </b>
57       * <li>DG1-6: Diagnosis / DRG type (ID) <b> </b>
58       * <li>DG1-7: Major diagnostic category (CE) <b>optional </b>
59       * <li>DG1-8: Diagnostic related group (ID) <b>optional </b>
60       * <li>DG1-9: DRG approval indicator (ID) <b>optional </b>
61       * <li>DG1-10: DRG grouper review code (ID) <b>optional </b>
62       * <li>DG1-11: Outlier type (ID) <b>optional </b>
63       * <li>DG1-12: Outlier days (NM) <b>optional </b>
64       * <li>DG1-13: Outlier cost (NM) <b>optional </b>
65       * <li>DG1-14: Grouper version and type (ST) <b>optional </b>
66       * <li>DG1-15: Diagnosis / DRG priority (NM) <b>optional </b>
67       * <li>DG1-16: Diagnosing clinician (CN) <b>optional </b>
68   * </ul>
69   */
70  @SuppressWarnings("unused")
71  public class DG1 extends AbstractSegment {
72  
73      /** 
74       * Creates a new DG1 segment
75       */
76      public DG1(Group parent, ModelClassFactory factory) {
77         super(parent, factory);
78         init(factory);
79      }
80  
81      private void init(ModelClassFactory factory) {
82         try {
83                                    this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - diagnosis");
84                                                this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(53) }, "Diagnosis coding method");
85                                                this.add(ID.class, false, 1, 8, new Object[]{ getMessage(), new Integer(51) }, "Diagnosis code");
86                                    this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Diagnosis description");
87                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Diagnosis date / time");
88                                                this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(52) }, "Diagnosis / DRG type");
89                                    this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Major diagnostic category");
90                                                this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(55) }, "Diagnostic related group");
91                                                this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(0) }, "DRG approval indicator");
92                                                this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(56) }, "DRG grouper review code");
93                                                this.add(ID.class, false, 1, 60, new Object[]{ getMessage(), new Integer(83) }, "Outlier type");
94                                    this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "Outlier days");
95                                    this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "Outlier cost");
96                                    this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "Grouper version and type");
97                                    this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "Diagnosis / DRG priority");
98                                    this.add(CN.class, false, 1, 60, new Object[]{ getMessage() }, "Diagnosing clinician");
99         } catch(HL7Exception e) {
100           log.error("Unexpected error creating DG1 - this is probably a bug in the source code generator.", e);
101        }
102     }
103 
104 
105 
106     /**
107      * Returns
108      * DG1-1: "Set ID - diagnosis" - creates it if necessary
109      */
110     public SI getSetIDDiagnosis() { 
111 		SI retVal = this.getTypedField(1, 0);
112 		return retVal;
113     }
114     
115     /**
116      * Returns
117      * DG1-1: "Set ID - diagnosis" - creates it if necessary
118      */
119     public SI getDg11_SetIDDiagnosis() { 
120 		SI retVal = this.getTypedField(1, 0);
121 		return retVal;
122     }
123 
124 
125 
126     /**
127      * Returns
128      * DG1-2: "Diagnosis coding method" - creates it if necessary
129      */
130     public ID getDiagnosisCodingMethod() { 
131 		ID retVal = this.getTypedField(2, 0);
132 		return retVal;
133     }
134     
135     /**
136      * Returns
137      * DG1-2: "Diagnosis coding method" - creates it if necessary
138      */
139     public ID getDg12_DiagnosisCodingMethod() { 
140 		ID retVal = this.getTypedField(2, 0);
141 		return retVal;
142     }
143 
144 
145 
146     /**
147      * Returns
148      * DG1-3: "Diagnosis code" - creates it if necessary
149      */
150     public ID getDiagnosisCode() { 
151 		ID retVal = this.getTypedField(3, 0);
152 		return retVal;
153     }
154     
155     /**
156      * Returns
157      * DG1-3: "Diagnosis code" - creates it if necessary
158      */
159     public ID getDg13_DiagnosisCode() { 
160 		ID retVal = this.getTypedField(3, 0);
161 		return retVal;
162     }
163 
164 
165 
166     /**
167      * Returns
168      * DG1-4: "Diagnosis description" - creates it if necessary
169      */
170     public ST getDiagnosisDescription() { 
171 		ST retVal = this.getTypedField(4, 0);
172 		return retVal;
173     }
174     
175     /**
176      * Returns
177      * DG1-4: "Diagnosis description" - creates it if necessary
178      */
179     public ST getDg14_DiagnosisDescription() { 
180 		ST retVal = this.getTypedField(4, 0);
181 		return retVal;
182     }
183 
184 
185 
186     /**
187      * Returns
188      * DG1-5: "Diagnosis date / time" - creates it if necessary
189      */
190     public TS getDiagnosisDateTime() { 
191 		TS retVal = this.getTypedField(5, 0);
192 		return retVal;
193     }
194     
195     /**
196      * Returns
197      * DG1-5: "Diagnosis date / time" - creates it if necessary
198      */
199     public TS getDg15_DiagnosisDateTime() { 
200 		TS retVal = this.getTypedField(5, 0);
201 		return retVal;
202     }
203 
204 
205 
206     /**
207      * Returns
208      * DG1-6: "Diagnosis / DRG type" - creates it if necessary
209      */
210     public ID getDiagnosisDRGType() { 
211 		ID retVal = this.getTypedField(6, 0);
212 		return retVal;
213     }
214     
215     /**
216      * Returns
217      * DG1-6: "Diagnosis / DRG type" - creates it if necessary
218      */
219     public ID getDg16_DiagnosisDRGType() { 
220 		ID retVal = this.getTypedField(6, 0);
221 		return retVal;
222     }
223 
224 
225 
226     /**
227      * Returns
228      * DG1-7: "Major diagnostic category" - creates it if necessary
229      */
230     public CE getMajorDiagnosticCategory() { 
231 		CE retVal = this.getTypedField(7, 0);
232 		return retVal;
233     }
234     
235     /**
236      * Returns
237      * DG1-7: "Major diagnostic category" - creates it if necessary
238      */
239     public CE getDg17_MajorDiagnosticCategory() { 
240 		CE retVal = this.getTypedField(7, 0);
241 		return retVal;
242     }
243 
244 
245 
246     /**
247      * Returns
248      * DG1-8: "Diagnostic related group" - creates it if necessary
249      */
250     public ID getDiagnosticRelatedGroup() { 
251 		ID retVal = this.getTypedField(8, 0);
252 		return retVal;
253     }
254     
255     /**
256      * Returns
257      * DG1-8: "Diagnostic related group" - creates it if necessary
258      */
259     public ID getDg18_DiagnosticRelatedGroup() { 
260 		ID retVal = this.getTypedField(8, 0);
261 		return retVal;
262     }
263 
264 
265 
266     /**
267      * Returns
268      * DG1-9: "DRG approval indicator" - creates it if necessary
269      */
270     public ID getDRGApprovalIndicator() { 
271 		ID retVal = this.getTypedField(9, 0);
272 		return retVal;
273     }
274     
275     /**
276      * Returns
277      * DG1-9: "DRG approval indicator" - creates it if necessary
278      */
279     public ID getDg19_DRGApprovalIndicator() { 
280 		ID retVal = this.getTypedField(9, 0);
281 		return retVal;
282     }
283 
284 
285 
286     /**
287      * Returns
288      * DG1-10: "DRG grouper review code" - creates it if necessary
289      */
290     public ID getDRGGrouperReviewCode() { 
291 		ID retVal = this.getTypedField(10, 0);
292 		return retVal;
293     }
294     
295     /**
296      * Returns
297      * DG1-10: "DRG grouper review code" - creates it if necessary
298      */
299     public ID getDg110_DRGGrouperReviewCode() { 
300 		ID retVal = this.getTypedField(10, 0);
301 		return retVal;
302     }
303 
304 
305 
306     /**
307      * Returns
308      * DG1-11: "Outlier type" - creates it if necessary
309      */
310     public ID getOutlierType() { 
311 		ID retVal = this.getTypedField(11, 0);
312 		return retVal;
313     }
314     
315     /**
316      * Returns
317      * DG1-11: "Outlier type" - creates it if necessary
318      */
319     public ID getDg111_OutlierType() { 
320 		ID retVal = this.getTypedField(11, 0);
321 		return retVal;
322     }
323 
324 
325 
326     /**
327      * Returns
328      * DG1-12: "Outlier days" - creates it if necessary
329      */
330     public NM getOutlierDays() { 
331 		NM retVal = this.getTypedField(12, 0);
332 		return retVal;
333     }
334     
335     /**
336      * Returns
337      * DG1-12: "Outlier days" - creates it if necessary
338      */
339     public NM getDg112_OutlierDays() { 
340 		NM retVal = this.getTypedField(12, 0);
341 		return retVal;
342     }
343 
344 
345 
346     /**
347      * Returns
348      * DG1-13: "Outlier cost" - creates it if necessary
349      */
350     public NM getOutlierCost() { 
351 		NM retVal = this.getTypedField(13, 0);
352 		return retVal;
353     }
354     
355     /**
356      * Returns
357      * DG1-13: "Outlier cost" - creates it if necessary
358      */
359     public NM getDg113_OutlierCost() { 
360 		NM retVal = this.getTypedField(13, 0);
361 		return retVal;
362     }
363 
364 
365 
366     /**
367      * Returns
368      * DG1-14: "Grouper version and type" - creates it if necessary
369      */
370     public ST getGrouperVersionAndType() { 
371 		ST retVal = this.getTypedField(14, 0);
372 		return retVal;
373     }
374     
375     /**
376      * Returns
377      * DG1-14: "Grouper version and type" - creates it if necessary
378      */
379     public ST getDg114_GrouperVersionAndType() { 
380 		ST retVal = this.getTypedField(14, 0);
381 		return retVal;
382     }
383 
384 
385 
386     /**
387      * Returns
388      * DG1-15: "Diagnosis / DRG priority" - creates it if necessary
389      */
390     public NM getDiagnosisDRGPriority() { 
391 		NM retVal = this.getTypedField(15, 0);
392 		return retVal;
393     }
394     
395     /**
396      * Returns
397      * DG1-15: "Diagnosis / DRG priority" - creates it if necessary
398      */
399     public NM getDg115_DiagnosisDRGPriority() { 
400 		NM retVal = this.getTypedField(15, 0);
401 		return retVal;
402     }
403 
404 
405 
406     /**
407      * Returns
408      * DG1-16: "Diagnosing clinician" - creates it if necessary
409      */
410     public CN getDiagnosingClinician() { 
411 		CN retVal = this.getTypedField(16, 0);
412 		return retVal;
413     }
414     
415     /**
416      * Returns
417      * DG1-16: "Diagnosing clinician" - creates it if necessary
418      */
419     public CN getDg116_DiagnosingClinician() { 
420 		CN retVal = this.getTypedField(16, 0);
421 		return retVal;
422     }
423 
424 
425 
426 
427 
428     /** {@inheritDoc} */   
429     protected Type createNewTypeWithoutReflection(int field) {
430        switch (field) {
431           case 0: return new SI(getMessage());
432           case 1: return new ID(getMessage(), new Integer( 53 ));
433           case 2: return new ID(getMessage(), new Integer( 51 ));
434           case 3: return new ST(getMessage());
435           case 4: return new TS(getMessage());
436           case 5: return new ID(getMessage(), new Integer( 52 ));
437           case 6: return new CE(getMessage());
438           case 7: return new ID(getMessage(), new Integer( 55 ));
439           case 8: return new ID(getMessage(), new Integer( 0 ));
440           case 9: return new ID(getMessage(), new Integer( 56 ));
441           case 10: return new ID(getMessage(), new Integer( 83 ));
442           case 11: return new NM(getMessage());
443           case 12: return new NM(getMessage());
444           case 13: return new ST(getMessage());
445           case 14: return new NM(getMessage());
446           case 15: return new CN(getMessage());
447           default: return null;
448        }
449    }
450 
451 
452 }
453