001/*
002 * This class is an auto-generated source file for a HAPI
003 * HL7 v2.x standard structure class.
004 *
005 * For more information, visit: http://hl7api.sourceforge.net/
006 * 
007 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033
034package ca.uhn.hl7v2.model.v21.segment;
035
036// import ca.uhn.hl7v2.model.v21.group.*;
037import ca.uhn.hl7v2.model.v21.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047/**
048 *<p>Represents an HL7 GT1 message segment (GUARANTOR). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>GT1-1: SET ID - GUARANTOR (SI) <b> </b>
052     * <li>GT1-2: GUARANTOR NUMBER (ID) <b>optional </b>
053     * <li>GT1-3: GUARANTOR NAME (PN) <b> </b>
054     * <li>GT1-4: GUARANTOR SPOUSE NAME (PN) <b>optional </b>
055     * <li>GT1-5: GUARANTOR ADDRESS (AD) <b>optional </b>
056     * <li>GT1-6: GUARANTOR PH. NUM.- HOME (TN) <b>optional </b>
057     * <li>GT1-7: GUARANTOR PH. NUM-BUSINESS (TN) <b>optional </b>
058     * <li>GT1-8: GUARANTOR DATE OF BIRTH (DT) <b>optional </b>
059     * <li>GT1-9: GUARANTOR SEX (ID) <b>optional </b>
060     * <li>GT1-10: GUARANTOR TYPE (ID) <b>optional </b>
061     * <li>GT1-11: GUARANTOR RELATIONSHIP (ID) <b>optional </b>
062     * <li>GT1-12: GUARANTOR SSN (ST) <b>optional </b>
063     * <li>GT1-13: GUARANTOR DATE - BEGIN (DT) <b>optional </b>
064     * <li>GT1-14: GUARANTOR DATE - END (DT) <b>optional </b>
065     * <li>GT1-15: GUARANTOR PRIORITY (NM) <b>optional </b>
066     * <li>GT1-16: GUARANTOR EMPLOYER NAME (ST) <b>optional </b>
067     * <li>GT1-17: GUARANTOR EMPLOYER ADDRESS (AD) <b>optional </b>
068     * <li>GT1-18: GUARANTOR EMPLOY PHONE # (TN) <b>optional </b>
069     * <li>GT1-19: GUARANTOR EMPLOYEE ID NUM (ST) <b>optional </b>
070     * <li>GT1-20: GUARANTOR EMPLOYMENT STATUS (ID) <b>optional </b>
071 * </ul>
072 */
073@SuppressWarnings("unused")
074public class GT1 extends AbstractSegment {
075
076    /** 
077     * Creates a new GT1 segment
078     */
079    public GT1(Group parent, ModelClassFactory factory) {
080       super(parent, factory);
081       init(factory);
082    }
083
084    private void init(ModelClassFactory factory) {
085       try {
086                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "SET ID - GUARANTOR");
087                                              this.add(ID.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "GUARANTOR NUMBER");
088                                  this.add(PN.class, true, 1, 48, new Object[]{ getMessage() }, "GUARANTOR NAME");
089                                  this.add(PN.class, false, 1, 48, new Object[]{ getMessage() }, "GUARANTOR SPOUSE NAME");
090                                  this.add(AD.class, false, 1, 106, new Object[]{ getMessage() }, "GUARANTOR ADDRESS");
091                                  this.add(TN.class, false, 1, 40, new Object[]{ getMessage() }, "GUARANTOR PH. NUM.- HOME");
092                                  this.add(TN.class, false, 1, 40, new Object[]{ getMessage() }, "GUARANTOR PH. NUM-BUSINESS");
093                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "GUARANTOR DATE OF BIRTH");
094                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(1) }, "GUARANTOR SEX");
095                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(68) }, "GUARANTOR TYPE");
096                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(63) }, "GUARANTOR RELATIONSHIP");
097                                  this.add(ST.class, false, 1, 11, new Object[]{ getMessage() }, "GUARANTOR SSN");
098                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "GUARANTOR DATE - BEGIN");
099                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "GUARANTOR DATE - END");
100                                  this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "GUARANTOR PRIORITY");
101                                  this.add(ST.class, false, 1, 45, new Object[]{ getMessage() }, "GUARANTOR EMPLOYER NAME");
102                                  this.add(AD.class, false, 1, 106, new Object[]{ getMessage() }, "GUARANTOR EMPLOYER ADDRESS");
103                                  this.add(TN.class, false, 1, 40, new Object[]{ getMessage() }, "GUARANTOR EMPLOY PHONE #");
104                                  this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "GUARANTOR EMPLOYEE ID NUM");
105                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(66) }, "GUARANTOR EMPLOYMENT STATUS");
106       } catch(HL7Exception e) {
107          log.error("Unexpected error creating GT1 - this is probably a bug in the source code generator.", e);
108       }
109    }
110
111
112
113    /**
114     * Returns
115     * GT1-1: "SET ID - GUARANTOR" - creates it if necessary
116     */
117    public SI getSETIDGUARANTOR() { 
118                SI retVal = this.getTypedField(1, 0);
119                return retVal;
120    }
121    
122    /**
123     * Returns
124     * GT1-1: "SET ID - GUARANTOR" - creates it if necessary
125     */
126    public SI getGt11_SETIDGUARANTOR() { 
127                SI retVal = this.getTypedField(1, 0);
128                return retVal;
129    }
130
131
132
133    /**
134     * Returns
135     * GT1-2: "GUARANTOR NUMBER" - creates it if necessary
136     */
137    public ID getGUARANTORNUMBER() { 
138                ID retVal = this.getTypedField(2, 0);
139                return retVal;
140    }
141    
142    /**
143     * Returns
144     * GT1-2: "GUARANTOR NUMBER" - creates it if necessary
145     */
146    public ID getGt12_GUARANTORNUMBER() { 
147                ID retVal = this.getTypedField(2, 0);
148                return retVal;
149    }
150
151
152
153    /**
154     * Returns
155     * GT1-3: "GUARANTOR NAME" - creates it if necessary
156     */
157    public PN getGUARANTORNAME() { 
158                PN retVal = this.getTypedField(3, 0);
159                return retVal;
160    }
161    
162    /**
163     * Returns
164     * GT1-3: "GUARANTOR NAME" - creates it if necessary
165     */
166    public PN getGt13_GUARANTORNAME() { 
167                PN retVal = this.getTypedField(3, 0);
168                return retVal;
169    }
170
171
172
173    /**
174     * Returns
175     * GT1-4: "GUARANTOR SPOUSE NAME" - creates it if necessary
176     */
177    public PN getGUARANTORSPOUSENAME() { 
178                PN retVal = this.getTypedField(4, 0);
179                return retVal;
180    }
181    
182    /**
183     * Returns
184     * GT1-4: "GUARANTOR SPOUSE NAME" - creates it if necessary
185     */
186    public PN getGt14_GUARANTORSPOUSENAME() { 
187                PN retVal = this.getTypedField(4, 0);
188                return retVal;
189    }
190
191
192
193    /**
194     * Returns
195     * GT1-5: "GUARANTOR ADDRESS" - creates it if necessary
196     */
197    public AD getGUARANTORADDRESS() { 
198                AD retVal = this.getTypedField(5, 0);
199                return retVal;
200    }
201    
202    /**
203     * Returns
204     * GT1-5: "GUARANTOR ADDRESS" - creates it if necessary
205     */
206    public AD getGt15_GUARANTORADDRESS() { 
207                AD retVal = this.getTypedField(5, 0);
208                return retVal;
209    }
210
211
212
213    /**
214     * Returns
215     * GT1-6: "GUARANTOR PH. NUM.- HOME" - creates it if necessary
216     */
217    public TN getGUARANTORPHNUMHOME() { 
218                TN retVal = this.getTypedField(6, 0);
219                return retVal;
220    }
221    
222    /**
223     * Returns
224     * GT1-6: "GUARANTOR PH. NUM.- HOME" - creates it if necessary
225     */
226    public TN getGt16_GUARANTORPHNUMHOME() { 
227                TN retVal = this.getTypedField(6, 0);
228                return retVal;
229    }
230
231
232
233    /**
234     * Returns
235     * GT1-7: "GUARANTOR PH. NUM-BUSINESS" - creates it if necessary
236     */
237    public TN getGUARANTORPHNUMBUSINESS() { 
238                TN retVal = this.getTypedField(7, 0);
239                return retVal;
240    }
241    
242    /**
243     * Returns
244     * GT1-7: "GUARANTOR PH. NUM-BUSINESS" - creates it if necessary
245     */
246    public TN getGt17_GUARANTORPHNUMBUSINESS() { 
247                TN retVal = this.getTypedField(7, 0);
248                return retVal;
249    }
250
251
252
253    /**
254     * Returns
255     * GT1-8: "GUARANTOR DATE OF BIRTH" - creates it if necessary
256     */
257    public DT getGUARANTORDATEOFBIRTH() { 
258                DT retVal = this.getTypedField(8, 0);
259                return retVal;
260    }
261    
262    /**
263     * Returns
264     * GT1-8: "GUARANTOR DATE OF BIRTH" - creates it if necessary
265     */
266    public DT getGt18_GUARANTORDATEOFBIRTH() { 
267                DT retVal = this.getTypedField(8, 0);
268                return retVal;
269    }
270
271
272
273    /**
274     * Returns
275     * GT1-9: "GUARANTOR SEX" - creates it if necessary
276     */
277    public ID getGUARANTORSEX() { 
278                ID retVal = this.getTypedField(9, 0);
279                return retVal;
280    }
281    
282    /**
283     * Returns
284     * GT1-9: "GUARANTOR SEX" - creates it if necessary
285     */
286    public ID getGt19_GUARANTORSEX() { 
287                ID retVal = this.getTypedField(9, 0);
288                return retVal;
289    }
290
291
292
293    /**
294     * Returns
295     * GT1-10: "GUARANTOR TYPE" - creates it if necessary
296     */
297    public ID getGUARANTORTYPE() { 
298                ID retVal = this.getTypedField(10, 0);
299                return retVal;
300    }
301    
302    /**
303     * Returns
304     * GT1-10: "GUARANTOR TYPE" - creates it if necessary
305     */
306    public ID getGt110_GUARANTORTYPE() { 
307                ID retVal = this.getTypedField(10, 0);
308                return retVal;
309    }
310
311
312
313    /**
314     * Returns
315     * GT1-11: "GUARANTOR RELATIONSHIP" - creates it if necessary
316     */
317    public ID getGUARANTORRELATIONSHIP() { 
318                ID retVal = this.getTypedField(11, 0);
319                return retVal;
320    }
321    
322    /**
323     * Returns
324     * GT1-11: "GUARANTOR RELATIONSHIP" - creates it if necessary
325     */
326    public ID getGt111_GUARANTORRELATIONSHIP() { 
327                ID retVal = this.getTypedField(11, 0);
328                return retVal;
329    }
330
331
332
333    /**
334     * Returns
335     * GT1-12: "GUARANTOR SSN" - creates it if necessary
336     */
337    public ST getGUARANTORSSN() { 
338                ST retVal = this.getTypedField(12, 0);
339                return retVal;
340    }
341    
342    /**
343     * Returns
344     * GT1-12: "GUARANTOR SSN" - creates it if necessary
345     */
346    public ST getGt112_GUARANTORSSN() { 
347                ST retVal = this.getTypedField(12, 0);
348                return retVal;
349    }
350
351
352
353    /**
354     * Returns
355     * GT1-13: "GUARANTOR DATE - BEGIN" - creates it if necessary
356     */
357    public DT getGUARANTORDATEBEGIN() { 
358                DT retVal = this.getTypedField(13, 0);
359                return retVal;
360    }
361    
362    /**
363     * Returns
364     * GT1-13: "GUARANTOR DATE - BEGIN" - creates it if necessary
365     */
366    public DT getGt113_GUARANTORDATEBEGIN() { 
367                DT retVal = this.getTypedField(13, 0);
368                return retVal;
369    }
370
371
372
373    /**
374     * Returns
375     * GT1-14: "GUARANTOR DATE - END" - creates it if necessary
376     */
377    public DT getGUARANTORDATEEND() { 
378                DT retVal = this.getTypedField(14, 0);
379                return retVal;
380    }
381    
382    /**
383     * Returns
384     * GT1-14: "GUARANTOR DATE - END" - creates it if necessary
385     */
386    public DT getGt114_GUARANTORDATEEND() { 
387                DT retVal = this.getTypedField(14, 0);
388                return retVal;
389    }
390
391
392
393    /**
394     * Returns
395     * GT1-15: "GUARANTOR PRIORITY" - creates it if necessary
396     */
397    public NM getGUARANTORPRIORITY() { 
398                NM retVal = this.getTypedField(15, 0);
399                return retVal;
400    }
401    
402    /**
403     * Returns
404     * GT1-15: "GUARANTOR PRIORITY" - creates it if necessary
405     */
406    public NM getGt115_GUARANTORPRIORITY() { 
407                NM retVal = this.getTypedField(15, 0);
408                return retVal;
409    }
410
411
412
413    /**
414     * Returns
415     * GT1-16: "GUARANTOR EMPLOYER NAME" - creates it if necessary
416     */
417    public ST getGUARANTOREMPLOYERNAME() { 
418                ST retVal = this.getTypedField(16, 0);
419                return retVal;
420    }
421    
422    /**
423     * Returns
424     * GT1-16: "GUARANTOR EMPLOYER NAME" - creates it if necessary
425     */
426    public ST getGt116_GUARANTOREMPLOYERNAME() { 
427                ST retVal = this.getTypedField(16, 0);
428                return retVal;
429    }
430
431
432
433    /**
434     * Returns
435     * GT1-17: "GUARANTOR EMPLOYER ADDRESS" - creates it if necessary
436     */
437    public AD getGUARANTOREMPLOYERADDRESS() { 
438                AD retVal = this.getTypedField(17, 0);
439                return retVal;
440    }
441    
442    /**
443     * Returns
444     * GT1-17: "GUARANTOR EMPLOYER ADDRESS" - creates it if necessary
445     */
446    public AD getGt117_GUARANTOREMPLOYERADDRESS() { 
447                AD retVal = this.getTypedField(17, 0);
448                return retVal;
449    }
450
451
452
453    /**
454     * Returns
455     * GT1-18: "GUARANTOR EMPLOY PHONE #" - creates it if necessary
456     */
457    public TN getGUARANTOREMPLOYPHONE() { 
458                TN retVal = this.getTypedField(18, 0);
459                return retVal;
460    }
461    
462    /**
463     * Returns
464     * GT1-18: "GUARANTOR EMPLOY PHONE #" - creates it if necessary
465     */
466    public TN getGt118_GUARANTOREMPLOYPHONE() { 
467                TN retVal = this.getTypedField(18, 0);
468                return retVal;
469    }
470
471
472
473    /**
474     * Returns
475     * GT1-19: "GUARANTOR EMPLOYEE ID NUM" - creates it if necessary
476     */
477    public ST getGUARANTOREMPLOYEEIDNUM() { 
478                ST retVal = this.getTypedField(19, 0);
479                return retVal;
480    }
481    
482    /**
483     * Returns
484     * GT1-19: "GUARANTOR EMPLOYEE ID NUM" - creates it if necessary
485     */
486    public ST getGt119_GUARANTOREMPLOYEEIDNUM() { 
487                ST retVal = this.getTypedField(19, 0);
488                return retVal;
489    }
490
491
492
493    /**
494     * Returns
495     * GT1-20: "GUARANTOR EMPLOYMENT STATUS" - creates it if necessary
496     */
497    public ID getGUARANTOREMPLOYMENTSTATUS() { 
498                ID retVal = this.getTypedField(20, 0);
499                return retVal;
500    }
501    
502    /**
503     * Returns
504     * GT1-20: "GUARANTOR EMPLOYMENT STATUS" - creates it if necessary
505     */
506    public ID getGt120_GUARANTOREMPLOYMENTSTATUS() { 
507                ID retVal = this.getTypedField(20, 0);
508                return retVal;
509    }
510
511
512
513
514
515    /** {@inheritDoc} */   
516    protected Type createNewTypeWithoutReflection(int field) {
517       switch (field) {
518          case 0: return new SI(getMessage());
519          case 1: return new ID(getMessage(), new Integer( 0 ));
520          case 2: return new PN(getMessage());
521          case 3: return new PN(getMessage());
522          case 4: return new AD(getMessage());
523          case 5: return new TN(getMessage());
524          case 6: return new TN(getMessage());
525          case 7: return new DT(getMessage());
526          case 8: return new ID(getMessage(), new Integer( 1 ));
527          case 9: return new ID(getMessage(), new Integer( 68 ));
528          case 10: return new ID(getMessage(), new Integer( 63 ));
529          case 11: return new ST(getMessage());
530          case 12: return new DT(getMessage());
531          case 13: return new DT(getMessage());
532          case 14: return new NM(getMessage());
533          case 15: return new ST(getMessage());
534          case 16: return new AD(getMessage());
535          case 17: return new TN(getMessage());
536          case 18: return new ST(getMessage());
537          case 19: return new ID(getMessage(), new Integer( 66 ));
538          default: return null;
539       }
540   }
541
542
543}
544