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.v21.segment;
035
036// import ca.uhn.hl7v2.model.v21.group.*;
037import ca.uhn.hl7v2.model.v21.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 (ST) <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 * </ul>
067 */
068@SuppressWarnings("unused")
069public class DG1 extends AbstractSegment {
070
071    /** 
072     * Creates a new DG1 segment
073     */
074    public DG1(Group parent, ModelClassFactory factory) {
075       super(parent, factory);
076       init(factory);
077    }
078
079    private void init(ModelClassFactory factory) {
080       try {
081                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "SET ID - DIAGNOSIS");
082                                              this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(53) }, "DIAGNOSIS CODING METHOD");
083                                              this.add(ID.class, false, 1, 8, new Object[]{ getMessage(), new Integer(51) }, "DIAGNOSIS CODE");
084                                  this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "DIAGNOSIS DESCRIPTION");
085                                  this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "DIAGNOSIS DATE/TIME");
086                                              this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(52) }, "DIAGNOSIS/DRG TYPE");
087                                  this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "MAJOR DIAGNOSTIC CATEGORY");
088                                              this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(55) }, "DIAGNOSTIC RELATED GROUP");
089                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(0) }, "DRG APPROVAL INDICATOR");
090                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(56) }, "DRG GROUPER REVIEW CODE");
091                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(83) }, "OUTLIER TYPE");
092                                  this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "OUTLIER DAYS");
093                                  this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "OUTLIER COST");
094                                  this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "GROUPER VERSION AND TYPE");
095       } catch(HL7Exception e) {
096          log.error("Unexpected error creating DG1 - this is probably a bug in the source code generator.", e);
097       }
098    }
099
100
101
102    /**
103     * Returns
104     * DG1-1: "SET ID - DIAGNOSIS" - creates it if necessary
105     */
106    public SI getSETIDDIAGNOSIS() { 
107                SI retVal = this.getTypedField(1, 0);
108                return retVal;
109    }
110    
111    /**
112     * Returns
113     * DG1-1: "SET ID - DIAGNOSIS" - creates it if necessary
114     */
115    public SI getDg11_SETIDDIAGNOSIS() { 
116                SI retVal = this.getTypedField(1, 0);
117                return retVal;
118    }
119
120
121
122    /**
123     * Returns
124     * DG1-2: "DIAGNOSIS CODING METHOD" - creates it if necessary
125     */
126    public ID getDIAGNOSISCODINGMETHOD() { 
127                ID retVal = this.getTypedField(2, 0);
128                return retVal;
129    }
130    
131    /**
132     * Returns
133     * DG1-2: "DIAGNOSIS CODING METHOD" - creates it if necessary
134     */
135    public ID getDg12_DIAGNOSISCODINGMETHOD() { 
136                ID retVal = this.getTypedField(2, 0);
137                return retVal;
138    }
139
140
141
142    /**
143     * Returns
144     * DG1-3: "DIAGNOSIS CODE" - creates it if necessary
145     */
146    public ID getDIAGNOSISCODE() { 
147                ID retVal = this.getTypedField(3, 0);
148                return retVal;
149    }
150    
151    /**
152     * Returns
153     * DG1-3: "DIAGNOSIS CODE" - creates it if necessary
154     */
155    public ID getDg13_DIAGNOSISCODE() { 
156                ID retVal = this.getTypedField(3, 0);
157                return retVal;
158    }
159
160
161
162    /**
163     * Returns
164     * DG1-4: "DIAGNOSIS DESCRIPTION" - creates it if necessary
165     */
166    public ST getDIAGNOSISDESCRIPTION() { 
167                ST retVal = this.getTypedField(4, 0);
168                return retVal;
169    }
170    
171    /**
172     * Returns
173     * DG1-4: "DIAGNOSIS DESCRIPTION" - creates it if necessary
174     */
175    public ST getDg14_DIAGNOSISDESCRIPTION() { 
176                ST retVal = this.getTypedField(4, 0);
177                return retVal;
178    }
179
180
181
182    /**
183     * Returns
184     * DG1-5: "DIAGNOSIS DATE/TIME" - creates it if necessary
185     */
186    public TS getDIAGNOSISDATETIME() { 
187                TS retVal = this.getTypedField(5, 0);
188                return retVal;
189    }
190    
191    /**
192     * Returns
193     * DG1-5: "DIAGNOSIS DATE/TIME" - creates it if necessary
194     */
195    public TS getDg15_DIAGNOSISDATETIME() { 
196                TS retVal = this.getTypedField(5, 0);
197                return retVal;
198    }
199
200
201
202    /**
203     * Returns
204     * DG1-6: "DIAGNOSIS/DRG TYPE" - creates it if necessary
205     */
206    public ID getDIAGNOSISDRGTYPE() { 
207                ID retVal = this.getTypedField(6, 0);
208                return retVal;
209    }
210    
211    /**
212     * Returns
213     * DG1-6: "DIAGNOSIS/DRG TYPE" - creates it if necessary
214     */
215    public ID getDg16_DIAGNOSISDRGTYPE() { 
216                ID retVal = this.getTypedField(6, 0);
217                return retVal;
218    }
219
220
221
222    /**
223     * Returns
224     * DG1-7: "MAJOR DIAGNOSTIC CATEGORY" - creates it if necessary
225     */
226    public ST getMAJORDIAGNOSTICCATEGORY() { 
227                ST retVal = this.getTypedField(7, 0);
228                return retVal;
229    }
230    
231    /**
232     * Returns
233     * DG1-7: "MAJOR DIAGNOSTIC CATEGORY" - creates it if necessary
234     */
235    public ST getDg17_MAJORDIAGNOSTICCATEGORY() { 
236                ST retVal = this.getTypedField(7, 0);
237                return retVal;
238    }
239
240
241
242    /**
243     * Returns
244     * DG1-8: "DIAGNOSTIC RELATED GROUP" - creates it if necessary
245     */
246    public ID getDIAGNOSTICRELATEDGROUP() { 
247                ID retVal = this.getTypedField(8, 0);
248                return retVal;
249    }
250    
251    /**
252     * Returns
253     * DG1-8: "DIAGNOSTIC RELATED GROUP" - creates it if necessary
254     */
255    public ID getDg18_DIAGNOSTICRELATEDGROUP() { 
256                ID retVal = this.getTypedField(8, 0);
257                return retVal;
258    }
259
260
261
262    /**
263     * Returns
264     * DG1-9: "DRG APPROVAL INDICATOR" - creates it if necessary
265     */
266    public ID getDRGAPPROVALINDICATOR() { 
267                ID retVal = this.getTypedField(9, 0);
268                return retVal;
269    }
270    
271    /**
272     * Returns
273     * DG1-9: "DRG APPROVAL INDICATOR" - creates it if necessary
274     */
275    public ID getDg19_DRGAPPROVALINDICATOR() { 
276                ID retVal = this.getTypedField(9, 0);
277                return retVal;
278    }
279
280
281
282    /**
283     * Returns
284     * DG1-10: "DRG GROUPER REVIEW CODE" - creates it if necessary
285     */
286    public ID getDRGGROUPERREVIEWCODE() { 
287                ID retVal = this.getTypedField(10, 0);
288                return retVal;
289    }
290    
291    /**
292     * Returns
293     * DG1-10: "DRG GROUPER REVIEW CODE" - creates it if necessary
294     */
295    public ID getDg110_DRGGROUPERREVIEWCODE() { 
296                ID retVal = this.getTypedField(10, 0);
297                return retVal;
298    }
299
300
301
302    /**
303     * Returns
304     * DG1-11: "OUTLIER TYPE" - creates it if necessary
305     */
306    public ID getOUTLIERTYPE() { 
307                ID retVal = this.getTypedField(11, 0);
308                return retVal;
309    }
310    
311    /**
312     * Returns
313     * DG1-11: "OUTLIER TYPE" - creates it if necessary
314     */
315    public ID getDg111_OUTLIERTYPE() { 
316                ID retVal = this.getTypedField(11, 0);
317                return retVal;
318    }
319
320
321
322    /**
323     * Returns
324     * DG1-12: "OUTLIER DAYS" - creates it if necessary
325     */
326    public NM getOUTLIERDAYS() { 
327                NM retVal = this.getTypedField(12, 0);
328                return retVal;
329    }
330    
331    /**
332     * Returns
333     * DG1-12: "OUTLIER DAYS" - creates it if necessary
334     */
335    public NM getDg112_OUTLIERDAYS() { 
336                NM retVal = this.getTypedField(12, 0);
337                return retVal;
338    }
339
340
341
342    /**
343     * Returns
344     * DG1-13: "OUTLIER COST" - creates it if necessary
345     */
346    public NM getOUTLIERCOST() { 
347                NM retVal = this.getTypedField(13, 0);
348                return retVal;
349    }
350    
351    /**
352     * Returns
353     * DG1-13: "OUTLIER COST" - creates it if necessary
354     */
355    public NM getDg113_OUTLIERCOST() { 
356                NM retVal = this.getTypedField(13, 0);
357                return retVal;
358    }
359
360
361
362    /**
363     * Returns
364     * DG1-14: "GROUPER VERSION AND TYPE" - creates it if necessary
365     */
366    public ST getGROUPERVERSIONANDTYPE() { 
367                ST retVal = this.getTypedField(14, 0);
368                return retVal;
369    }
370    
371    /**
372     * Returns
373     * DG1-14: "GROUPER VERSION AND TYPE" - creates it if necessary
374     */
375    public ST getDg114_GROUPERVERSIONANDTYPE() { 
376                ST retVal = this.getTypedField(14, 0);
377                return retVal;
378    }
379
380
381
382
383
384    /** {@inheritDoc} */   
385    protected Type createNewTypeWithoutReflection(int field) {
386       switch (field) {
387          case 0: return new SI(getMessage());
388          case 1: return new ID(getMessage(), new Integer( 53 ));
389          case 2: return new ID(getMessage(), new Integer( 51 ));
390          case 3: return new ST(getMessage());
391          case 4: return new TS(getMessage());
392          case 5: return new ID(getMessage(), new Integer( 52 ));
393          case 6: return new ST(getMessage());
394          case 7: return new ID(getMessage(), new Integer( 55 ));
395          case 8: return new ID(getMessage(), new Integer( 0 ));
396          case 9: return new ID(getMessage(), new Integer( 56 ));
397          case 10: return new ID(getMessage(), new Integer( 83 ));
398          case 11: return new NM(getMessage());
399          case 12: return new NM(getMessage());
400          case 13: return new ST(getMessage());
401          default: return null;
402       }
403   }
404
405
406}
407