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 FT1 message segment (FINANCIAL TRANSACTION). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>FT1-1: SET ID - FINANCIAL TRANSACTION (SI) <b>optional </b>
53       * <li>FT1-2: TRANSACTION ID (ST) <b>optional </b>
54       * <li>FT1-3: TRANSACTION BATCH ID (ST) <b>optional </b>
55       * <li>FT1-4: TRANSACTION DATE (DT) <b> </b>
56       * <li>FT1-5: TRANSACTION POSTING DATE (DT) <b>optional </b>
57       * <li>FT1-6: TRANSACTION TYPE (ID) <b> </b>
58       * <li>FT1-7: TRANSACTION CODE (ID) <b> </b>
59       * <li>FT1-8: TRANSACTION DESCRIPTION (ST) <b>optional </b>
60       * <li>FT1-9: TRANSACTION DESCRIPTION - ALT (ST) <b>optional </b>
61       * <li>FT1-10: TRANSACTION AMOUNT - EXTENDED (NM) <b>optional </b>
62       * <li>FT1-11: TRANSACTION QUANTITY (NM) <b>optional </b>
63       * <li>FT1-12: TRANSACTION AMOUNT - UNIT (NM) <b>optional </b>
64       * <li>FT1-13: DEPARTMENT CODE (ST) <b>optional </b>
65       * <li>FT1-14: INSURANCE PLAN ID (ID) <b>optional </b>
66       * <li>FT1-15: INSURANCE AMOUNT (NM) <b>optional </b>
67       * <li>FT1-16: PATIENT LOCATION (ST) <b>optional </b>
68       * <li>FT1-17: FEE SCHEDULE (ID) <b>optional </b>
69       * <li>FT1-18: PATIENT TYPE (ID) <b>optional </b>
70       * <li>FT1-19: DIAGNOSIS CODE (ID) <b>optional </b>
71       * <li>FT1-20: PERFORMED BY CODE (CN) <b>optional </b>
72       * <li>FT1-21: ORDERED BY CODE (CN) <b>optional </b>
73       * <li>FT1-22: UNIT COST (NM) <b>optional </b>
74   * </ul>
75   */
76  @SuppressWarnings("unused")
77  public class FT1 extends AbstractSegment {
78  
79      /** 
80       * Creates a new FT1 segment
81       */
82      public FT1(Group parent, ModelClassFactory factory) {
83         super(parent, factory);
84         init(factory);
85      }
86  
87      private void init(ModelClassFactory factory) {
88         try {
89                                    this.add(SI.class, false, 1, 4, new Object[]{ getMessage() }, "SET ID - FINANCIAL TRANSACTION");
90                                    this.add(ST.class, false, 1, 12, new Object[]{ getMessage() }, "TRANSACTION ID");
91                                    this.add(ST.class, false, 1, 5, new Object[]{ getMessage() }, "TRANSACTION BATCH ID");
92                                    this.add(DT.class, true, 1, 8, new Object[]{ getMessage() }, "TRANSACTION DATE");
93                                    this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "TRANSACTION POSTING DATE");
94                                                this.add(ID.class, true, 1, 8, new Object[]{ getMessage(), new Integer(17) }, "TRANSACTION TYPE");
95                                                this.add(ID.class, true, 1, 20, new Object[]{ getMessage(), new Integer(96) }, "TRANSACTION CODE");
96                                    this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "TRANSACTION DESCRIPTION");
97                                    this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "TRANSACTION DESCRIPTION - ALT");
98                                    this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "TRANSACTION AMOUNT - EXTENDED");
99                                    this.add(NM.class, false, 1, 4, new Object[]{ getMessage() }, "TRANSACTION QUANTITY");
100                                   this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "TRANSACTION AMOUNT - UNIT");
101                                   this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "DEPARTMENT CODE");
102                                               this.add(ID.class, false, 1, 8, new Object[]{ getMessage(), new Integer(72) }, "INSURANCE PLAN ID");
103                                   this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "INSURANCE AMOUNT");
104                                   this.add(ST.class, false, 1, 12, new Object[]{ getMessage() }, "PATIENT LOCATION");
105                                               this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(24) }, "FEE SCHEDULE");
106                                               this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(18) }, "PATIENT TYPE");
107                                               this.add(ID.class, false, 1, 8, new Object[]{ getMessage(), new Integer(51) }, "DIAGNOSIS CODE");
108                                   this.add(CN.class, false, 1, 60, new Object[]{ getMessage() }, "PERFORMED BY CODE");
109                                   this.add(CN.class, false, 1, 60, new Object[]{ getMessage() }, "ORDERED BY CODE");
110                                   this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "UNIT COST");
111        } catch(HL7Exception e) {
112           log.error("Unexpected error creating FT1 - this is probably a bug in the source code generator.", e);
113        }
114     }
115 
116 
117 
118     /**
119      * Returns
120      * FT1-1: "SET ID - FINANCIAL TRANSACTION" - creates it if necessary
121      */
122     public SI getSETIDFINANCIALTRANSACTION() { 
123 		SI retVal = this.getTypedField(1, 0);
124 		return retVal;
125     }
126     
127     /**
128      * Returns
129      * FT1-1: "SET ID - FINANCIAL TRANSACTION" - creates it if necessary
130      */
131     public SI getFt11_SETIDFINANCIALTRANSACTION() { 
132 		SI retVal = this.getTypedField(1, 0);
133 		return retVal;
134     }
135 
136 
137 
138     /**
139      * Returns
140      * FT1-2: "TRANSACTION ID" - creates it if necessary
141      */
142     public ST getTRANSACTIONID() { 
143 		ST retVal = this.getTypedField(2, 0);
144 		return retVal;
145     }
146     
147     /**
148      * Returns
149      * FT1-2: "TRANSACTION ID" - creates it if necessary
150      */
151     public ST getFt12_TRANSACTIONID() { 
152 		ST retVal = this.getTypedField(2, 0);
153 		return retVal;
154     }
155 
156 
157 
158     /**
159      * Returns
160      * FT1-3: "TRANSACTION BATCH ID" - creates it if necessary
161      */
162     public ST getTRANSACTIONBATCHID() { 
163 		ST retVal = this.getTypedField(3, 0);
164 		return retVal;
165     }
166     
167     /**
168      * Returns
169      * FT1-3: "TRANSACTION BATCH ID" - creates it if necessary
170      */
171     public ST getFt13_TRANSACTIONBATCHID() { 
172 		ST retVal = this.getTypedField(3, 0);
173 		return retVal;
174     }
175 
176 
177 
178     /**
179      * Returns
180      * FT1-4: "TRANSACTION DATE" - creates it if necessary
181      */
182     public DT getTRANSACTIONDATE() { 
183 		DT retVal = this.getTypedField(4, 0);
184 		return retVal;
185     }
186     
187     /**
188      * Returns
189      * FT1-4: "TRANSACTION DATE" - creates it if necessary
190      */
191     public DT getFt14_TRANSACTIONDATE() { 
192 		DT retVal = this.getTypedField(4, 0);
193 		return retVal;
194     }
195 
196 
197 
198     /**
199      * Returns
200      * FT1-5: "TRANSACTION POSTING DATE" - creates it if necessary
201      */
202     public DT getTRANSACTIONPOSTINGDATE() { 
203 		DT retVal = this.getTypedField(5, 0);
204 		return retVal;
205     }
206     
207     /**
208      * Returns
209      * FT1-5: "TRANSACTION POSTING DATE" - creates it if necessary
210      */
211     public DT getFt15_TRANSACTIONPOSTINGDATE() { 
212 		DT retVal = this.getTypedField(5, 0);
213 		return retVal;
214     }
215 
216 
217 
218     /**
219      * Returns
220      * FT1-6: "TRANSACTION TYPE" - creates it if necessary
221      */
222     public ID getTRANSACTIONTYPE() { 
223 		ID retVal = this.getTypedField(6, 0);
224 		return retVal;
225     }
226     
227     /**
228      * Returns
229      * FT1-6: "TRANSACTION TYPE" - creates it if necessary
230      */
231     public ID getFt16_TRANSACTIONTYPE() { 
232 		ID retVal = this.getTypedField(6, 0);
233 		return retVal;
234     }
235 
236 
237 
238     /**
239      * Returns
240      * FT1-7: "TRANSACTION CODE" - creates it if necessary
241      */
242     public ID getTRANSACTIONCODE() { 
243 		ID retVal = this.getTypedField(7, 0);
244 		return retVal;
245     }
246     
247     /**
248      * Returns
249      * FT1-7: "TRANSACTION CODE" - creates it if necessary
250      */
251     public ID getFt17_TRANSACTIONCODE() { 
252 		ID retVal = this.getTypedField(7, 0);
253 		return retVal;
254     }
255 
256 
257 
258     /**
259      * Returns
260      * FT1-8: "TRANSACTION DESCRIPTION" - creates it if necessary
261      */
262     public ST getTRANSACTIONDESCRIPTION() { 
263 		ST retVal = this.getTypedField(8, 0);
264 		return retVal;
265     }
266     
267     /**
268      * Returns
269      * FT1-8: "TRANSACTION DESCRIPTION" - creates it if necessary
270      */
271     public ST getFt18_TRANSACTIONDESCRIPTION() { 
272 		ST retVal = this.getTypedField(8, 0);
273 		return retVal;
274     }
275 
276 
277 
278     /**
279      * Returns
280      * FT1-9: "TRANSACTION DESCRIPTION - ALT" - creates it if necessary
281      */
282     public ST getTRANSACTIONDESCRIPTIONALT() { 
283 		ST retVal = this.getTypedField(9, 0);
284 		return retVal;
285     }
286     
287     /**
288      * Returns
289      * FT1-9: "TRANSACTION DESCRIPTION - ALT" - creates it if necessary
290      */
291     public ST getFt19_TRANSACTIONDESCRIPTIONALT() { 
292 		ST retVal = this.getTypedField(9, 0);
293 		return retVal;
294     }
295 
296 
297 
298     /**
299      * Returns
300      * FT1-10: "TRANSACTION AMOUNT - EXTENDED" - creates it if necessary
301      */
302     public NM getTRANSACTIONAMOUNTEXTENDED() { 
303 		NM retVal = this.getTypedField(10, 0);
304 		return retVal;
305     }
306     
307     /**
308      * Returns
309      * FT1-10: "TRANSACTION AMOUNT - EXTENDED" - creates it if necessary
310      */
311     public NM getFt110_TRANSACTIONAMOUNTEXTENDED() { 
312 		NM retVal = this.getTypedField(10, 0);
313 		return retVal;
314     }
315 
316 
317 
318     /**
319      * Returns
320      * FT1-11: "TRANSACTION QUANTITY" - creates it if necessary
321      */
322     public NM getTRANSACTIONQUANTITY() { 
323 		NM retVal = this.getTypedField(11, 0);
324 		return retVal;
325     }
326     
327     /**
328      * Returns
329      * FT1-11: "TRANSACTION QUANTITY" - creates it if necessary
330      */
331     public NM getFt111_TRANSACTIONQUANTITY() { 
332 		NM retVal = this.getTypedField(11, 0);
333 		return retVal;
334     }
335 
336 
337 
338     /**
339      * Returns
340      * FT1-12: "TRANSACTION AMOUNT - UNIT" - creates it if necessary
341      */
342     public NM getTRANSACTIONAMOUNTUNIT() { 
343 		NM retVal = this.getTypedField(12, 0);
344 		return retVal;
345     }
346     
347     /**
348      * Returns
349      * FT1-12: "TRANSACTION AMOUNT - UNIT" - creates it if necessary
350      */
351     public NM getFt112_TRANSACTIONAMOUNTUNIT() { 
352 		NM retVal = this.getTypedField(12, 0);
353 		return retVal;
354     }
355 
356 
357 
358     /**
359      * Returns
360      * FT1-13: "DEPARTMENT CODE" - creates it if necessary
361      */
362     public ST getDEPARTMENTCODE() { 
363 		ST retVal = this.getTypedField(13, 0);
364 		return retVal;
365     }
366     
367     /**
368      * Returns
369      * FT1-13: "DEPARTMENT CODE" - creates it if necessary
370      */
371     public ST getFt113_DEPARTMENTCODE() { 
372 		ST retVal = this.getTypedField(13, 0);
373 		return retVal;
374     }
375 
376 
377 
378     /**
379      * Returns
380      * FT1-14: "INSURANCE PLAN ID" - creates it if necessary
381      */
382     public ID getINSURANCEPLANID() { 
383 		ID retVal = this.getTypedField(14, 0);
384 		return retVal;
385     }
386     
387     /**
388      * Returns
389      * FT1-14: "INSURANCE PLAN ID" - creates it if necessary
390      */
391     public ID getFt114_INSURANCEPLANID() { 
392 		ID retVal = this.getTypedField(14, 0);
393 		return retVal;
394     }
395 
396 
397 
398     /**
399      * Returns
400      * FT1-15: "INSURANCE AMOUNT" - creates it if necessary
401      */
402     public NM getINSURANCEAMOUNT() { 
403 		NM retVal = this.getTypedField(15, 0);
404 		return retVal;
405     }
406     
407     /**
408      * Returns
409      * FT1-15: "INSURANCE AMOUNT" - creates it if necessary
410      */
411     public NM getFt115_INSURANCEAMOUNT() { 
412 		NM retVal = this.getTypedField(15, 0);
413 		return retVal;
414     }
415 
416 
417 
418     /**
419      * Returns
420      * FT1-16: "PATIENT LOCATION" - creates it if necessary
421      */
422     public ST getPATIENTLOCATION() { 
423 		ST retVal = this.getTypedField(16, 0);
424 		return retVal;
425     }
426     
427     /**
428      * Returns
429      * FT1-16: "PATIENT LOCATION" - creates it if necessary
430      */
431     public ST getFt116_PATIENTLOCATION() { 
432 		ST retVal = this.getTypedField(16, 0);
433 		return retVal;
434     }
435 
436 
437 
438     /**
439      * Returns
440      * FT1-17: "FEE SCHEDULE" - creates it if necessary
441      */
442     public ID getFEESCHEDULE() { 
443 		ID retVal = this.getTypedField(17, 0);
444 		return retVal;
445     }
446     
447     /**
448      * Returns
449      * FT1-17: "FEE SCHEDULE" - creates it if necessary
450      */
451     public ID getFt117_FEESCHEDULE() { 
452 		ID retVal = this.getTypedField(17, 0);
453 		return retVal;
454     }
455 
456 
457 
458     /**
459      * Returns
460      * FT1-18: "PATIENT TYPE" - creates it if necessary
461      */
462     public ID getPATIENTTYPE() { 
463 		ID retVal = this.getTypedField(18, 0);
464 		return retVal;
465     }
466     
467     /**
468      * Returns
469      * FT1-18: "PATIENT TYPE" - creates it if necessary
470      */
471     public ID getFt118_PATIENTTYPE() { 
472 		ID retVal = this.getTypedField(18, 0);
473 		return retVal;
474     }
475 
476 
477 
478     /**
479      * Returns
480      * FT1-19: "DIAGNOSIS CODE" - creates it if necessary
481      */
482     public ID getDIAGNOSISCODE() { 
483 		ID retVal = this.getTypedField(19, 0);
484 		return retVal;
485     }
486     
487     /**
488      * Returns
489      * FT1-19: "DIAGNOSIS CODE" - creates it if necessary
490      */
491     public ID getFt119_DIAGNOSISCODE() { 
492 		ID retVal = this.getTypedField(19, 0);
493 		return retVal;
494     }
495 
496 
497 
498     /**
499      * Returns
500      * FT1-20: "PERFORMED BY CODE" - creates it if necessary
501      */
502     public CN getPERFORMEDBYCODE() { 
503 		CN retVal = this.getTypedField(20, 0);
504 		return retVal;
505     }
506     
507     /**
508      * Returns
509      * FT1-20: "PERFORMED BY CODE" - creates it if necessary
510      */
511     public CN getFt120_PERFORMEDBYCODE() { 
512 		CN retVal = this.getTypedField(20, 0);
513 		return retVal;
514     }
515 
516 
517 
518     /**
519      * Returns
520      * FT1-21: "ORDERED BY CODE" - creates it if necessary
521      */
522     public CN getORDEREDBYCODE() { 
523 		CN retVal = this.getTypedField(21, 0);
524 		return retVal;
525     }
526     
527     /**
528      * Returns
529      * FT1-21: "ORDERED BY CODE" - creates it if necessary
530      */
531     public CN getFt121_ORDEREDBYCODE() { 
532 		CN retVal = this.getTypedField(21, 0);
533 		return retVal;
534     }
535 
536 
537 
538     /**
539      * Returns
540      * FT1-22: "UNIT COST" - creates it if necessary
541      */
542     public NM getUNITCOST() { 
543 		NM retVal = this.getTypedField(22, 0);
544 		return retVal;
545     }
546     
547     /**
548      * Returns
549      * FT1-22: "UNIT COST" - creates it if necessary
550      */
551     public NM getFt122_UNITCOST() { 
552 		NM retVal = this.getTypedField(22, 0);
553 		return retVal;
554     }
555 
556 
557 
558 
559 
560     /** {@inheritDoc} */   
561     protected Type createNewTypeWithoutReflection(int field) {
562        switch (field) {
563           case 0: return new SI(getMessage());
564           case 1: return new ST(getMessage());
565           case 2: return new ST(getMessage());
566           case 3: return new DT(getMessage());
567           case 4: return new DT(getMessage());
568           case 5: return new ID(getMessage(), new Integer( 17 ));
569           case 6: return new ID(getMessage(), new Integer( 96 ));
570           case 7: return new ST(getMessage());
571           case 8: return new ST(getMessage());
572           case 9: return new NM(getMessage());
573           case 10: return new NM(getMessage());
574           case 11: return new NM(getMessage());
575           case 12: return new ST(getMessage());
576           case 13: return new ID(getMessage(), new Integer( 72 ));
577           case 14: return new NM(getMessage());
578           case 15: return new ST(getMessage());
579           case 16: return new ID(getMessage(), new Integer( 24 ));
580           case 17: return new ID(getMessage(), new Integer( 18 ));
581           case 18: return new ID(getMessage(), new Integer( 51 ));
582           case 19: return new CN(getMessage());
583           case 20: return new CN(getMessage());
584           case 21: return new NM(getMessage());
585           default: return null;
586        }
587    }
588 
589 
590 }
591