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.v22.segment;
035
036// import ca.uhn.hl7v2.model.v22.group.*;
037import ca.uhn.hl7v2.model.v22.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 DG1 message segment (DIAGNOSIS). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>DG1-1: Set ID - diagnosis (SI) <b> </b>
053     * <li>DG1-2: Diagnosis coding method (ID) <b> </b>
054     * <li>DG1-3: Diagnosis code (ID) <b>optional </b>
055     * <li>DG1-4: Diagnosis description (ST) <b>optional </b>
056     * <li>DG1-5: Diagnosis date / time (TS) <b>optional </b>
057     * <li>DG1-6: Diagnosis / DRG type (ID) <b> </b>
058     * <li>DG1-7: Major diagnostic category (CE) <b>optional </b>
059     * <li>DG1-8: Diagnostic related group (ID) <b>optional </b>
060     * <li>DG1-9: DRG approval indicator (ID) <b>optional </b>
061     * <li>DG1-10: DRG grouper review code (ID) <b>optional </b>
062     * <li>DG1-11: Outlier type (ID) <b>optional </b>
063     * <li>DG1-12: Outlier days (NM) <b>optional </b>
064     * <li>DG1-13: Outlier cost (NM) <b>optional </b>
065     * <li>DG1-14: Grouper version and type (ST) <b>optional </b>
066     * <li>DG1-15: Diagnosis / DRG priority (NM) <b>optional </b>
067     * <li>DG1-16: Diagnosing clinician (CN) <b>optional </b>
068 * </ul>
069 */
070@SuppressWarnings("unused")
071public class DG1 extends AbstractSegment {
072
073    /** 
074     * Creates a new DG1 segment
075     */
076    public DG1(Group parent, ModelClassFactory factory) {
077       super(parent, factory);
078       init(factory);
079    }
080
081    private void init(ModelClassFactory factory) {
082       try {
083                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - diagnosis");
084                                              this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(53) }, "Diagnosis coding method");
085                                              this.add(ID.class, false, 1, 8, new Object[]{ getMessage(), new Integer(51) }, "Diagnosis code");
086                                  this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Diagnosis description");
087                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Diagnosis date / time");
088                                              this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(52) }, "Diagnosis / DRG type");
089                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Major diagnostic category");
090                                              this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(55) }, "Diagnostic related group");
091                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(0) }, "DRG approval indicator");
092                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(56) }, "DRG grouper review code");
093                                              this.add(ID.class, false, 1, 60, new Object[]{ getMessage(), new Integer(83) }, "Outlier type");
094                                  this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "Outlier days");
095                                  this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "Outlier cost");
096                                  this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "Grouper version and type");
097                                  this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "Diagnosis / DRG priority");
098                                  this.add(CN.class, false, 1, 60, new Object[]{ getMessage() }, "Diagnosing clinician");
099       } 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