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.v24.segment;
035
036// import ca.uhn.hl7v2.model.v24.group.*;
037import ca.uhn.hl7v2.model.v24.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 *<p>Represents an HL7 DG1 message segment (Diagnosis). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>DG1-1: Set ID - DG1 (SI) <b> </b>
052     * <li>DG1-2: Diagnosis Coding Method (ID) <b>optional </b>
053     * <li>DG1-3: Diagnosis Code - DG1 (CE) <b>optional </b>
054     * <li>DG1-4: Diagnosis Description (ST) <b>optional </b>
055     * <li>DG1-5: Diagnosis Date/Time (TS) <b>optional </b>
056     * <li>DG1-6: Diagnosis Type (IS) <b> </b>
057     * <li>DG1-7: Major Diagnostic Category (CE) <b>optional </b>
058     * <li>DG1-8: Diagnostic Related Group (CE) <b>optional </b>
059     * <li>DG1-9: DRG Approval Indicator (ID) <b>optional </b>
060     * <li>DG1-10: DRG Grouper Review Code (IS) <b>optional </b>
061     * <li>DG1-11: Outlier Type (CE) <b>optional </b>
062     * <li>DG1-12: Outlier Days (NM) <b>optional </b>
063     * <li>DG1-13: Outlier Cost (CP) <b>optional </b>
064     * <li>DG1-14: Grouper Version And Type (ST) <b>optional </b>
065     * <li>DG1-15: Diagnosis Priority (ID) <b>optional </b>
066     * <li>DG1-16: Diagnosing Clinician (XCN) <b>optional repeating</b>
067     * <li>DG1-17: Diagnosis Classification (IS) <b>optional </b>
068     * <li>DG1-18: Confidential Indicator (ID) <b>optional </b>
069     * <li>DG1-19: Attestation Date/Time (TS) <b>optional </b>
070 * </ul>
071 */
072@SuppressWarnings("unused")
073public class DG1 extends AbstractSegment {
074
075    /** 
076     * Creates a new DG1 segment
077     */
078    public DG1(Group parent, ModelClassFactory factory) {
079       super(parent, factory);
080       init(factory);
081    }
082
083    private void init(ModelClassFactory factory) {
084       try {
085                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - DG1");
086                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(53) }, "Diagnosis Coding Method");
087                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Diagnosis Code - DG1");
088                                  this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Diagnosis Description");
089                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Diagnosis Date/Time");
090                                              this.add(IS.class, true, 1, 2, new Object[]{ getMessage(), new Integer(52) }, "Diagnosis Type");
091                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Major Diagnostic Category");
092                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Diagnostic Related Group");
093                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "DRG Approval Indicator");
094                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(56) }, "DRG Grouper Review Code");
095                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Outlier Type");
096                                  this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "Outlier Days");
097                                  this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Outlier Cost");
098                                  this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "Grouper Version And Type");
099                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(359) }, "Diagnosis Priority");
100                                  this.add(XCN.class, false, 0, 250, new Object[]{ getMessage() }, "Diagnosing Clinician");
101                                              this.add(IS.class, false, 1, 3, new Object[]{ getMessage(), new Integer(228) }, "Diagnosis Classification");
102                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Confidential Indicator");
103                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Attestation Date/Time");
104       } catch(HL7Exception e) {
105          log.error("Unexpected error creating DG1 - this is probably a bug in the source code generator.", e);
106       }
107    }
108
109
110
111    /**
112     * Returns
113     * DG1-1: "Set ID - DG1" - creates it if necessary
114     */
115    public SI getSetIDDG1() { 
116                SI retVal = this.getTypedField(1, 0);
117                return retVal;
118    }
119    
120    /**
121     * Returns
122     * DG1-1: "Set ID - DG1" - creates it if necessary
123     */
124    public SI getDg11_SetIDDG1() { 
125                SI retVal = this.getTypedField(1, 0);
126                return retVal;
127    }
128
129
130
131    /**
132     * Returns
133     * DG1-2: "Diagnosis Coding Method" - creates it if necessary
134     */
135    public ID getDiagnosisCodingMethod() { 
136                ID retVal = this.getTypedField(2, 0);
137                return retVal;
138    }
139    
140    /**
141     * Returns
142     * DG1-2: "Diagnosis Coding Method" - creates it if necessary
143     */
144    public ID getDg12_DiagnosisCodingMethod() { 
145                ID retVal = this.getTypedField(2, 0);
146                return retVal;
147    }
148
149
150
151    /**
152     * Returns
153     * DG1-3: "Diagnosis Code - DG1" - creates it if necessary
154     */
155    public CE getDiagnosisCodeDG1() { 
156                CE retVal = this.getTypedField(3, 0);
157                return retVal;
158    }
159    
160    /**
161     * Returns
162     * DG1-3: "Diagnosis Code - DG1" - creates it if necessary
163     */
164    public CE getDg13_DiagnosisCodeDG1() { 
165                CE retVal = this.getTypedField(3, 0);
166                return retVal;
167    }
168
169
170
171    /**
172     * Returns
173     * DG1-4: "Diagnosis Description" - creates it if necessary
174     */
175    public ST getDiagnosisDescription() { 
176                ST retVal = this.getTypedField(4, 0);
177                return retVal;
178    }
179    
180    /**
181     * Returns
182     * DG1-4: "Diagnosis Description" - creates it if necessary
183     */
184    public ST getDg14_DiagnosisDescription() { 
185                ST retVal = this.getTypedField(4, 0);
186                return retVal;
187    }
188
189
190
191    /**
192     * Returns
193     * DG1-5: "Diagnosis Date/Time" - creates it if necessary
194     */
195    public TS getDiagnosisDateTime() { 
196                TS retVal = this.getTypedField(5, 0);
197                return retVal;
198    }
199    
200    /**
201     * Returns
202     * DG1-5: "Diagnosis Date/Time" - creates it if necessary
203     */
204    public TS getDg15_DiagnosisDateTime() { 
205                TS retVal = this.getTypedField(5, 0);
206                return retVal;
207    }
208
209
210
211    /**
212     * Returns
213     * DG1-6: "Diagnosis Type" - creates it if necessary
214     */
215    public IS getDiagnosisType() { 
216                IS retVal = this.getTypedField(6, 0);
217                return retVal;
218    }
219    
220    /**
221     * Returns
222     * DG1-6: "Diagnosis Type" - creates it if necessary
223     */
224    public IS getDg16_DiagnosisType() { 
225                IS retVal = this.getTypedField(6, 0);
226                return retVal;
227    }
228
229
230
231    /**
232     * Returns
233     * DG1-7: "Major Diagnostic Category" - creates it if necessary
234     */
235    public CE getMajorDiagnosticCategory() { 
236                CE retVal = this.getTypedField(7, 0);
237                return retVal;
238    }
239    
240    /**
241     * Returns
242     * DG1-7: "Major Diagnostic Category" - creates it if necessary
243     */
244    public CE getDg17_MajorDiagnosticCategory() { 
245                CE retVal = this.getTypedField(7, 0);
246                return retVal;
247    }
248
249
250
251    /**
252     * Returns
253     * DG1-8: "Diagnostic Related Group" - creates it if necessary
254     */
255    public CE getDiagnosticRelatedGroup() { 
256                CE retVal = this.getTypedField(8, 0);
257                return retVal;
258    }
259    
260    /**
261     * Returns
262     * DG1-8: "Diagnostic Related Group" - creates it if necessary
263     */
264    public CE getDg18_DiagnosticRelatedGroup() { 
265                CE retVal = this.getTypedField(8, 0);
266                return retVal;
267    }
268
269
270
271    /**
272     * Returns
273     * DG1-9: "DRG Approval Indicator" - creates it if necessary
274     */
275    public ID getDRGApprovalIndicator() { 
276                ID retVal = this.getTypedField(9, 0);
277                return retVal;
278    }
279    
280    /**
281     * Returns
282     * DG1-9: "DRG Approval Indicator" - creates it if necessary
283     */
284    public ID getDg19_DRGApprovalIndicator() { 
285                ID retVal = this.getTypedField(9, 0);
286                return retVal;
287    }
288
289
290
291    /**
292     * Returns
293     * DG1-10: "DRG Grouper Review Code" - creates it if necessary
294     */
295    public IS getDRGGrouperReviewCode() { 
296                IS retVal = this.getTypedField(10, 0);
297                return retVal;
298    }
299    
300    /**
301     * Returns
302     * DG1-10: "DRG Grouper Review Code" - creates it if necessary
303     */
304    public IS getDg110_DRGGrouperReviewCode() { 
305                IS retVal = this.getTypedField(10, 0);
306                return retVal;
307    }
308
309
310
311    /**
312     * Returns
313     * DG1-11: "Outlier Type" - creates it if necessary
314     */
315    public CE getOutlierType() { 
316                CE retVal = this.getTypedField(11, 0);
317                return retVal;
318    }
319    
320    /**
321     * Returns
322     * DG1-11: "Outlier Type" - creates it if necessary
323     */
324    public CE getDg111_OutlierType() { 
325                CE retVal = this.getTypedField(11, 0);
326                return retVal;
327    }
328
329
330
331    /**
332     * Returns
333     * DG1-12: "Outlier Days" - creates it if necessary
334     */
335    public NM getOutlierDays() { 
336                NM retVal = this.getTypedField(12, 0);
337                return retVal;
338    }
339    
340    /**
341     * Returns
342     * DG1-12: "Outlier Days" - creates it if necessary
343     */
344    public NM getDg112_OutlierDays() { 
345                NM retVal = this.getTypedField(12, 0);
346                return retVal;
347    }
348
349
350
351    /**
352     * Returns
353     * DG1-13: "Outlier Cost" - creates it if necessary
354     */
355    public CP getOutlierCost() { 
356                CP retVal = this.getTypedField(13, 0);
357                return retVal;
358    }
359    
360    /**
361     * Returns
362     * DG1-13: "Outlier Cost" - creates it if necessary
363     */
364    public CP getDg113_OutlierCost() { 
365                CP retVal = this.getTypedField(13, 0);
366                return retVal;
367    }
368
369
370
371    /**
372     * Returns
373     * DG1-14: "Grouper Version And Type" - creates it if necessary
374     */
375    public ST getGrouperVersionAndType() { 
376                ST retVal = this.getTypedField(14, 0);
377                return retVal;
378    }
379    
380    /**
381     * Returns
382     * DG1-14: "Grouper Version And Type" - creates it if necessary
383     */
384    public ST getDg114_GrouperVersionAndType() { 
385                ST retVal = this.getTypedField(14, 0);
386                return retVal;
387    }
388
389
390
391    /**
392     * Returns
393     * DG1-15: "Diagnosis Priority" - creates it if necessary
394     */
395    public ID getDiagnosisPriority() { 
396                ID retVal = this.getTypedField(15, 0);
397                return retVal;
398    }
399    
400    /**
401     * Returns
402     * DG1-15: "Diagnosis Priority" - creates it if necessary
403     */
404    public ID getDg115_DiagnosisPriority() { 
405                ID retVal = this.getTypedField(15, 0);
406                return retVal;
407    }
408
409
410    /**
411     * Returns all repetitions of Diagnosing Clinician (DG1-16).
412     */
413    public XCN[] getDiagnosingClinician() {
414        XCN[] retVal = this.getTypedField(16, new XCN[0]);
415        return retVal;
416    }
417
418
419    /**
420     * Returns all repetitions of Diagnosing Clinician (DG1-16).
421     */
422    public XCN[] getDg116_DiagnosingClinician() {
423        XCN[] retVal = this.getTypedField(16, new XCN[0]);
424        return retVal;
425    }
426
427
428    /**
429     * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16).
430     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
431     * it will return zero.
432     */
433    public int getDiagnosingClinicianReps() {
434        return this.getReps(16);
435    }
436
437
438    /**
439     * Returns a specific repetition of
440     * DG1-16: "Diagnosing Clinician" - creates it if necessary
441     *
442     * @param rep The repetition index (0-indexed)
443     */
444    public XCN getDiagnosingClinician(int rep) { 
445                XCN retVal = this.getTypedField(16, rep);
446                return retVal;
447    }
448
449    /**
450     * Returns a specific repetition of
451     * DG1-16: "Diagnosing Clinician" - creates it if necessary
452     *
453     * @param rep The repetition index (0-indexed)
454     */
455    public XCN getDg116_DiagnosingClinician(int rep) { 
456                XCN retVal = this.getTypedField(16, rep);
457                return retVal;
458    }
459
460    /**
461     * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16).
462     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
463     * it will return zero.
464     */
465    public int getDg116_DiagnosingClinicianReps() {
466        return this.getReps(16);
467    }
468
469
470    /**
471     * Inserts a repetition of
472     * DG1-16: "Diagnosing Clinician" at a specific index
473     *
474     * @param rep The repetition index (0-indexed)
475     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
476     */
477    public XCN insertDiagnosingClinician(int rep) throws HL7Exception { 
478        return (XCN) super.insertRepetition(16, rep);
479    }
480
481
482    /**
483     * Inserts a repetition of
484     * DG1-16: "Diagnosing Clinician" at a specific index
485     *
486     * @param rep The repetition index (0-indexed)
487     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
488     */
489    public XCN insertDg116_DiagnosingClinician(int rep) throws HL7Exception { 
490        return (XCN) super.insertRepetition(16, rep);
491    }
492
493
494    /**
495     * Removes a repetition of
496     * DG1-16: "Diagnosing Clinician" at a specific index
497     *
498     * @param rep The repetition index (0-indexed)
499     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
500     */
501    public XCN removeDiagnosingClinician(int rep) throws HL7Exception { 
502        return (XCN) super.removeRepetition(16, rep);
503    }
504
505
506    /**
507     * Removes a repetition of
508     * DG1-16: "Diagnosing Clinician" at a specific index
509     *
510     * @param rep The repetition index (0-indexed)
511     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
512     */
513    public XCN removeDg116_DiagnosingClinician(int rep) throws HL7Exception { 
514        return (XCN) super.removeRepetition(16, rep);
515    }
516
517
518
519
520    /**
521     * Returns
522     * DG1-17: "Diagnosis Classification" - creates it if necessary
523     */
524    public IS getDiagnosisClassification() { 
525                IS retVal = this.getTypedField(17, 0);
526                return retVal;
527    }
528    
529    /**
530     * Returns
531     * DG1-17: "Diagnosis Classification" - creates it if necessary
532     */
533    public IS getDg117_DiagnosisClassification() { 
534                IS retVal = this.getTypedField(17, 0);
535                return retVal;
536    }
537
538
539
540    /**
541     * Returns
542     * DG1-18: "Confidential Indicator" - creates it if necessary
543     */
544    public ID getConfidentialIndicator() { 
545                ID retVal = this.getTypedField(18, 0);
546                return retVal;
547    }
548    
549    /**
550     * Returns
551     * DG1-18: "Confidential Indicator" - creates it if necessary
552     */
553    public ID getDg118_ConfidentialIndicator() { 
554                ID retVal = this.getTypedField(18, 0);
555                return retVal;
556    }
557
558
559
560    /**
561     * Returns
562     * DG1-19: "Attestation Date/Time" - creates it if necessary
563     */
564    public TS getAttestationDateTime() { 
565                TS retVal = this.getTypedField(19, 0);
566                return retVal;
567    }
568    
569    /**
570     * Returns
571     * DG1-19: "Attestation Date/Time" - creates it if necessary
572     */
573    public TS getDg119_AttestationDateTime() { 
574                TS retVal = this.getTypedField(19, 0);
575                return retVal;
576    }
577
578
579
580
581
582    /** {@inheritDoc} */   
583    protected Type createNewTypeWithoutReflection(int field) {
584       switch (field) {
585          case 0: return new SI(getMessage());
586          case 1: return new ID(getMessage(), new Integer( 53 ));
587          case 2: return new CE(getMessage());
588          case 3: return new ST(getMessage());
589          case 4: return new TS(getMessage());
590          case 5: return new IS(getMessage(), new Integer( 52 ));
591          case 6: return new CE(getMessage());
592          case 7: return new CE(getMessage());
593          case 8: return new ID(getMessage(), new Integer( 136 ));
594          case 9: return new IS(getMessage(), new Integer( 56 ));
595          case 10: return new CE(getMessage());
596          case 11: return new NM(getMessage());
597          case 12: return new CP(getMessage());
598          case 13: return new ST(getMessage());
599          case 14: return new ID(getMessage(), new Integer( 359 ));
600          case 15: return new XCN(getMessage());
601          case 16: return new IS(getMessage(), new Integer( 228 ));
602          case 17: return new ID(getMessage(), new Integer( 136 ));
603          case 18: return new TS(getMessage());
604          default: return null;
605       }
606   }
607
608
609}
610