View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v25.segment;
35  
36  // import ca.uhn.hl7v2.model.v25.group.*;
37  import ca.uhn.hl7v2.model.v25.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 DG1 message segment (Diagnosis). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>DG1-1: Set ID - DG1 (SI) <b> </b>
53       * <li>DG1-2: Diagnosis Coding Method (ID) <b>optional </b>
54       * <li>DG1-3: Diagnosis Code - DG1 (CE) <b>optional </b>
55       * <li>DG1-4: Diagnosis Description (ST) <b>optional </b>
56       * <li>DG1-5: Diagnosis Date/Time (TS) <b>optional </b>
57       * <li>DG1-6: Diagnosis Type (IS) <b> </b>
58       * <li>DG1-7: Major Diagnostic Category (CE) <b>optional </b>
59       * <li>DG1-8: Diagnostic Related Group (CE) <b>optional </b>
60       * <li>DG1-9: DRG Approval Indicator (ID) <b>optional </b>
61       * <li>DG1-10: DRG Grouper Review Code (IS) <b>optional </b>
62       * <li>DG1-11: Outlier Type (CE) <b>optional </b>
63       * <li>DG1-12: Outlier Days (NM) <b>optional </b>
64       * <li>DG1-13: Outlier Cost (CP) <b>optional </b>
65       * <li>DG1-14: Grouper Version And Type (ST) <b>optional </b>
66       * <li>DG1-15: Diagnosis Priority (ID) <b>optional </b>
67       * <li>DG1-16: Diagnosing Clinician (XCN) <b>optional repeating</b>
68       * <li>DG1-17: Diagnosis Classification (IS) <b>optional </b>
69       * <li>DG1-18: Confidential Indicator (ID) <b>optional </b>
70       * <li>DG1-19: Attestation Date/Time (TS) <b>optional </b>
71       * <li>DG1-20: Diagnosis Identifier (EI) <b>optional </b>
72       * <li>DG1-21: Diagnosis Action Code (ID) <b>optional </b>
73   * </ul>
74   */
75  @SuppressWarnings("unused")
76  public class DG1 extends AbstractSegment {
77  
78      /** 
79       * Creates a new DG1 segment
80       */
81      public DG1(Group parent, ModelClassFactory factory) {
82         super(parent, factory);
83         init(factory);
84      }
85  
86      private void init(ModelClassFactory factory) {
87         try {
88                                    this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - DG1");
89                                                this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(53) }, "Diagnosis Coding Method");
90                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Diagnosis Code - DG1");
91                                    this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Diagnosis Description");
92                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Diagnosis Date/Time");
93                                                this.add(IS.class, true, 1, 2, new Object[]{ getMessage(), new Integer(52) }, "Diagnosis Type");
94                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Major Diagnostic Category");
95                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Diagnostic Related Group");
96                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "DRG Approval Indicator");
97                                                this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(56) }, "DRG Grouper Review Code");
98                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Outlier Type");
99                                    this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "Outlier Days");
100                                   this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Outlier Cost");
101                                   this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "Grouper Version And Type");
102                                               this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(359) }, "Diagnosis Priority");
103                                   this.add(XCN.class, false, 0, 250, new Object[]{ getMessage() }, "Diagnosing Clinician");
104                                               this.add(IS.class, false, 1, 3, new Object[]{ getMessage(), new Integer(228) }, "Diagnosis Classification");
105                                               this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Confidential Indicator");
106                                   this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Attestation Date/Time");
107                                   this.add(EI.class, false, 1, 427, new Object[]{ getMessage() }, "Diagnosis Identifier");
108                                               this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(206) }, "Diagnosis Action Code");
109        } catch(HL7Exception e) {
110           log.error("Unexpected error creating DG1 - this is probably a bug in the source code generator.", e);
111        }
112     }
113 
114 
115 
116     /**
117      * Returns
118      * DG1-1: "Set ID - DG1" - creates it if necessary
119      */
120     public SI getSetIDDG1() { 
121 		SI retVal = this.getTypedField(1, 0);
122 		return retVal;
123     }
124     
125     /**
126      * Returns
127      * DG1-1: "Set ID - DG1" - creates it if necessary
128      */
129     public SI getDg11_SetIDDG1() { 
130 		SI retVal = this.getTypedField(1, 0);
131 		return retVal;
132     }
133 
134 
135 
136     /**
137      * Returns
138      * DG1-2: "Diagnosis Coding Method" - creates it if necessary
139      */
140     public ID getDiagnosisCodingMethod() { 
141 		ID retVal = this.getTypedField(2, 0);
142 		return retVal;
143     }
144     
145     /**
146      * Returns
147      * DG1-2: "Diagnosis Coding Method" - creates it if necessary
148      */
149     public ID getDg12_DiagnosisCodingMethod() { 
150 		ID retVal = this.getTypedField(2, 0);
151 		return retVal;
152     }
153 
154 
155 
156     /**
157      * Returns
158      * DG1-3: "Diagnosis Code - DG1" - creates it if necessary
159      */
160     public CE getDiagnosisCodeDG1() { 
161 		CE retVal = this.getTypedField(3, 0);
162 		return retVal;
163     }
164     
165     /**
166      * Returns
167      * DG1-3: "Diagnosis Code - DG1" - creates it if necessary
168      */
169     public CE getDg13_DiagnosisCodeDG1() { 
170 		CE retVal = this.getTypedField(3, 0);
171 		return retVal;
172     }
173 
174 
175 
176     /**
177      * Returns
178      * DG1-4: "Diagnosis Description" - creates it if necessary
179      */
180     public ST getDiagnosisDescription() { 
181 		ST retVal = this.getTypedField(4, 0);
182 		return retVal;
183     }
184     
185     /**
186      * Returns
187      * DG1-4: "Diagnosis Description" - creates it if necessary
188      */
189     public ST getDg14_DiagnosisDescription() { 
190 		ST retVal = this.getTypedField(4, 0);
191 		return retVal;
192     }
193 
194 
195 
196     /**
197      * Returns
198      * DG1-5: "Diagnosis Date/Time" - creates it if necessary
199      */
200     public TS getDiagnosisDateTime() { 
201 		TS retVal = this.getTypedField(5, 0);
202 		return retVal;
203     }
204     
205     /**
206      * Returns
207      * DG1-5: "Diagnosis Date/Time" - creates it if necessary
208      */
209     public TS getDg15_DiagnosisDateTime() { 
210 		TS retVal = this.getTypedField(5, 0);
211 		return retVal;
212     }
213 
214 
215 
216     /**
217      * Returns
218      * DG1-6: "Diagnosis Type" - creates it if necessary
219      */
220     public IS getDiagnosisType() { 
221 		IS retVal = this.getTypedField(6, 0);
222 		return retVal;
223     }
224     
225     /**
226      * Returns
227      * DG1-6: "Diagnosis Type" - creates it if necessary
228      */
229     public IS getDg16_DiagnosisType() { 
230 		IS retVal = this.getTypedField(6, 0);
231 		return retVal;
232     }
233 
234 
235 
236     /**
237      * Returns
238      * DG1-7: "Major Diagnostic Category" - creates it if necessary
239      */
240     public CE getMajorDiagnosticCategory() { 
241 		CE retVal = this.getTypedField(7, 0);
242 		return retVal;
243     }
244     
245     /**
246      * Returns
247      * DG1-7: "Major Diagnostic Category" - creates it if necessary
248      */
249     public CE getDg17_MajorDiagnosticCategory() { 
250 		CE retVal = this.getTypedField(7, 0);
251 		return retVal;
252     }
253 
254 
255 
256     /**
257      * Returns
258      * DG1-8: "Diagnostic Related Group" - creates it if necessary
259      */
260     public CE getDiagnosticRelatedGroup() { 
261 		CE retVal = this.getTypedField(8, 0);
262 		return retVal;
263     }
264     
265     /**
266      * Returns
267      * DG1-8: "Diagnostic Related Group" - creates it if necessary
268      */
269     public CE getDg18_DiagnosticRelatedGroup() { 
270 		CE retVal = this.getTypedField(8, 0);
271 		return retVal;
272     }
273 
274 
275 
276     /**
277      * Returns
278      * DG1-9: "DRG Approval Indicator" - creates it if necessary
279      */
280     public ID getDRGApprovalIndicator() { 
281 		ID retVal = this.getTypedField(9, 0);
282 		return retVal;
283     }
284     
285     /**
286      * Returns
287      * DG1-9: "DRG Approval Indicator" - creates it if necessary
288      */
289     public ID getDg19_DRGApprovalIndicator() { 
290 		ID retVal = this.getTypedField(9, 0);
291 		return retVal;
292     }
293 
294 
295 
296     /**
297      * Returns
298      * DG1-10: "DRG Grouper Review Code" - creates it if necessary
299      */
300     public IS getDRGGrouperReviewCode() { 
301 		IS retVal = this.getTypedField(10, 0);
302 		return retVal;
303     }
304     
305     /**
306      * Returns
307      * DG1-10: "DRG Grouper Review Code" - creates it if necessary
308      */
309     public IS getDg110_DRGGrouperReviewCode() { 
310 		IS retVal = this.getTypedField(10, 0);
311 		return retVal;
312     }
313 
314 
315 
316     /**
317      * Returns
318      * DG1-11: "Outlier Type" - creates it if necessary
319      */
320     public CE getOutlierType() { 
321 		CE retVal = this.getTypedField(11, 0);
322 		return retVal;
323     }
324     
325     /**
326      * Returns
327      * DG1-11: "Outlier Type" - creates it if necessary
328      */
329     public CE getDg111_OutlierType() { 
330 		CE retVal = this.getTypedField(11, 0);
331 		return retVal;
332     }
333 
334 
335 
336     /**
337      * Returns
338      * DG1-12: "Outlier Days" - creates it if necessary
339      */
340     public NM getOutlierDays() { 
341 		NM retVal = this.getTypedField(12, 0);
342 		return retVal;
343     }
344     
345     /**
346      * Returns
347      * DG1-12: "Outlier Days" - creates it if necessary
348      */
349     public NM getDg112_OutlierDays() { 
350 		NM retVal = this.getTypedField(12, 0);
351 		return retVal;
352     }
353 
354 
355 
356     /**
357      * Returns
358      * DG1-13: "Outlier Cost" - creates it if necessary
359      */
360     public CP getOutlierCost() { 
361 		CP retVal = this.getTypedField(13, 0);
362 		return retVal;
363     }
364     
365     /**
366      * Returns
367      * DG1-13: "Outlier Cost" - creates it if necessary
368      */
369     public CP getDg113_OutlierCost() { 
370 		CP retVal = this.getTypedField(13, 0);
371 		return retVal;
372     }
373 
374 
375 
376     /**
377      * Returns
378      * DG1-14: "Grouper Version And Type" - creates it if necessary
379      */
380     public ST getGrouperVersionAndType() { 
381 		ST retVal = this.getTypedField(14, 0);
382 		return retVal;
383     }
384     
385     /**
386      * Returns
387      * DG1-14: "Grouper Version And Type" - creates it if necessary
388      */
389     public ST getDg114_GrouperVersionAndType() { 
390 		ST retVal = this.getTypedField(14, 0);
391 		return retVal;
392     }
393 
394 
395 
396     /**
397      * Returns
398      * DG1-15: "Diagnosis Priority" - creates it if necessary
399      */
400     public ID getDiagnosisPriority() { 
401 		ID retVal = this.getTypedField(15, 0);
402 		return retVal;
403     }
404     
405     /**
406      * Returns
407      * DG1-15: "Diagnosis Priority" - creates it if necessary
408      */
409     public ID getDg115_DiagnosisPriority() { 
410 		ID retVal = this.getTypedField(15, 0);
411 		return retVal;
412     }
413 
414 
415     /**
416      * Returns all repetitions of Diagnosing Clinician (DG1-16).
417      */
418     public XCN[] getDiagnosingClinician() {
419     	XCN[] retVal = this.getTypedField(16, new XCN[0]);
420     	return retVal;
421     }
422 
423 
424     /**
425      * Returns all repetitions of Diagnosing Clinician (DG1-16).
426      */
427     public XCN[] getDg116_DiagnosingClinician() {
428     	XCN[] retVal = this.getTypedField(16, new XCN[0]);
429     	return retVal;
430     }
431 
432 
433     /**
434      * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16).
435      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
436      * it will return zero.
437      */
438     public int getDiagnosingClinicianReps() {
439     	return this.getReps(16);
440     }
441 
442 
443     /**
444      * Returns a specific repetition of
445      * DG1-16: "Diagnosing Clinician" - creates it if necessary
446      *
447      * @param rep The repetition index (0-indexed)
448      */
449     public XCN getDiagnosingClinician(int rep) { 
450 		XCN retVal = this.getTypedField(16, rep);
451 		return retVal;
452     }
453 
454     /**
455      * Returns a specific repetition of
456      * DG1-16: "Diagnosing Clinician" - creates it if necessary
457      *
458      * @param rep The repetition index (0-indexed)
459      */
460     public XCN getDg116_DiagnosingClinician(int rep) { 
461 		XCN retVal = this.getTypedField(16, rep);
462 		return retVal;
463     }
464 
465     /**
466      * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16).
467      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
468      * it will return zero.
469      */
470     public int getDg116_DiagnosingClinicianReps() {
471     	return this.getReps(16);
472     }
473 
474 
475     /**
476      * Inserts a repetition of
477      * DG1-16: "Diagnosing Clinician" at a specific index
478      *
479      * @param rep The repetition index (0-indexed)
480      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
481      */
482     public XCN insertDiagnosingClinician(int rep) throws HL7Exception { 
483         return (XCN) super.insertRepetition(16, rep);
484     }
485 
486 
487     /**
488      * Inserts a repetition of
489      * DG1-16: "Diagnosing Clinician" at a specific index
490      *
491      * @param rep The repetition index (0-indexed)
492      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
493      */
494     public XCN insertDg116_DiagnosingClinician(int rep) throws HL7Exception { 
495         return (XCN) super.insertRepetition(16, rep);
496     }
497 
498 
499     /**
500      * Removes a repetition of
501      * DG1-16: "Diagnosing Clinician" at a specific index
502      *
503      * @param rep The repetition index (0-indexed)
504      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
505      */
506     public XCN removeDiagnosingClinician(int rep) throws HL7Exception { 
507         return (XCN) super.removeRepetition(16, rep);
508     }
509 
510 
511     /**
512      * Removes a repetition of
513      * DG1-16: "Diagnosing Clinician" at a specific index
514      *
515      * @param rep The repetition index (0-indexed)
516      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
517      */
518     public XCN removeDg116_DiagnosingClinician(int rep) throws HL7Exception { 
519         return (XCN) super.removeRepetition(16, rep);
520     }
521 
522 
523 
524 
525     /**
526      * Returns
527      * DG1-17: "Diagnosis Classification" - creates it if necessary
528      */
529     public IS getDiagnosisClassification() { 
530 		IS retVal = this.getTypedField(17, 0);
531 		return retVal;
532     }
533     
534     /**
535      * Returns
536      * DG1-17: "Diagnosis Classification" - creates it if necessary
537      */
538     public IS getDg117_DiagnosisClassification() { 
539 		IS retVal = this.getTypedField(17, 0);
540 		return retVal;
541     }
542 
543 
544 
545     /**
546      * Returns
547      * DG1-18: "Confidential Indicator" - creates it if necessary
548      */
549     public ID getConfidentialIndicator() { 
550 		ID retVal = this.getTypedField(18, 0);
551 		return retVal;
552     }
553     
554     /**
555      * Returns
556      * DG1-18: "Confidential Indicator" - creates it if necessary
557      */
558     public ID getDg118_ConfidentialIndicator() { 
559 		ID retVal = this.getTypedField(18, 0);
560 		return retVal;
561     }
562 
563 
564 
565     /**
566      * Returns
567      * DG1-19: "Attestation Date/Time" - creates it if necessary
568      */
569     public TS getAttestationDateTime() { 
570 		TS retVal = this.getTypedField(19, 0);
571 		return retVal;
572     }
573     
574     /**
575      * Returns
576      * DG1-19: "Attestation Date/Time" - creates it if necessary
577      */
578     public TS getDg119_AttestationDateTime() { 
579 		TS retVal = this.getTypedField(19, 0);
580 		return retVal;
581     }
582 
583 
584 
585     /**
586      * Returns
587      * DG1-20: "Diagnosis Identifier" - creates it if necessary
588      */
589     public EI getDiagnosisIdentifier() { 
590 		EI retVal = this.getTypedField(20, 0);
591 		return retVal;
592     }
593     
594     /**
595      * Returns
596      * DG1-20: "Diagnosis Identifier" - creates it if necessary
597      */
598     public EI getDg120_DiagnosisIdentifier() { 
599 		EI retVal = this.getTypedField(20, 0);
600 		return retVal;
601     }
602 
603 
604 
605     /**
606      * Returns
607      * DG1-21: "Diagnosis Action Code" - creates it if necessary
608      */
609     public ID getDiagnosisActionCode() { 
610 		ID retVal = this.getTypedField(21, 0);
611 		return retVal;
612     }
613     
614     /**
615      * Returns
616      * DG1-21: "Diagnosis Action Code" - creates it if necessary
617      */
618     public ID getDg121_DiagnosisActionCode() { 
619 		ID retVal = this.getTypedField(21, 0);
620 		return retVal;
621     }
622 
623 
624 
625 
626 
627     /** {@inheritDoc} */   
628     protected Type createNewTypeWithoutReflection(int field) {
629        switch (field) {
630           case 0: return new SI(getMessage());
631           case 1: return new ID(getMessage(), new Integer( 53 ));
632           case 2: return new CE(getMessage());
633           case 3: return new ST(getMessage());
634           case 4: return new TS(getMessage());
635           case 5: return new IS(getMessage(), new Integer( 52 ));
636           case 6: return new CE(getMessage());
637           case 7: return new CE(getMessage());
638           case 8: return new ID(getMessage(), new Integer( 136 ));
639           case 9: return new IS(getMessage(), new Integer( 56 ));
640           case 10: return new CE(getMessage());
641           case 11: return new NM(getMessage());
642           case 12: return new CP(getMessage());
643           case 13: return new ST(getMessage());
644           case 14: return new ID(getMessage(), new Integer( 359 ));
645           case 15: return new XCN(getMessage());
646           case 16: return new IS(getMessage(), new Integer( 228 ));
647           case 17: return new ID(getMessage(), new Integer( 136 ));
648           case 18: return new TS(getMessage());
649           case 19: return new EI(getMessage());
650           case 20: return new ID(getMessage(), new Integer( 206 ));
651           default: return null;
652        }
653    }
654 
655 
656 }
657