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.v27.segment; 035 036// import ca.uhn.hl7v2.model.v27.group.*; 037import ca.uhn.hl7v2.model.v27.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 BTX message segment (Blood Product Transfusion/Disposition). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>BTX-1: Set ID - BTX (SI) <b> </b> 053 * <li>BTX-2: BC Donation ID (EI) <b>optional </b> 054 * <li>BTX-3: BC Component (CNE) <b>optional </b> 055 * <li>BTX-4: BC Blood Group (CNE) <b>optional </b> 056 * <li>BTX-5: CP Commercial Product (CWE) <b>optional </b> 057 * <li>BTX-6: CP Manufacturer (XON) <b>optional </b> 058 * <li>BTX-7: CP Lot Number (EI) <b>optional </b> 059 * <li>BTX-8: BP Quantity (NM) <b> </b> 060 * <li>BTX-9: BP Amount (NM) <b>optional </b> 061 * <li>BTX-10: BP Units (CWE) <b>optional </b> 062 * <li>BTX-11: BP Transfusion/Disposition Status (CWE) <b> </b> 063 * <li>BTX-12: BP Message Status (ID) <b> </b> 064 * <li>BTX-13: BP Date/Time of Status (DTM) <b> </b> 065 * <li>BTX-14: BP Transfusion Administrator (XCN) <b>optional </b> 066 * <li>BTX-15: BP Transfusion Verifier (XCN) <b>optional </b> 067 * <li>BTX-16: BP Transfusion Start Date/Time of Status (DTM) <b>optional </b> 068 * <li>BTX-17: BP Transfusion End Date/Time of Status (DTM) <b>optional </b> 069 * <li>BTX-18: BP Adverse Reaction Type (CWE) <b>optional repeating</b> 070 * <li>BTX-19: BP Transfusion Interrupted Reason (CWE) <b>optional </b> 071 * </ul> 072 */ 073@SuppressWarnings("unused") 074public class BTX extends AbstractSegment { 075 076 /** 077 * Creates a new BTX segment 078 */ 079 public BTX(Group parent, ModelClassFactory factory) { 080 super(parent, factory); 081 init(factory); 082 } 083 084 private void init(ModelClassFactory factory) { 085 try { 086 this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - BTX"); 087 this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "BC Donation ID"); 088 this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "BC Component"); 089 this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "BC Blood Group"); 090 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "CP Commercial Product"); 091 this.add(XON.class, false, 1, 0, new Object[]{ getMessage() }, "CP Manufacturer"); 092 this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "CP Lot Number"); 093 this.add(NM.class, true, 1, 0, new Object[]{ getMessage() }, "BP Quantity"); 094 this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "BP Amount"); 095 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "BP Units"); 096 this.add(CWE.class, true, 1, 0, new Object[]{ getMessage() }, "BP Transfusion/Disposition Status"); 097 this.add(ID.class, true, 1, 1, new Object[]{ getMessage(), new Integer(511) }, "BP Message Status"); 098 this.add(DTM.class, true, 1, 0, new Object[]{ getMessage() }, "BP Date/Time of Status"); 099 this.add(XCN.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Administrator"); 100 this.add(XCN.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Verifier"); 101 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Start Date/Time of Status"); 102 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion End Date/Time of Status"); 103 this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "BP Adverse Reaction Type"); 104 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Interrupted Reason"); 105 } catch(HL7Exception e) { 106 log.error("Unexpected error creating BTX - this is probably a bug in the source code generator.", e); 107 } 108 } 109 110 111 112 /** 113 * Returns 114 * BTX-1: "Set ID - BTX" - creates it if necessary 115 */ 116 public SI getSetIDBTX() { 117 SI retVal = this.getTypedField(1, 0); 118 return retVal; 119 } 120 121 /** 122 * Returns 123 * BTX-1: "Set ID - BTX" - creates it if necessary 124 */ 125 public SI getBtx1_SetIDBTX() { 126 SI retVal = this.getTypedField(1, 0); 127 return retVal; 128 } 129 130 131 132 /** 133 * Returns 134 * BTX-2: "BC Donation ID" - creates it if necessary 135 */ 136 public EI getBCDonationID() { 137 EI retVal = this.getTypedField(2, 0); 138 return retVal; 139 } 140 141 /** 142 * Returns 143 * BTX-2: "BC Donation ID" - creates it if necessary 144 */ 145 public EI getBtx2_BCDonationID() { 146 EI retVal = this.getTypedField(2, 0); 147 return retVal; 148 } 149 150 151 152 /** 153 * Returns 154 * BTX-3: "BC Component" - creates it if necessary 155 */ 156 public CNE getBCComponent() { 157 CNE retVal = this.getTypedField(3, 0); 158 return retVal; 159 } 160 161 /** 162 * Returns 163 * BTX-3: "BC Component" - creates it if necessary 164 */ 165 public CNE getBtx3_BCComponent() { 166 CNE retVal = this.getTypedField(3, 0); 167 return retVal; 168 } 169 170 171 172 /** 173 * Returns 174 * BTX-4: "BC Blood Group" - creates it if necessary 175 */ 176 public CNE getBCBloodGroup() { 177 CNE retVal = this.getTypedField(4, 0); 178 return retVal; 179 } 180 181 /** 182 * Returns 183 * BTX-4: "BC Blood Group" - creates it if necessary 184 */ 185 public CNE getBtx4_BCBloodGroup() { 186 CNE retVal = this.getTypedField(4, 0); 187 return retVal; 188 } 189 190 191 192 /** 193 * Returns 194 * BTX-5: "CP Commercial Product" - creates it if necessary 195 */ 196 public CWE getCPCommercialProduct() { 197 CWE retVal = this.getTypedField(5, 0); 198 return retVal; 199 } 200 201 /** 202 * Returns 203 * BTX-5: "CP Commercial Product" - creates it if necessary 204 */ 205 public CWE getBtx5_CPCommercialProduct() { 206 CWE retVal = this.getTypedField(5, 0); 207 return retVal; 208 } 209 210 211 212 /** 213 * Returns 214 * BTX-6: "CP Manufacturer" - creates it if necessary 215 */ 216 public XON getCPManufacturer() { 217 XON retVal = this.getTypedField(6, 0); 218 return retVal; 219 } 220 221 /** 222 * Returns 223 * BTX-6: "CP Manufacturer" - creates it if necessary 224 */ 225 public XON getBtx6_CPManufacturer() { 226 XON retVal = this.getTypedField(6, 0); 227 return retVal; 228 } 229 230 231 232 /** 233 * Returns 234 * BTX-7: "CP Lot Number" - creates it if necessary 235 */ 236 public EI getCPLotNumber() { 237 EI retVal = this.getTypedField(7, 0); 238 return retVal; 239 } 240 241 /** 242 * Returns 243 * BTX-7: "CP Lot Number" - creates it if necessary 244 */ 245 public EI getBtx7_CPLotNumber() { 246 EI retVal = this.getTypedField(7, 0); 247 return retVal; 248 } 249 250 251 252 /** 253 * Returns 254 * BTX-8: "BP Quantity" - creates it if necessary 255 */ 256 public NM getBPQuantity() { 257 NM retVal = this.getTypedField(8, 0); 258 return retVal; 259 } 260 261 /** 262 * Returns 263 * BTX-8: "BP Quantity" - creates it if necessary 264 */ 265 public NM getBtx8_BPQuantity() { 266 NM retVal = this.getTypedField(8, 0); 267 return retVal; 268 } 269 270 271 272 /** 273 * Returns 274 * BTX-9: "BP Amount" - creates it if necessary 275 */ 276 public NM getBPAmount() { 277 NM retVal = this.getTypedField(9, 0); 278 return retVal; 279 } 280 281 /** 282 * Returns 283 * BTX-9: "BP Amount" - creates it if necessary 284 */ 285 public NM getBtx9_BPAmount() { 286 NM retVal = this.getTypedField(9, 0); 287 return retVal; 288 } 289 290 291 292 /** 293 * Returns 294 * BTX-10: "BP Units" - creates it if necessary 295 */ 296 public CWE getBPUnits() { 297 CWE retVal = this.getTypedField(10, 0); 298 return retVal; 299 } 300 301 /** 302 * Returns 303 * BTX-10: "BP Units" - creates it if necessary 304 */ 305 public CWE getBtx10_BPUnits() { 306 CWE retVal = this.getTypedField(10, 0); 307 return retVal; 308 } 309 310 311 312 /** 313 * Returns 314 * BTX-11: "BP Transfusion/Disposition Status" - creates it if necessary 315 */ 316 public CWE getBPTransfusionDispositionStatus() { 317 CWE retVal = this.getTypedField(11, 0); 318 return retVal; 319 } 320 321 /** 322 * Returns 323 * BTX-11: "BP Transfusion/Disposition Status" - creates it if necessary 324 */ 325 public CWE getBtx11_BPTransfusionDispositionStatus() { 326 CWE retVal = this.getTypedField(11, 0); 327 return retVal; 328 } 329 330 331 332 /** 333 * Returns 334 * BTX-12: "BP Message Status" - creates it if necessary 335 */ 336 public ID getBPMessageStatus() { 337 ID retVal = this.getTypedField(12, 0); 338 return retVal; 339 } 340 341 /** 342 * Returns 343 * BTX-12: "BP Message Status" - creates it if necessary 344 */ 345 public ID getBtx12_BPMessageStatus() { 346 ID retVal = this.getTypedField(12, 0); 347 return retVal; 348 } 349 350 351 352 /** 353 * Returns 354 * BTX-13: "BP Date/Time of Status" - creates it if necessary 355 */ 356 public DTM getBPDateTimeOfStatus() { 357 DTM retVal = this.getTypedField(13, 0); 358 return retVal; 359 } 360 361 /** 362 * Returns 363 * BTX-13: "BP Date/Time of Status" - creates it if necessary 364 */ 365 public DTM getBtx13_BPDateTimeOfStatus() { 366 DTM retVal = this.getTypedField(13, 0); 367 return retVal; 368 } 369 370 371 372 /** 373 * Returns 374 * BTX-14: "BP Transfusion Administrator" - creates it if necessary 375 */ 376 public XCN getBPTransfusionAdministrator() { 377 XCN retVal = this.getTypedField(14, 0); 378 return retVal; 379 } 380 381 /** 382 * Returns 383 * BTX-14: "BP Transfusion Administrator" - creates it if necessary 384 */ 385 public XCN getBtx14_BPTransfusionAdministrator() { 386 XCN retVal = this.getTypedField(14, 0); 387 return retVal; 388 } 389 390 391 392 /** 393 * Returns 394 * BTX-15: "BP Transfusion Verifier" - creates it if necessary 395 */ 396 public XCN getBPTransfusionVerifier() { 397 XCN retVal = this.getTypedField(15, 0); 398 return retVal; 399 } 400 401 /** 402 * Returns 403 * BTX-15: "BP Transfusion Verifier" - creates it if necessary 404 */ 405 public XCN getBtx15_BPTransfusionVerifier() { 406 XCN retVal = this.getTypedField(15, 0); 407 return retVal; 408 } 409 410 411 412 /** 413 * Returns 414 * BTX-16: "BP Transfusion Start Date/Time of Status" - creates it if necessary 415 */ 416 public DTM getBPTransfusionStartDateTimeOfStatus() { 417 DTM retVal = this.getTypedField(16, 0); 418 return retVal; 419 } 420 421 /** 422 * Returns 423 * BTX-16: "BP Transfusion Start Date/Time of Status" - creates it if necessary 424 */ 425 public DTM getBtx16_BPTransfusionStartDateTimeOfStatus() { 426 DTM retVal = this.getTypedField(16, 0); 427 return retVal; 428 } 429 430 431 432 /** 433 * Returns 434 * BTX-17: "BP Transfusion End Date/Time of Status" - creates it if necessary 435 */ 436 public DTM getBPTransfusionEndDateTimeOfStatus() { 437 DTM retVal = this.getTypedField(17, 0); 438 return retVal; 439 } 440 441 /** 442 * Returns 443 * BTX-17: "BP Transfusion End Date/Time of Status" - creates it if necessary 444 */ 445 public DTM getBtx17_BPTransfusionEndDateTimeOfStatus() { 446 DTM retVal = this.getTypedField(17, 0); 447 return retVal; 448 } 449 450 451 /** 452 * Returns all repetitions of BP Adverse Reaction Type (BTX-18). 453 */ 454 public CWE[] getBPAdverseReactionType() { 455 CWE[] retVal = this.getTypedField(18, new CWE[0]); 456 return retVal; 457 } 458 459 460 /** 461 * Returns all repetitions of BP Adverse Reaction Type (BTX-18). 462 */ 463 public CWE[] getBtx18_BPAdverseReactionType() { 464 CWE[] retVal = this.getTypedField(18, new CWE[0]); 465 return retVal; 466 } 467 468 469 /** 470 * Returns a count of the current number of repetitions of BP Adverse Reaction Type (BTX-18). 471 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 472 * it will return zero. 473 */ 474 public int getBPAdverseReactionTypeReps() { 475 return this.getReps(18); 476 } 477 478 479 /** 480 * Returns a specific repetition of 481 * BTX-18: "BP Adverse Reaction Type" - creates it if necessary 482 * 483 * @param rep The repetition index (0-indexed) 484 */ 485 public CWE getBPAdverseReactionType(int rep) { 486 CWE retVal = this.getTypedField(18, rep); 487 return retVal; 488 } 489 490 /** 491 * Returns a specific repetition of 492 * BTX-18: "BP Adverse Reaction Type" - creates it if necessary 493 * 494 * @param rep The repetition index (0-indexed) 495 */ 496 public CWE getBtx18_BPAdverseReactionType(int rep) { 497 CWE retVal = this.getTypedField(18, rep); 498 return retVal; 499 } 500 501 /** 502 * Returns a count of the current number of repetitions of BP Adverse Reaction Type (BTX-18). 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 getBtx18_BPAdverseReactionTypeReps() { 507 return this.getReps(18); 508 } 509 510 511 /** 512 * Inserts a repetition of 513 * BTX-18: "BP Adverse Reaction Type" at a specific index 514 * 515 * @param rep The repetition index (0-indexed) 516 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 517 */ 518 public CWE insertBPAdverseReactionType(int rep) throws HL7Exception { 519 return (CWE) super.insertRepetition(18, rep); 520 } 521 522 523 /** 524 * Inserts a repetition of 525 * BTX-18: "BP Adverse Reaction Type" at a specific index 526 * 527 * @param rep The repetition index (0-indexed) 528 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 529 */ 530 public CWE insertBtx18_BPAdverseReactionType(int rep) throws HL7Exception { 531 return (CWE) super.insertRepetition(18, rep); 532 } 533 534 535 /** 536 * Removes a repetition of 537 * BTX-18: "BP Adverse Reaction Type" at a specific index 538 * 539 * @param rep The repetition index (0-indexed) 540 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 541 */ 542 public CWE removeBPAdverseReactionType(int rep) throws HL7Exception { 543 return (CWE) super.removeRepetition(18, rep); 544 } 545 546 547 /** 548 * Removes a repetition of 549 * BTX-18: "BP Adverse Reaction Type" at a specific index 550 * 551 * @param rep The repetition index (0-indexed) 552 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 553 */ 554 public CWE removeBtx18_BPAdverseReactionType(int rep) throws HL7Exception { 555 return (CWE) super.removeRepetition(18, rep); 556 } 557 558 559 560 561 /** 562 * Returns 563 * BTX-19: "BP Transfusion Interrupted Reason" - creates it if necessary 564 */ 565 public CWE getBPTransfusionInterruptedReason() { 566 CWE retVal = this.getTypedField(19, 0); 567 return retVal; 568 } 569 570 /** 571 * Returns 572 * BTX-19: "BP Transfusion Interrupted Reason" - creates it if necessary 573 */ 574 public CWE getBtx19_BPTransfusionInterruptedReason() { 575 CWE retVal = this.getTypedField(19, 0); 576 return retVal; 577 } 578 579 580 581 582 583 /** {@inheritDoc} */ 584 protected Type createNewTypeWithoutReflection(int field) { 585 switch (field) { 586 case 0: return new SI(getMessage()); 587 case 1: return new EI(getMessage()); 588 case 2: return new CNE(getMessage()); 589 case 3: return new CNE(getMessage()); 590 case 4: return new CWE(getMessage()); 591 case 5: return new XON(getMessage()); 592 case 6: return new EI(getMessage()); 593 case 7: return new NM(getMessage()); 594 case 8: return new NM(getMessage()); 595 case 9: return new CWE(getMessage()); 596 case 10: return new CWE(getMessage()); 597 case 11: return new ID(getMessage(), new Integer( 511 )); 598 case 12: return new DTM(getMessage()); 599 case 13: return new XCN(getMessage()); 600 case 14: return new XCN(getMessage()); 601 case 15: return new DTM(getMessage()); 602 case 16: return new DTM(getMessage()); 603 case 17: return new CWE(getMessage()); 604 case 18: return new CWE(getMessage()); 605 default: return null; 606 } 607 } 608 609 610} 611