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.v21.segment;
35  
36  // import ca.uhn.hl7v2.model.v21.group.*;
37  import ca.uhn.hl7v2.model.v21.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 GT1 message segment (GUARANTOR). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>GT1-1: SET ID - GUARANTOR (SI) <b> </b>
53       * <li>GT1-2: GUARANTOR NUMBER (ID) <b>optional </b>
54       * <li>GT1-3: GUARANTOR NAME (PN) <b> </b>
55       * <li>GT1-4: GUARANTOR SPOUSE NAME (PN) <b>optional </b>
56       * <li>GT1-5: GUARANTOR ADDRESS (AD) <b>optional </b>
57       * <li>GT1-6: GUARANTOR PH. NUM.- HOME (TN) <b>optional </b>
58       * <li>GT1-7: GUARANTOR PH. NUM-BUSINESS (TN) <b>optional </b>
59       * <li>GT1-8: GUARANTOR DATE OF BIRTH (DT) <b>optional </b>
60       * <li>GT1-9: GUARANTOR SEX (ID) <b>optional </b>
61       * <li>GT1-10: GUARANTOR TYPE (ID) <b>optional </b>
62       * <li>GT1-11: GUARANTOR RELATIONSHIP (ID) <b>optional </b>
63       * <li>GT1-12: GUARANTOR SSN (ST) <b>optional </b>
64       * <li>GT1-13: GUARANTOR DATE - BEGIN (DT) <b>optional </b>
65       * <li>GT1-14: GUARANTOR DATE - END (DT) <b>optional </b>
66       * <li>GT1-15: GUARANTOR PRIORITY (NM) <b>optional </b>
67       * <li>GT1-16: GUARANTOR EMPLOYER NAME (ST) <b>optional </b>
68       * <li>GT1-17: GUARANTOR EMPLOYER ADDRESS (AD) <b>optional </b>
69       * <li>GT1-18: GUARANTOR EMPLOY PHONE # (TN) <b>optional </b>
70       * <li>GT1-19: GUARANTOR EMPLOYEE ID NUM (ST) <b>optional </b>
71       * <li>GT1-20: GUARANTOR EMPLOYMENT STATUS (ID) <b>optional </b>
72   * </ul>
73   */
74  @SuppressWarnings("unused")
75  public class GT1 extends AbstractSegment {
76  
77      /** 
78       * Creates a new GT1 segment
79       */
80      public GT1(Group parent, ModelClassFactory factory) {
81         super(parent, factory);
82         init(factory);
83      }
84  
85      private void init(ModelClassFactory factory) {
86         try {
87                                    this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "SET ID - GUARANTOR");
88                                                this.add(ID.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "GUARANTOR NUMBER");
89                                    this.add(PN.class, true, 1, 48, new Object[]{ getMessage() }, "GUARANTOR NAME");
90                                    this.add(PN.class, false, 1, 48, new Object[]{ getMessage() }, "GUARANTOR SPOUSE NAME");
91                                    this.add(AD.class, false, 1, 106, new Object[]{ getMessage() }, "GUARANTOR ADDRESS");
92                                    this.add(TN.class, false, 1, 40, new Object[]{ getMessage() }, "GUARANTOR PH. NUM.- HOME");
93                                    this.add(TN.class, false, 1, 40, new Object[]{ getMessage() }, "GUARANTOR PH. NUM-BUSINESS");
94                                    this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "GUARANTOR DATE OF BIRTH");
95                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(1) }, "GUARANTOR SEX");
96                                                this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(68) }, "GUARANTOR TYPE");
97                                                this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(63) }, "GUARANTOR RELATIONSHIP");
98                                    this.add(ST.class, false, 1, 11, new Object[]{ getMessage() }, "GUARANTOR SSN");
99                                    this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "GUARANTOR DATE - BEGIN");
100                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "GUARANTOR DATE - END");
101                                   this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "GUARANTOR PRIORITY");
102                                   this.add(ST.class, false, 1, 45, new Object[]{ getMessage() }, "GUARANTOR EMPLOYER NAME");
103                                   this.add(AD.class, false, 1, 106, new Object[]{ getMessage() }, "GUARANTOR EMPLOYER ADDRESS");
104                                   this.add(TN.class, false, 1, 40, new Object[]{ getMessage() }, "GUARANTOR EMPLOY PHONE #");
105                                   this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "GUARANTOR EMPLOYEE ID NUM");
106                                               this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(66) }, "GUARANTOR EMPLOYMENT STATUS");
107        } catch(HL7Exception e) {
108           log.error("Unexpected error creating GT1 - this is probably a bug in the source code generator.", e);
109        }
110     }
111 
112 
113 
114     /**
115      * Returns
116      * GT1-1: "SET ID - GUARANTOR" - creates it if necessary
117      */
118     public SI getSETIDGUARANTOR() { 
119 		SI retVal = this.getTypedField(1, 0);
120 		return retVal;
121     }
122     
123     /**
124      * Returns
125      * GT1-1: "SET ID - GUARANTOR" - creates it if necessary
126      */
127     public SI getGt11_SETIDGUARANTOR() { 
128 		SI retVal = this.getTypedField(1, 0);
129 		return retVal;
130     }
131 
132 
133 
134     /**
135      * Returns
136      * GT1-2: "GUARANTOR NUMBER" - creates it if necessary
137      */
138     public ID getGUARANTORNUMBER() { 
139 		ID retVal = this.getTypedField(2, 0);
140 		return retVal;
141     }
142     
143     /**
144      * Returns
145      * GT1-2: "GUARANTOR NUMBER" - creates it if necessary
146      */
147     public ID getGt12_GUARANTORNUMBER() { 
148 		ID retVal = this.getTypedField(2, 0);
149 		return retVal;
150     }
151 
152 
153 
154     /**
155      * Returns
156      * GT1-3: "GUARANTOR NAME" - creates it if necessary
157      */
158     public PN getGUARANTORNAME() { 
159 		PN retVal = this.getTypedField(3, 0);
160 		return retVal;
161     }
162     
163     /**
164      * Returns
165      * GT1-3: "GUARANTOR NAME" - creates it if necessary
166      */
167     public PN getGt13_GUARANTORNAME() { 
168 		PN retVal = this.getTypedField(3, 0);
169 		return retVal;
170     }
171 
172 
173 
174     /**
175      * Returns
176      * GT1-4: "GUARANTOR SPOUSE NAME" - creates it if necessary
177      */
178     public PN getGUARANTORSPOUSENAME() { 
179 		PN retVal = this.getTypedField(4, 0);
180 		return retVal;
181     }
182     
183     /**
184      * Returns
185      * GT1-4: "GUARANTOR SPOUSE NAME" - creates it if necessary
186      */
187     public PN getGt14_GUARANTORSPOUSENAME() { 
188 		PN retVal = this.getTypedField(4, 0);
189 		return retVal;
190     }
191 
192 
193 
194     /**
195      * Returns
196      * GT1-5: "GUARANTOR ADDRESS" - creates it if necessary
197      */
198     public AD getGUARANTORADDRESS() { 
199 		AD retVal = this.getTypedField(5, 0);
200 		return retVal;
201     }
202     
203     /**
204      * Returns
205      * GT1-5: "GUARANTOR ADDRESS" - creates it if necessary
206      */
207     public AD getGt15_GUARANTORADDRESS() { 
208 		AD retVal = this.getTypedField(5, 0);
209 		return retVal;
210     }
211 
212 
213 
214     /**
215      * Returns
216      * GT1-6: "GUARANTOR PH. NUM.- HOME" - creates it if necessary
217      */
218     public TN getGUARANTORPHNUMHOME() { 
219 		TN retVal = this.getTypedField(6, 0);
220 		return retVal;
221     }
222     
223     /**
224      * Returns
225      * GT1-6: "GUARANTOR PH. NUM.- HOME" - creates it if necessary
226      */
227     public TN getGt16_GUARANTORPHNUMHOME() { 
228 		TN retVal = this.getTypedField(6, 0);
229 		return retVal;
230     }
231 
232 
233 
234     /**
235      * Returns
236      * GT1-7: "GUARANTOR PH. NUM-BUSINESS" - creates it if necessary
237      */
238     public TN getGUARANTORPHNUMBUSINESS() { 
239 		TN retVal = this.getTypedField(7, 0);
240 		return retVal;
241     }
242     
243     /**
244      * Returns
245      * GT1-7: "GUARANTOR PH. NUM-BUSINESS" - creates it if necessary
246      */
247     public TN getGt17_GUARANTORPHNUMBUSINESS() { 
248 		TN retVal = this.getTypedField(7, 0);
249 		return retVal;
250     }
251 
252 
253 
254     /**
255      * Returns
256      * GT1-8: "GUARANTOR DATE OF BIRTH" - creates it if necessary
257      */
258     public DT getGUARANTORDATEOFBIRTH() { 
259 		DT retVal = this.getTypedField(8, 0);
260 		return retVal;
261     }
262     
263     /**
264      * Returns
265      * GT1-8: "GUARANTOR DATE OF BIRTH" - creates it if necessary
266      */
267     public DT getGt18_GUARANTORDATEOFBIRTH() { 
268 		DT retVal = this.getTypedField(8, 0);
269 		return retVal;
270     }
271 
272 
273 
274     /**
275      * Returns
276      * GT1-9: "GUARANTOR SEX" - creates it if necessary
277      */
278     public ID getGUARANTORSEX() { 
279 		ID retVal = this.getTypedField(9, 0);
280 		return retVal;
281     }
282     
283     /**
284      * Returns
285      * GT1-9: "GUARANTOR SEX" - creates it if necessary
286      */
287     public ID getGt19_GUARANTORSEX() { 
288 		ID retVal = this.getTypedField(9, 0);
289 		return retVal;
290     }
291 
292 
293 
294     /**
295      * Returns
296      * GT1-10: "GUARANTOR TYPE" - creates it if necessary
297      */
298     public ID getGUARANTORTYPE() { 
299 		ID retVal = this.getTypedField(10, 0);
300 		return retVal;
301     }
302     
303     /**
304      * Returns
305      * GT1-10: "GUARANTOR TYPE" - creates it if necessary
306      */
307     public ID getGt110_GUARANTORTYPE() { 
308 		ID retVal = this.getTypedField(10, 0);
309 		return retVal;
310     }
311 
312 
313 
314     /**
315      * Returns
316      * GT1-11: "GUARANTOR RELATIONSHIP" - creates it if necessary
317      */
318     public ID getGUARANTORRELATIONSHIP() { 
319 		ID retVal = this.getTypedField(11, 0);
320 		return retVal;
321     }
322     
323     /**
324      * Returns
325      * GT1-11: "GUARANTOR RELATIONSHIP" - creates it if necessary
326      */
327     public ID getGt111_GUARANTORRELATIONSHIP() { 
328 		ID retVal = this.getTypedField(11, 0);
329 		return retVal;
330     }
331 
332 
333 
334     /**
335      * Returns
336      * GT1-12: "GUARANTOR SSN" - creates it if necessary
337      */
338     public ST getGUARANTORSSN() { 
339 		ST retVal = this.getTypedField(12, 0);
340 		return retVal;
341     }
342     
343     /**
344      * Returns
345      * GT1-12: "GUARANTOR SSN" - creates it if necessary
346      */
347     public ST getGt112_GUARANTORSSN() { 
348 		ST retVal = this.getTypedField(12, 0);
349 		return retVal;
350     }
351 
352 
353 
354     /**
355      * Returns
356      * GT1-13: "GUARANTOR DATE - BEGIN" - creates it if necessary
357      */
358     public DT getGUARANTORDATEBEGIN() { 
359 		DT retVal = this.getTypedField(13, 0);
360 		return retVal;
361     }
362     
363     /**
364      * Returns
365      * GT1-13: "GUARANTOR DATE - BEGIN" - creates it if necessary
366      */
367     public DT getGt113_GUARANTORDATEBEGIN() { 
368 		DT retVal = this.getTypedField(13, 0);
369 		return retVal;
370     }
371 
372 
373 
374     /**
375      * Returns
376      * GT1-14: "GUARANTOR DATE - END" - creates it if necessary
377      */
378     public DT getGUARANTORDATEEND() { 
379 		DT retVal = this.getTypedField(14, 0);
380 		return retVal;
381     }
382     
383     /**
384      * Returns
385      * GT1-14: "GUARANTOR DATE - END" - creates it if necessary
386      */
387     public DT getGt114_GUARANTORDATEEND() { 
388 		DT retVal = this.getTypedField(14, 0);
389 		return retVal;
390     }
391 
392 
393 
394     /**
395      * Returns
396      * GT1-15: "GUARANTOR PRIORITY" - creates it if necessary
397      */
398     public NM getGUARANTORPRIORITY() { 
399 		NM retVal = this.getTypedField(15, 0);
400 		return retVal;
401     }
402     
403     /**
404      * Returns
405      * GT1-15: "GUARANTOR PRIORITY" - creates it if necessary
406      */
407     public NM getGt115_GUARANTORPRIORITY() { 
408 		NM retVal = this.getTypedField(15, 0);
409 		return retVal;
410     }
411 
412 
413 
414     /**
415      * Returns
416      * GT1-16: "GUARANTOR EMPLOYER NAME" - creates it if necessary
417      */
418     public ST getGUARANTOREMPLOYERNAME() { 
419 		ST retVal = this.getTypedField(16, 0);
420 		return retVal;
421     }
422     
423     /**
424      * Returns
425      * GT1-16: "GUARANTOR EMPLOYER NAME" - creates it if necessary
426      */
427     public ST getGt116_GUARANTOREMPLOYERNAME() { 
428 		ST retVal = this.getTypedField(16, 0);
429 		return retVal;
430     }
431 
432 
433 
434     /**
435      * Returns
436      * GT1-17: "GUARANTOR EMPLOYER ADDRESS" - creates it if necessary
437      */
438     public AD getGUARANTOREMPLOYERADDRESS() { 
439 		AD retVal = this.getTypedField(17, 0);
440 		return retVal;
441     }
442     
443     /**
444      * Returns
445      * GT1-17: "GUARANTOR EMPLOYER ADDRESS" - creates it if necessary
446      */
447     public AD getGt117_GUARANTOREMPLOYERADDRESS() { 
448 		AD retVal = this.getTypedField(17, 0);
449 		return retVal;
450     }
451 
452 
453 
454     /**
455      * Returns
456      * GT1-18: "GUARANTOR EMPLOY PHONE #" - creates it if necessary
457      */
458     public TN getGUARANTOREMPLOYPHONE() { 
459 		TN retVal = this.getTypedField(18, 0);
460 		return retVal;
461     }
462     
463     /**
464      * Returns
465      * GT1-18: "GUARANTOR EMPLOY PHONE #" - creates it if necessary
466      */
467     public TN getGt118_GUARANTOREMPLOYPHONE() { 
468 		TN retVal = this.getTypedField(18, 0);
469 		return retVal;
470     }
471 
472 
473 
474     /**
475      * Returns
476      * GT1-19: "GUARANTOR EMPLOYEE ID NUM" - creates it if necessary
477      */
478     public ST getGUARANTOREMPLOYEEIDNUM() { 
479 		ST retVal = this.getTypedField(19, 0);
480 		return retVal;
481     }
482     
483     /**
484      * Returns
485      * GT1-19: "GUARANTOR EMPLOYEE ID NUM" - creates it if necessary
486      */
487     public ST getGt119_GUARANTOREMPLOYEEIDNUM() { 
488 		ST retVal = this.getTypedField(19, 0);
489 		return retVal;
490     }
491 
492 
493 
494     /**
495      * Returns
496      * GT1-20: "GUARANTOR EMPLOYMENT STATUS" - creates it if necessary
497      */
498     public ID getGUARANTOREMPLOYMENTSTATUS() { 
499 		ID retVal = this.getTypedField(20, 0);
500 		return retVal;
501     }
502     
503     /**
504      * Returns
505      * GT1-20: "GUARANTOR EMPLOYMENT STATUS" - creates it if necessary
506      */
507     public ID getGt120_GUARANTOREMPLOYMENTSTATUS() { 
508 		ID retVal = this.getTypedField(20, 0);
509 		return retVal;
510     }
511 
512 
513 
514 
515 
516     /** {@inheritDoc} */   
517     protected Type createNewTypeWithoutReflection(int field) {
518        switch (field) {
519           case 0: return new SI(getMessage());
520           case 1: return new ID(getMessage(), new Integer( 0 ));
521           case 2: return new PN(getMessage());
522           case 3: return new PN(getMessage());
523           case 4: return new AD(getMessage());
524           case 5: return new TN(getMessage());
525           case 6: return new TN(getMessage());
526           case 7: return new DT(getMessage());
527           case 8: return new ID(getMessage(), new Integer( 1 ));
528           case 9: return new ID(getMessage(), new Integer( 68 ));
529           case 10: return new ID(getMessage(), new Integer( 63 ));
530           case 11: return new ST(getMessage());
531           case 12: return new DT(getMessage());
532           case 13: return new DT(getMessage());
533           case 14: return new NM(getMessage());
534           case 15: return new ST(getMessage());
535           case 16: return new AD(getMessage());
536           case 17: return new TN(getMessage());
537           case 18: return new ST(getMessage());
538           case 19: return new ID(getMessage(), new Integer( 66 ));
539           default: return null;
540        }
541    }
542 
543 
544 }
545