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