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