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    
008    package ca.uhn.hl7v2.model.v24.segment;
009    
010    // import ca.uhn.hl7v2.model.v24.group.*;
011    import ca.uhn.hl7v2.model.v24.datatype.*;
012    import ca.uhn.log.HapiLogFactory;
013    import ca.uhn.hl7v2.HL7Exception;
014    import ca.uhn.hl7v2.parser.ModelClassFactory;
015    import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016    import ca.uhn.hl7v2.model.AbstractMessage;
017    import ca.uhn.hl7v2.model.Group;
018    import ca.uhn.hl7v2.model.Type;
019    import ca.uhn.hl7v2.model.AbstractSegment;
020    import ca.uhn.hl7v2.model.Varies;
021    
022    /**
023     *<p>Represents an HL7 DG1 message segment (Diagnosis). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>DG1-1: Set ID - DG1 (SI) <b> </b>
027         * <li>DG1-2: Diagnosis Coding Method (ID) <b>optional </b>
028         * <li>DG1-3: Diagnosis Code - DG1 (CE) <b>optional </b>
029         * <li>DG1-4: Diagnosis Description (ST) <b>optional </b>
030         * <li>DG1-5: Diagnosis Date/Time (TS) <b>optional </b>
031         * <li>DG1-6: Diagnosis Type (IS) <b> </b>
032         * <li>DG1-7: Major Diagnostic Category (CE) <b>optional </b>
033         * <li>DG1-8: Diagnostic Related Group (CE) <b>optional </b>
034         * <li>DG1-9: DRG Approval Indicator (ID) <b>optional </b>
035         * <li>DG1-10: DRG Grouper Review Code (IS) <b>optional </b>
036         * <li>DG1-11: Outlier Type (CE) <b>optional </b>
037         * <li>DG1-12: Outlier Days (NM) <b>optional </b>
038         * <li>DG1-13: Outlier Cost (CP) <b>optional </b>
039         * <li>DG1-14: Grouper Version And Type (ST) <b>optional </b>
040         * <li>DG1-15: Diagnosis Priority (ID) <b>optional </b>
041         * <li>DG1-16: Diagnosing Clinician (XCN) <b>optional repeating</b>
042         * <li>DG1-17: Diagnosis Classification (IS) <b>optional </b>
043         * <li>DG1-18: Confidential Indicator (ID) <b>optional </b>
044         * <li>DG1-19: Attestation Date/Time (TS) <b>optional </b>
045     * </ul>
046     */
047    public class DG1 extends AbstractSegment {
048    
049        /** 
050         * Creates a new DG1 segment
051         */
052        public DG1(Group parent, ModelClassFactory factory) {
053           super(parent, factory);
054           init(factory);
055        }
056    
057        private void init(ModelClassFactory factory) {
058           try {
059                                      this.add(SI.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - DG1");
060                                      this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Diagnosis Coding Method");
061                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(51) }, "Diagnosis Code - DG1");
062                                      this.add(ST.class, false, 1, 40, new Object[]{ getMessage(), new Integer(0) }, "Diagnosis Description");
063                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Diagnosis Date/Time");
064                                      this.add(IS.class, true, 1, 2, new Object[]{ getMessage() }, "Diagnosis Type");
065                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(118) }, "Major Diagnostic Category");
066                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(55) }, "Diagnostic Related Group");
067                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "DRG Approval Indicator");
068                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "DRG Grouper Review Code");
069                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(83) }, "Outlier Type");
070                                      this.add(NM.class, false, 1, 3, new Object[]{ getMessage(), new Integer(0) }, "Outlier Days");
071                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Outlier Cost");
072                                      this.add(ST.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Grouper Version And Type");
073                                      this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Diagnosis Priority");
074                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Diagnosing Clinician");
075                                      this.add(IS.class, false, 1, 3, new Object[]{ getMessage() }, "Diagnosis Classification");
076                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Confidential Indicator");
077                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Attestation Date/Time");
078           } catch(HL7Exception e) {
079              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating DG1 - this is probably a bug in the source code generator.", e);
080           }
081        }
082    
083    
084    
085        /**
086         * Returns
087         * DG1-1: "Set ID - DG1" - creates it if necessary
088         */
089        public SI getSetIDDG1() { 
090            SI ret = null;
091            try {
092                Type t = this.getField(1, 0);
093                ret = (SI)t;
094            } catch (ClassCastException cce) {
095                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
096                throw new RuntimeException(cce);
097            } catch (HL7Exception he) {
098                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
099                throw new RuntimeException(he);
100            }
101            return ret;
102        }
103    
104    
105        /**
106         * Returns
107         * DG1-1: "Set ID - DG1" - creates it if necessary
108         */
109        public SI getDg11_SetIDDG1() { 
110            SI ret = null;
111            try {
112                Type t = this.getField(1, 0);
113                ret = (SI)t;
114            } catch (ClassCastException cce) {
115                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
116                throw new RuntimeException(cce);
117            } catch (HL7Exception he) {
118                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
119                throw new RuntimeException(he);
120            }
121            return ret;
122        }
123    
124    
125    
126        /**
127         * Returns
128         * DG1-2: "Diagnosis Coding Method" - creates it if necessary
129         */
130        public ID getDiagnosisCodingMethod() { 
131            ID ret = null;
132            try {
133                Type t = this.getField(2, 0);
134                ret = (ID)t;
135            } catch (ClassCastException cce) {
136                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
137                throw new RuntimeException(cce);
138            } catch (HL7Exception he) {
139                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
140                throw new RuntimeException(he);
141            }
142            return ret;
143        }
144    
145    
146        /**
147         * Returns
148         * DG1-2: "Diagnosis Coding Method" - creates it if necessary
149         */
150        public ID getDg12_DiagnosisCodingMethod() { 
151            ID ret = null;
152            try {
153                Type t = this.getField(2, 0);
154                ret = (ID)t;
155            } catch (ClassCastException cce) {
156                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
157                throw new RuntimeException(cce);
158            } catch (HL7Exception he) {
159                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
160                throw new RuntimeException(he);
161            }
162            return ret;
163        }
164    
165    
166    
167        /**
168         * Returns
169         * DG1-3: "Diagnosis Code - DG1" - creates it if necessary
170         */
171        public CE getDiagnosisCodeDG1() { 
172            CE ret = null;
173            try {
174                Type t = this.getField(3, 0);
175                ret = (CE)t;
176            } catch (ClassCastException cce) {
177                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
178                throw new RuntimeException(cce);
179            } catch (HL7Exception he) {
180                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
181                throw new RuntimeException(he);
182            }
183            return ret;
184        }
185    
186    
187        /**
188         * Returns
189         * DG1-3: "Diagnosis Code - DG1" - creates it if necessary
190         */
191        public CE getDg13_DiagnosisCodeDG1() { 
192            CE ret = null;
193            try {
194                Type t = this.getField(3, 0);
195                ret = (CE)t;
196            } catch (ClassCastException cce) {
197                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
198                throw new RuntimeException(cce);
199            } catch (HL7Exception he) {
200                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
201                throw new RuntimeException(he);
202            }
203            return ret;
204        }
205    
206    
207    
208        /**
209         * Returns
210         * DG1-4: "Diagnosis Description" - creates it if necessary
211         */
212        public ST getDiagnosisDescription() { 
213            ST ret = null;
214            try {
215                Type t = this.getField(4, 0);
216                ret = (ST)t;
217            } catch (ClassCastException cce) {
218                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
219                throw new RuntimeException(cce);
220            } catch (HL7Exception he) {
221                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
222                throw new RuntimeException(he);
223            }
224            return ret;
225        }
226    
227    
228        /**
229         * Returns
230         * DG1-4: "Diagnosis Description" - creates it if necessary
231         */
232        public ST getDg14_DiagnosisDescription() { 
233            ST ret = null;
234            try {
235                Type t = this.getField(4, 0);
236                ret = (ST)t;
237            } catch (ClassCastException cce) {
238                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
239                throw new RuntimeException(cce);
240            } catch (HL7Exception he) {
241                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
242                throw new RuntimeException(he);
243            }
244            return ret;
245        }
246    
247    
248    
249        /**
250         * Returns
251         * DG1-5: "Diagnosis Date/Time" - creates it if necessary
252         */
253        public TS getDiagnosisDateTime() { 
254            TS ret = null;
255            try {
256                Type t = this.getField(5, 0);
257                ret = (TS)t;
258            } catch (ClassCastException cce) {
259                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
260                throw new RuntimeException(cce);
261            } catch (HL7Exception he) {
262                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
263                throw new RuntimeException(he);
264            }
265            return ret;
266        }
267    
268    
269        /**
270         * Returns
271         * DG1-5: "Diagnosis Date/Time" - creates it if necessary
272         */
273        public TS getDg15_DiagnosisDateTime() { 
274            TS ret = null;
275            try {
276                Type t = this.getField(5, 0);
277                ret = (TS)t;
278            } catch (ClassCastException cce) {
279                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
280                throw new RuntimeException(cce);
281            } catch (HL7Exception he) {
282                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
283                throw new RuntimeException(he);
284            }
285            return ret;
286        }
287    
288    
289    
290        /**
291         * Returns
292         * DG1-6: "Diagnosis Type" - creates it if necessary
293         */
294        public IS getDiagnosisType() { 
295            IS ret = null;
296            try {
297                Type t = this.getField(6, 0);
298                ret = (IS)t;
299            } catch (ClassCastException cce) {
300                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
301                throw new RuntimeException(cce);
302            } catch (HL7Exception he) {
303                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
304                throw new RuntimeException(he);
305            }
306            return ret;
307        }
308    
309    
310        /**
311         * Returns
312         * DG1-6: "Diagnosis Type" - creates it if necessary
313         */
314        public IS getDg16_DiagnosisType() { 
315            IS ret = null;
316            try {
317                Type t = this.getField(6, 0);
318                ret = (IS)t;
319            } catch (ClassCastException cce) {
320                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
321                throw new RuntimeException(cce);
322            } catch (HL7Exception he) {
323                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
324                throw new RuntimeException(he);
325            }
326            return ret;
327        }
328    
329    
330    
331        /**
332         * Returns
333         * DG1-7: "Major Diagnostic Category" - creates it if necessary
334         */
335        public CE getMajorDiagnosticCategory() { 
336            CE ret = null;
337            try {
338                Type t = this.getField(7, 0);
339                ret = (CE)t;
340            } catch (ClassCastException cce) {
341                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
342                throw new RuntimeException(cce);
343            } catch (HL7Exception he) {
344                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
345                throw new RuntimeException(he);
346            }
347            return ret;
348        }
349    
350    
351        /**
352         * Returns
353         * DG1-7: "Major Diagnostic Category" - creates it if necessary
354         */
355        public CE getDg17_MajorDiagnosticCategory() { 
356            CE ret = null;
357            try {
358                Type t = this.getField(7, 0);
359                ret = (CE)t;
360            } catch (ClassCastException cce) {
361                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
362                throw new RuntimeException(cce);
363            } catch (HL7Exception he) {
364                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
365                throw new RuntimeException(he);
366            }
367            return ret;
368        }
369    
370    
371    
372        /**
373         * Returns
374         * DG1-8: "Diagnostic Related Group" - creates it if necessary
375         */
376        public CE getDiagnosticRelatedGroup() { 
377            CE ret = null;
378            try {
379                Type t = this.getField(8, 0);
380                ret = (CE)t;
381            } catch (ClassCastException cce) {
382                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
383                throw new RuntimeException(cce);
384            } catch (HL7Exception he) {
385                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
386                throw new RuntimeException(he);
387            }
388            return ret;
389        }
390    
391    
392        /**
393         * Returns
394         * DG1-8: "Diagnostic Related Group" - creates it if necessary
395         */
396        public CE getDg18_DiagnosticRelatedGroup() { 
397            CE ret = null;
398            try {
399                Type t = this.getField(8, 0);
400                ret = (CE)t;
401            } catch (ClassCastException cce) {
402                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
403                throw new RuntimeException(cce);
404            } catch (HL7Exception he) {
405                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
406                throw new RuntimeException(he);
407            }
408            return ret;
409        }
410    
411    
412    
413        /**
414         * Returns
415         * DG1-9: "DRG Approval Indicator" - creates it if necessary
416         */
417        public ID getDRGApprovalIndicator() { 
418            ID ret = null;
419            try {
420                Type t = this.getField(9, 0);
421                ret = (ID)t;
422            } catch (ClassCastException cce) {
423                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
424                throw new RuntimeException(cce);
425            } catch (HL7Exception he) {
426                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
427                throw new RuntimeException(he);
428            }
429            return ret;
430        }
431    
432    
433        /**
434         * Returns
435         * DG1-9: "DRG Approval Indicator" - creates it if necessary
436         */
437        public ID getDg19_DRGApprovalIndicator() { 
438            ID ret = null;
439            try {
440                Type t = this.getField(9, 0);
441                ret = (ID)t;
442            } catch (ClassCastException cce) {
443                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
444                throw new RuntimeException(cce);
445            } catch (HL7Exception he) {
446                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
447                throw new RuntimeException(he);
448            }
449            return ret;
450        }
451    
452    
453    
454        /**
455         * Returns
456         * DG1-10: "DRG Grouper Review Code" - creates it if necessary
457         */
458        public IS getDRGGrouperReviewCode() { 
459            IS ret = null;
460            try {
461                Type t = this.getField(10, 0);
462                ret = (IS)t;
463            } catch (ClassCastException cce) {
464                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
465                throw new RuntimeException(cce);
466            } catch (HL7Exception he) {
467                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
468                throw new RuntimeException(he);
469            }
470            return ret;
471        }
472    
473    
474        /**
475         * Returns
476         * DG1-10: "DRG Grouper Review Code" - creates it if necessary
477         */
478        public IS getDg110_DRGGrouperReviewCode() { 
479            IS ret = null;
480            try {
481                Type t = this.getField(10, 0);
482                ret = (IS)t;
483            } catch (ClassCastException cce) {
484                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
485                throw new RuntimeException(cce);
486            } catch (HL7Exception he) {
487                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
488                throw new RuntimeException(he);
489            }
490            return ret;
491        }
492    
493    
494    
495        /**
496         * Returns
497         * DG1-11: "Outlier Type" - creates it if necessary
498         */
499        public CE getOutlierType() { 
500            CE ret = null;
501            try {
502                Type t = this.getField(11, 0);
503                ret = (CE)t;
504            } catch (ClassCastException cce) {
505                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
506                throw new RuntimeException(cce);
507            } catch (HL7Exception he) {
508                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
509                throw new RuntimeException(he);
510            }
511            return ret;
512        }
513    
514    
515        /**
516         * Returns
517         * DG1-11: "Outlier Type" - creates it if necessary
518         */
519        public CE getDg111_OutlierType() { 
520            CE ret = null;
521            try {
522                Type t = this.getField(11, 0);
523                ret = (CE)t;
524            } catch (ClassCastException cce) {
525                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
526                throw new RuntimeException(cce);
527            } catch (HL7Exception he) {
528                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
529                throw new RuntimeException(he);
530            }
531            return ret;
532        }
533    
534    
535    
536        /**
537         * Returns
538         * DG1-12: "Outlier Days" - creates it if necessary
539         */
540        public NM getOutlierDays() { 
541            NM ret = null;
542            try {
543                Type t = this.getField(12, 0);
544                ret = (NM)t;
545            } catch (ClassCastException cce) {
546                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
547                throw new RuntimeException(cce);
548            } catch (HL7Exception he) {
549                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
550                throw new RuntimeException(he);
551            }
552            return ret;
553        }
554    
555    
556        /**
557         * Returns
558         * DG1-12: "Outlier Days" - creates it if necessary
559         */
560        public NM getDg112_OutlierDays() { 
561            NM ret = null;
562            try {
563                Type t = this.getField(12, 0);
564                ret = (NM)t;
565            } catch (ClassCastException cce) {
566                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
567                throw new RuntimeException(cce);
568            } catch (HL7Exception he) {
569                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
570                throw new RuntimeException(he);
571            }
572            return ret;
573        }
574    
575    
576    
577        /**
578         * Returns
579         * DG1-13: "Outlier Cost" - creates it if necessary
580         */
581        public CP getOutlierCost() { 
582            CP ret = null;
583            try {
584                Type t = this.getField(13, 0);
585                ret = (CP)t;
586            } catch (ClassCastException cce) {
587                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
588                throw new RuntimeException(cce);
589            } catch (HL7Exception he) {
590                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
591                throw new RuntimeException(he);
592            }
593            return ret;
594        }
595    
596    
597        /**
598         * Returns
599         * DG1-13: "Outlier Cost" - creates it if necessary
600         */
601        public CP getDg113_OutlierCost() { 
602            CP ret = null;
603            try {
604                Type t = this.getField(13, 0);
605                ret = (CP)t;
606            } catch (ClassCastException cce) {
607                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
608                throw new RuntimeException(cce);
609            } catch (HL7Exception he) {
610                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
611                throw new RuntimeException(he);
612            }
613            return ret;
614        }
615    
616    
617    
618        /**
619         * Returns
620         * DG1-14: "Grouper Version And Type" - creates it if necessary
621         */
622        public ST getGrouperVersionAndType() { 
623            ST ret = null;
624            try {
625                Type t = this.getField(14, 0);
626                ret = (ST)t;
627            } catch (ClassCastException cce) {
628                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
629                throw new RuntimeException(cce);
630            } catch (HL7Exception he) {
631                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
632                throw new RuntimeException(he);
633            }
634            return ret;
635        }
636    
637    
638        /**
639         * Returns
640         * DG1-14: "Grouper Version And Type" - creates it if necessary
641         */
642        public ST getDg114_GrouperVersionAndType() { 
643            ST ret = null;
644            try {
645                Type t = this.getField(14, 0);
646                ret = (ST)t;
647            } catch (ClassCastException cce) {
648                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
649                throw new RuntimeException(cce);
650            } catch (HL7Exception he) {
651                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
652                throw new RuntimeException(he);
653            }
654            return ret;
655        }
656    
657    
658    
659        /**
660         * Returns
661         * DG1-15: "Diagnosis Priority" - creates it if necessary
662         */
663        public ID getDiagnosisPriority() { 
664            ID ret = null;
665            try {
666                Type t = this.getField(15, 0);
667                ret = (ID)t;
668            } catch (ClassCastException cce) {
669                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
670                throw new RuntimeException(cce);
671            } catch (HL7Exception he) {
672                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
673                throw new RuntimeException(he);
674            }
675            return ret;
676        }
677    
678    
679        /**
680         * Returns
681         * DG1-15: "Diagnosis Priority" - creates it if necessary
682         */
683        public ID getDg115_DiagnosisPriority() { 
684            ID ret = null;
685            try {
686                Type t = this.getField(15, 0);
687                ret = (ID)t;
688            } catch (ClassCastException cce) {
689                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
690                throw new RuntimeException(cce);
691            } catch (HL7Exception he) {
692                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
693                throw new RuntimeException(he);
694            }
695            return ret;
696        }
697    
698    
699        /**
700         * Returns all repetitions of Diagnosing Clinician (DG1-16).
701         */
702        public XCN[] getDiagnosingClinician() {
703            XCN[] ret = null;
704            try {
705                Type[] t = this.getField(16);  
706                ret = new XCN[t.length];
707                for (int i = 0; i < ret.length; i++) {
708                    ret[i] = (XCN)t[i];
709                }
710            } catch (ClassCastException cce) {
711                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
712                throw new RuntimeException(cce);
713            } catch (HL7Exception he) {
714                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
715                throw new RuntimeException(he);
716            }
717            return ret;
718        }
719    
720    
721        /**
722         * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16).
723         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
724         * it will return zero.
725         */
726        public int getDiagnosingClinicianReps() {
727            XCN[] ret = null;
728            try {
729                Type[] t = this.getField(16);
730                return t.length;  
731            } catch (ClassCastException cce) {
732                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
733                throw new RuntimeException(cce);
734            } catch (HL7Exception he) {
735                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
736                throw new RuntimeException(he);
737            }
738        }
739    
740    
741        /**
742         * Returns a specific repetition of
743         * DG1-16: "Diagnosing Clinician" - creates it if necessary
744         *
745         * @param rep The repetition index (0-indexed)
746         */
747        public XCN getDiagnosingClinician(int rep) { 
748            XCN ret = null;
749            try {
750                Type t = this.getField(16, rep);
751                ret = (XCN)t;
752            } catch (ClassCastException cce) {
753                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
754                throw new RuntimeException(cce);
755            } catch (HL7Exception he) {
756                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
757                throw new RuntimeException(he);
758            }
759            return ret;
760        }
761    
762        /**
763         * Returns a specific repetition of
764         * DG1-16: "Diagnosing Clinician" - creates it if necessary
765         *
766         * @param rep The repetition index (0-indexed)
767         */
768        public XCN getDg116_DiagnosingClinician(int rep) { 
769            XCN ret = null;
770            try {
771                Type t = this.getField(16, rep);
772                ret = (XCN)t;
773            } catch (ClassCastException cce) {
774                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
775                throw new RuntimeException(cce);
776            } catch (HL7Exception he) {
777                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
778                throw new RuntimeException(he);
779            }
780            return ret;
781        }
782    
783    
784        /**
785         * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16).
786         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
787         * it will return zero.
788         */
789        public int getDg116_DiagnosingClinicianReps() {
790            XCN[] ret = null;
791            try {
792                Type[] t = this.getField(16);
793                return t.length;  
794            } catch (ClassCastException cce) {
795                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
796                throw new RuntimeException(cce);
797            } catch (HL7Exception he) {
798                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
799                throw new RuntimeException(he);
800            }
801        }
802    
803    
804    
805        /**
806         * Inserts a repetition of
807         * DG1-16: "Diagnosing Clinician" at a specific index
808         *
809         * @param rep The repetition index (0-indexed)
810         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
811         */
812        public XCN insertDiagnosingClinician(int rep) throws HL7Exception { 
813            return (XCN) super.insertRepetition(16, rep);
814        }
815    
816    
817    
818        /**
819         * Inserts a repetition of
820         * DG1-16: "Diagnosing Clinician" at a specific index
821         *
822         * @param rep The repetition index (0-indexed)
823         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
824         */
825        public XCN insertDg116_DiagnosingClinician(int rep) throws HL7Exception { 
826            return (XCN) super.insertRepetition(16, rep);
827        }
828    
829    
830        /**
831         * Removes a repetition of
832         * DG1-16: "Diagnosing Clinician" at a specific index
833         *
834         * @param rep The repetition index (0-indexed)
835         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
836         */
837        public XCN removeDiagnosingClinician(int rep) throws HL7Exception { 
838            return (XCN) super.removeRepetition(16, rep);
839        }
840    
841    
842        /**
843         * Removes a repetition of
844         * DG1-16: "Diagnosing Clinician" at a specific index
845         *
846         * @param rep The repetition index (0-indexed)
847         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
848         */
849        public XCN removeDg116_DiagnosingClinician(int rep) throws HL7Exception { 
850            return (XCN) super.removeRepetition(16, rep);
851        }
852    
853    
854    
855    
856        /**
857         * Returns
858         * DG1-17: "Diagnosis Classification" - creates it if necessary
859         */
860        public IS getDiagnosisClassification() { 
861            IS ret = null;
862            try {
863                Type t = this.getField(17, 0);
864                ret = (IS)t;
865            } catch (ClassCastException cce) {
866                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
867                throw new RuntimeException(cce);
868            } catch (HL7Exception he) {
869                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
870                throw new RuntimeException(he);
871            }
872            return ret;
873        }
874    
875    
876        /**
877         * Returns
878         * DG1-17: "Diagnosis Classification" - creates it if necessary
879         */
880        public IS getDg117_DiagnosisClassification() { 
881            IS ret = null;
882            try {
883                Type t = this.getField(17, 0);
884                ret = (IS)t;
885            } catch (ClassCastException cce) {
886                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
887                throw new RuntimeException(cce);
888            } catch (HL7Exception he) {
889                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
890                throw new RuntimeException(he);
891            }
892            return ret;
893        }
894    
895    
896    
897        /**
898         * Returns
899         * DG1-18: "Confidential Indicator" - creates it if necessary
900         */
901        public ID getConfidentialIndicator() { 
902            ID ret = null;
903            try {
904                Type t = this.getField(18, 0);
905                ret = (ID)t;
906            } catch (ClassCastException cce) {
907                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
908                throw new RuntimeException(cce);
909            } catch (HL7Exception he) {
910                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
911                throw new RuntimeException(he);
912            }
913            return ret;
914        }
915    
916    
917        /**
918         * Returns
919         * DG1-18: "Confidential Indicator" - creates it if necessary
920         */
921        public ID getDg118_ConfidentialIndicator() { 
922            ID ret = null;
923            try {
924                Type t = this.getField(18, 0);
925                ret = (ID)t;
926            } catch (ClassCastException cce) {
927                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
928                throw new RuntimeException(cce);
929            } catch (HL7Exception he) {
930                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
931                throw new RuntimeException(he);
932            }
933            return ret;
934        }
935    
936    
937    
938        /**
939         * Returns
940         * DG1-19: "Attestation Date/Time" - creates it if necessary
941         */
942        public TS getAttestationDateTime() { 
943            TS ret = null;
944            try {
945                Type t = this.getField(19, 0);
946                ret = (TS)t;
947            } catch (ClassCastException cce) {
948                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
949                throw new RuntimeException(cce);
950            } catch (HL7Exception he) {
951                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
952                throw new RuntimeException(he);
953            }
954            return ret;
955        }
956    
957    
958        /**
959         * Returns
960         * DG1-19: "Attestation Date/Time" - creates it if necessary
961         */
962        public TS getDg119_AttestationDateTime() { 
963            TS ret = null;
964            try {
965                Type t = this.getField(19, 0);
966                ret = (TS)t;
967            } catch (ClassCastException cce) {
968                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
969                throw new RuntimeException(cce);
970            } catch (HL7Exception he) {
971                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
972                throw new RuntimeException(he);
973            }
974            return ret;
975        }
976    
977    
978    
979    
980    
981        /** {@inheritDoc} */   
982        protected Type createNewTypeWithoutReflection(int field) {
983           switch (field) {
984              case 0: return new SI(getMessage());
985              case 1: return new ID(getMessage(), new Integer( 53 ));
986              case 2: return new CE(getMessage());
987              case 3: return new ST(getMessage());
988              case 4: return new TS(getMessage());
989              case 5: return new IS(getMessage(), new Integer( 52 ));
990              case 6: return new CE(getMessage());
991              case 7: return new CE(getMessage());
992              case 8: return new ID(getMessage(), new Integer( 136 ));
993              case 9: return new IS(getMessage(), new Integer( 56 ));
994              case 10: return new CE(getMessage());
995              case 11: return new NM(getMessage());
996              case 12: return new CP(getMessage());
997              case 13: return new ST(getMessage());
998              case 14: return new ID(getMessage(), new Integer( 359 ));
999              case 15: return new XCN(getMessage());
1000              case 16: return new IS(getMessage(), new Integer( 228 ));
1001              case 17: return new ID(getMessage(), new Integer( 136 ));
1002              case 18: return new TS(getMessage());
1003              default: return null;
1004           }
1005       }
1006    
1007    
1008    }
1009