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