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.v23.segment;
035
036// import ca.uhn.hl7v2.model.v23.group.*;
037import ca.uhn.hl7v2.model.v23.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/**
049 *<p>Represents an HL7 FT1 message segment (Financial transaction). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>FT1-1: Set ID - Financial Transaction (SI) <b>optional </b>
053     * <li>FT1-2: Transaction ID (ST) <b>optional </b>
054     * <li>FT1-3: Transaction Batch ID (ST) <b>optional </b>
055     * <li>FT1-4: Transaction Date (TS) <b> </b>
056     * <li>FT1-5: Transaction Posting Date (TS) <b>optional </b>
057     * <li>FT1-6: Transaction Type (ID) <b> </b>
058     * <li>FT1-7: Transaction Code (CE) <b> </b>
059     * <li>FT1-8: Transaction Description (ST) <b>optional </b>
060     * <li>FT1-9: Transaction Description - alternate (ST) <b>optional </b>
061     * <li>FT1-10: Transaction Quantity (NM) <b>optional </b>
062     * <li>FT1-11: Transaction Amount - Extended (CP) <b>optional </b>
063     * <li>FT1-12: Transaction Amount - Unit (CP) <b>optional </b>
064     * <li>FT1-13: Department Code (CE) <b>optional </b>
065     * <li>FT1-14: Insurance Plan ID (CE) <b>optional </b>
066     * <li>FT1-15: Insurance Amount (CP) <b>optional </b>
067     * <li>FT1-16: Assigned Patient Location (PL) <b>optional </b>
068     * <li>FT1-17: Fee Schedule (ID) <b>optional </b>
069     * <li>FT1-18: Patient Type (ID) <b>optional </b>
070     * <li>FT1-19: Diagnosis Code (CE) <b>optional repeating</b>
071     * <li>FT1-20: Performed By Code (XCN) <b>optional </b>
072     * <li>FT1-21: Ordered By Code (XCN) <b>optional </b>
073     * <li>FT1-22: Unit Cost (NM) <b>optional </b>
074     * <li>FT1-23: Filler Order Number (EI) <b>optional </b>
075     * <li>FT1-24: Entered By Code (XCN) <b>optional </b>
076     * <li>FT1-25: Procedure Code (CE) <b>optional </b>
077 * </ul>
078 */
079@SuppressWarnings("unused")
080public class FT1 extends AbstractSegment {
081
082    /** 
083     * Creates a new FT1 segment
084     */
085    public FT1(Group parent, ModelClassFactory factory) {
086       super(parent, factory);
087       init(factory);
088    }
089
090    private void init(ModelClassFactory factory) {
091       try {
092                                  this.add(SI.class, false, 1, 4, new Object[]{ getMessage() }, "Set ID - Financial Transaction");
093                                  this.add(ST.class, false, 1, 12, new Object[]{ getMessage() }, "Transaction ID");
094                                  this.add(ST.class, false, 1, 10, new Object[]{ getMessage() }, "Transaction Batch ID");
095                                  this.add(TS.class, true, 1, 26, new Object[]{ getMessage() }, "Transaction Date");
096                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Transaction Posting Date");
097                                              this.add(ID.class, true, 1, 8, new Object[]{ getMessage(), new Integer(17) }, "Transaction Type");
098                                  this.add(CE.class, true, 1, 80, new Object[]{ getMessage() }, "Transaction Code");
099                                  this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Transaction Description");
100                                  this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Transaction Description - alternate");
101                                  this.add(NM.class, false, 1, 6, new Object[]{ getMessage() }, "Transaction Quantity");
102                                  this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Transaction Amount - Extended");
103                                  this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Transaction Amount - Unit");
104                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Department Code");
105                                  this.add(CE.class, false, 1, 8, new Object[]{ getMessage() }, "Insurance Plan ID");
106                                  this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Insurance Amount");
107                                  this.add(PL.class, false, 1, 12, new Object[]{ getMessage() }, "Assigned Patient Location");
108                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(24) }, "Fee Schedule");
109                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(18) }, "Patient Type");
110                                  this.add(CE.class, false, 0, 60, new Object[]{ getMessage() }, "Diagnosis Code");
111                                  this.add(XCN.class, false, 1, 120, new Object[]{ getMessage() }, "Performed By Code");
112                                  this.add(XCN.class, false, 1, 120, new Object[]{ getMessage() }, "Ordered By Code");
113                                  this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "Unit Cost");
114                                  this.add(EI.class, false, 1, 22, new Object[]{ getMessage() }, "Filler Order Number");
115                                  this.add(XCN.class, false, 1, 120, new Object[]{ getMessage() }, "Entered By Code");
116                                  this.add(CE.class, false, 1, 80, new Object[]{ getMessage() }, "Procedure Code");
117       } catch(HL7Exception e) {
118          log.error("Unexpected error creating FT1 - this is probably a bug in the source code generator.", e);
119       }
120    }
121
122
123
124    /**
125     * Returns
126     * FT1-1: "Set ID - Financial Transaction" - creates it if necessary
127     */
128    public SI getSetIDFinancialTransaction() { 
129                SI retVal = this.getTypedField(1, 0);
130                return retVal;
131    }
132    
133    /**
134     * Returns
135     * FT1-1: "Set ID - Financial Transaction" - creates it if necessary
136     */
137    public SI getFt11_SetIDFinancialTransaction() { 
138                SI retVal = this.getTypedField(1, 0);
139                return retVal;
140    }
141
142
143
144    /**
145     * Returns
146     * FT1-2: "Transaction ID" - creates it if necessary
147     */
148    public ST getTransactionID() { 
149                ST retVal = this.getTypedField(2, 0);
150                return retVal;
151    }
152    
153    /**
154     * Returns
155     * FT1-2: "Transaction ID" - creates it if necessary
156     */
157    public ST getFt12_TransactionID() { 
158                ST retVal = this.getTypedField(2, 0);
159                return retVal;
160    }
161
162
163
164    /**
165     * Returns
166     * FT1-3: "Transaction Batch ID" - creates it if necessary
167     */
168    public ST getTransactionBatchID() { 
169                ST retVal = this.getTypedField(3, 0);
170                return retVal;
171    }
172    
173    /**
174     * Returns
175     * FT1-3: "Transaction Batch ID" - creates it if necessary
176     */
177    public ST getFt13_TransactionBatchID() { 
178                ST retVal = this.getTypedField(3, 0);
179                return retVal;
180    }
181
182
183
184    /**
185     * Returns
186     * FT1-4: "Transaction Date" - creates it if necessary
187     */
188    public TS getTransactionDate() { 
189                TS retVal = this.getTypedField(4, 0);
190                return retVal;
191    }
192    
193    /**
194     * Returns
195     * FT1-4: "Transaction Date" - creates it if necessary
196     */
197    public TS getFt14_TransactionDate() { 
198                TS retVal = this.getTypedField(4, 0);
199                return retVal;
200    }
201
202
203
204    /**
205     * Returns
206     * FT1-5: "Transaction Posting Date" - creates it if necessary
207     */
208    public TS getTransactionPostingDate() { 
209                TS retVal = this.getTypedField(5, 0);
210                return retVal;
211    }
212    
213    /**
214     * Returns
215     * FT1-5: "Transaction Posting Date" - creates it if necessary
216     */
217    public TS getFt15_TransactionPostingDate() { 
218                TS retVal = this.getTypedField(5, 0);
219                return retVal;
220    }
221
222
223
224    /**
225     * Returns
226     * FT1-6: "Transaction Type" - creates it if necessary
227     */
228    public ID getTransactionType() { 
229                ID retVal = this.getTypedField(6, 0);
230                return retVal;
231    }
232    
233    /**
234     * Returns
235     * FT1-6: "Transaction Type" - creates it if necessary
236     */
237    public ID getFt16_TransactionType() { 
238                ID retVal = this.getTypedField(6, 0);
239                return retVal;
240    }
241
242
243
244    /**
245     * Returns
246     * FT1-7: "Transaction Code" - creates it if necessary
247     */
248    public CE getTransactionCode() { 
249                CE retVal = this.getTypedField(7, 0);
250                return retVal;
251    }
252    
253    /**
254     * Returns
255     * FT1-7: "Transaction Code" - creates it if necessary
256     */
257    public CE getFt17_TransactionCode() { 
258                CE retVal = this.getTypedField(7, 0);
259                return retVal;
260    }
261
262
263
264    /**
265     * Returns
266     * FT1-8: "Transaction Description" - creates it if necessary
267     */
268    public ST getTransactionDescription() { 
269                ST retVal = this.getTypedField(8, 0);
270                return retVal;
271    }
272    
273    /**
274     * Returns
275     * FT1-8: "Transaction Description" - creates it if necessary
276     */
277    public ST getFt18_TransactionDescription() { 
278                ST retVal = this.getTypedField(8, 0);
279                return retVal;
280    }
281
282
283
284    /**
285     * Returns
286     * FT1-9: "Transaction Description - alternate" - creates it if necessary
287     */
288    public ST getTransactionDescriptionAlternate() { 
289                ST retVal = this.getTypedField(9, 0);
290                return retVal;
291    }
292    
293    /**
294     * Returns
295     * FT1-9: "Transaction Description - alternate" - creates it if necessary
296     */
297    public ST getFt19_TransactionDescriptionAlternate() { 
298                ST retVal = this.getTypedField(9, 0);
299                return retVal;
300    }
301
302
303
304    /**
305     * Returns
306     * FT1-10: "Transaction Quantity" - creates it if necessary
307     */
308    public NM getTransactionQuantity() { 
309                NM retVal = this.getTypedField(10, 0);
310                return retVal;
311    }
312    
313    /**
314     * Returns
315     * FT1-10: "Transaction Quantity" - creates it if necessary
316     */
317    public NM getFt110_TransactionQuantity() { 
318                NM retVal = this.getTypedField(10, 0);
319                return retVal;
320    }
321
322
323
324    /**
325     * Returns
326     * FT1-11: "Transaction Amount - Extended" - creates it if necessary
327     */
328    public CP getTransactionAmountExtended() { 
329                CP retVal = this.getTypedField(11, 0);
330                return retVal;
331    }
332    
333    /**
334     * Returns
335     * FT1-11: "Transaction Amount - Extended" - creates it if necessary
336     */
337    public CP getFt111_TransactionAmountExtended() { 
338                CP retVal = this.getTypedField(11, 0);
339                return retVal;
340    }
341
342
343
344    /**
345     * Returns
346     * FT1-12: "Transaction Amount - Unit" - creates it if necessary
347     */
348    public CP getTransactionAmountUnit() { 
349                CP retVal = this.getTypedField(12, 0);
350                return retVal;
351    }
352    
353    /**
354     * Returns
355     * FT1-12: "Transaction Amount - Unit" - creates it if necessary
356     */
357    public CP getFt112_TransactionAmountUnit() { 
358                CP retVal = this.getTypedField(12, 0);
359                return retVal;
360    }
361
362
363
364    /**
365     * Returns
366     * FT1-13: "Department Code" - creates it if necessary
367     */
368    public CE getDepartmentCode() { 
369                CE retVal = this.getTypedField(13, 0);
370                return retVal;
371    }
372    
373    /**
374     * Returns
375     * FT1-13: "Department Code" - creates it if necessary
376     */
377    public CE getFt113_DepartmentCode() { 
378                CE retVal = this.getTypedField(13, 0);
379                return retVal;
380    }
381
382
383
384    /**
385     * Returns
386     * FT1-14: "Insurance Plan ID" - creates it if necessary
387     */
388    public CE getInsurancePlanID() { 
389                CE retVal = this.getTypedField(14, 0);
390                return retVal;
391    }
392    
393    /**
394     * Returns
395     * FT1-14: "Insurance Plan ID" - creates it if necessary
396     */
397    public CE getFt114_InsurancePlanID() { 
398                CE retVal = this.getTypedField(14, 0);
399                return retVal;
400    }
401
402
403
404    /**
405     * Returns
406     * FT1-15: "Insurance Amount" - creates it if necessary
407     */
408    public CP getInsuranceAmount() { 
409                CP retVal = this.getTypedField(15, 0);
410                return retVal;
411    }
412    
413    /**
414     * Returns
415     * FT1-15: "Insurance Amount" - creates it if necessary
416     */
417    public CP getFt115_InsuranceAmount() { 
418                CP retVal = this.getTypedField(15, 0);
419                return retVal;
420    }
421
422
423
424    /**
425     * Returns
426     * FT1-16: "Assigned Patient Location" - creates it if necessary
427     */
428    public PL getAssignedPatientLocation() { 
429                PL retVal = this.getTypedField(16, 0);
430                return retVal;
431    }
432    
433    /**
434     * Returns
435     * FT1-16: "Assigned Patient Location" - creates it if necessary
436     */
437    public PL getFt116_AssignedPatientLocation() { 
438                PL retVal = this.getTypedField(16, 0);
439                return retVal;
440    }
441
442
443
444    /**
445     * Returns
446     * FT1-17: "Fee Schedule" - creates it if necessary
447     */
448    public ID getFeeSchedule() { 
449                ID retVal = this.getTypedField(17, 0);
450                return retVal;
451    }
452    
453    /**
454     * Returns
455     * FT1-17: "Fee Schedule" - creates it if necessary
456     */
457    public ID getFt117_FeeSchedule() { 
458                ID retVal = this.getTypedField(17, 0);
459                return retVal;
460    }
461
462
463
464    /**
465     * Returns
466     * FT1-18: "Patient Type" - creates it if necessary
467     */
468    public ID getPatientType() { 
469                ID retVal = this.getTypedField(18, 0);
470                return retVal;
471    }
472    
473    /**
474     * Returns
475     * FT1-18: "Patient Type" - creates it if necessary
476     */
477    public ID getFt118_PatientType() { 
478                ID retVal = this.getTypedField(18, 0);
479                return retVal;
480    }
481
482
483    /**
484     * Returns all repetitions of Diagnosis Code (FT1-19).
485     */
486    public CE[] getDiagnosisCode() {
487        CE[] retVal = this.getTypedField(19, new CE[0]);
488        return retVal;
489    }
490
491
492    /**
493     * Returns all repetitions of Diagnosis Code (FT1-19).
494     */
495    public CE[] getFt119_DiagnosisCode() {
496        CE[] retVal = this.getTypedField(19, new CE[0]);
497        return retVal;
498    }
499
500
501    /**
502     * Returns a count of the current number of repetitions of Diagnosis Code (FT1-19).
503     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
504     * it will return zero.
505     */
506    public int getDiagnosisCodeReps() {
507        return this.getReps(19);
508    }
509
510
511    /**
512     * Returns a specific repetition of
513     * FT1-19: "Diagnosis Code" - creates it if necessary
514     *
515     * @param rep The repetition index (0-indexed)
516     */
517    public CE getDiagnosisCode(int rep) { 
518                CE retVal = this.getTypedField(19, rep);
519                return retVal;
520    }
521
522    /**
523     * Returns a specific repetition of
524     * FT1-19: "Diagnosis Code" - creates it if necessary
525     *
526     * @param rep The repetition index (0-indexed)
527     */
528    public CE getFt119_DiagnosisCode(int rep) { 
529                CE retVal = this.getTypedField(19, rep);
530                return retVal;
531    }
532
533    /**
534     * Returns a count of the current number of repetitions of Diagnosis Code (FT1-19).
535     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
536     * it will return zero.
537     */
538    public int getFt119_DiagnosisCodeReps() {
539        return this.getReps(19);
540    }
541
542
543    /**
544     * Inserts a repetition of
545     * FT1-19: "Diagnosis Code" at a specific index
546     *
547     * @param rep The repetition index (0-indexed)
548     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
549     */
550    public CE insertDiagnosisCode(int rep) throws HL7Exception { 
551        return (CE) super.insertRepetition(19, rep);
552    }
553
554
555    /**
556     * Inserts a repetition of
557     * FT1-19: "Diagnosis Code" at a specific index
558     *
559     * @param rep The repetition index (0-indexed)
560     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
561     */
562    public CE insertFt119_DiagnosisCode(int rep) throws HL7Exception { 
563        return (CE) super.insertRepetition(19, rep);
564    }
565
566
567    /**
568     * Removes a repetition of
569     * FT1-19: "Diagnosis Code" at a specific index
570     *
571     * @param rep The repetition index (0-indexed)
572     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
573     */
574    public CE removeDiagnosisCode(int rep) throws HL7Exception { 
575        return (CE) super.removeRepetition(19, rep);
576    }
577
578
579    /**
580     * Removes a repetition of
581     * FT1-19: "Diagnosis Code" at a specific index
582     *
583     * @param rep The repetition index (0-indexed)
584     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
585     */
586    public CE removeFt119_DiagnosisCode(int rep) throws HL7Exception { 
587        return (CE) super.removeRepetition(19, rep);
588    }
589
590
591
592
593    /**
594     * Returns
595     * FT1-20: "Performed By Code" - creates it if necessary
596     */
597    public XCN getPerformedByCode() { 
598                XCN retVal = this.getTypedField(20, 0);
599                return retVal;
600    }
601    
602    /**
603     * Returns
604     * FT1-20: "Performed By Code" - creates it if necessary
605     */
606    public XCN getFt120_PerformedByCode() { 
607                XCN retVal = this.getTypedField(20, 0);
608                return retVal;
609    }
610
611
612
613    /**
614     * Returns
615     * FT1-21: "Ordered By Code" - creates it if necessary
616     */
617    public XCN getOrderedByCode() { 
618                XCN retVal = this.getTypedField(21, 0);
619                return retVal;
620    }
621    
622    /**
623     * Returns
624     * FT1-21: "Ordered By Code" - creates it if necessary
625     */
626    public XCN getFt121_OrderedByCode() { 
627                XCN retVal = this.getTypedField(21, 0);
628                return retVal;
629    }
630
631
632
633    /**
634     * Returns
635     * FT1-22: "Unit Cost" - creates it if necessary
636     */
637    public NM getUnitCost() { 
638                NM retVal = this.getTypedField(22, 0);
639                return retVal;
640    }
641    
642    /**
643     * Returns
644     * FT1-22: "Unit Cost" - creates it if necessary
645     */
646    public NM getFt122_UnitCost() { 
647                NM retVal = this.getTypedField(22, 0);
648                return retVal;
649    }
650
651
652
653    /**
654     * Returns
655     * FT1-23: "Filler Order Number" - creates it if necessary
656     */
657    public EI getFillerOrderNumber() { 
658                EI retVal = this.getTypedField(23, 0);
659                return retVal;
660    }
661    
662    /**
663     * Returns
664     * FT1-23: "Filler Order Number" - creates it if necessary
665     */
666    public EI getFt123_FillerOrderNumber() { 
667                EI retVal = this.getTypedField(23, 0);
668                return retVal;
669    }
670
671
672
673    /**
674     * Returns
675     * FT1-24: "Entered By Code" - creates it if necessary
676     */
677    public XCN getEnteredByCode() { 
678                XCN retVal = this.getTypedField(24, 0);
679                return retVal;
680    }
681    
682    /**
683     * Returns
684     * FT1-24: "Entered By Code" - creates it if necessary
685     */
686    public XCN getFt124_EnteredByCode() { 
687                XCN retVal = this.getTypedField(24, 0);
688                return retVal;
689    }
690
691
692
693    /**
694     * Returns
695     * FT1-25: "Procedure Code" - creates it if necessary
696     */
697    public CE getProcedureCode() { 
698                CE retVal = this.getTypedField(25, 0);
699                return retVal;
700    }
701    
702    /**
703     * Returns
704     * FT1-25: "Procedure Code" - creates it if necessary
705     */
706    public CE getFt125_ProcedureCode() { 
707                CE retVal = this.getTypedField(25, 0);
708                return retVal;
709    }
710
711
712
713
714
715    /** {@inheritDoc} */   
716    protected Type createNewTypeWithoutReflection(int field) {
717       switch (field) {
718          case 0: return new SI(getMessage());
719          case 1: return new ST(getMessage());
720          case 2: return new ST(getMessage());
721          case 3: return new TS(getMessage());
722          case 4: return new TS(getMessage());
723          case 5: return new ID(getMessage(), new Integer( 17 ));
724          case 6: return new CE(getMessage());
725          case 7: return new ST(getMessage());
726          case 8: return new ST(getMessage());
727          case 9: return new NM(getMessage());
728          case 10: return new CP(getMessage());
729          case 11: return new CP(getMessage());
730          case 12: return new CE(getMessage());
731          case 13: return new CE(getMessage());
732          case 14: return new CP(getMessage());
733          case 15: return new PL(getMessage());
734          case 16: return new ID(getMessage(), new Integer( 24 ));
735          case 17: return new ID(getMessage(), new Integer( 18 ));
736          case 18: return new CE(getMessage());
737          case 19: return new XCN(getMessage());
738          case 20: return new XCN(getMessage());
739          case 21: return new NM(getMessage());
740          case 22: return new EI(getMessage());
741          case 23: return new XCN(getMessage());
742          case 24: return new CE(getMessage());
743          default: return null;
744       }
745   }
746
747
748}
749