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.v24.segment; 035 036// import ca.uhn.hl7v2.model.v24.group.*; 037import ca.uhn.hl7v2.model.v24.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 PDC message segment (Product Detail Country). 049 * This segment has the following fields:</p> 050 * <ul> 051 * <li>PDC-1: Manufacturer/Distributor (XON) <b> repeating</b> 052 * <li>PDC-2: Country (CE) <b> </b> 053 * <li>PDC-3: Brand Name (ST) <b> </b> 054 * <li>PDC-4: Device Family Name (ST) <b>optional </b> 055 * <li>PDC-5: Generic Name (CE) <b>optional </b> 056 * <li>PDC-6: Model Identifier (ST) <b>optional repeating</b> 057 * <li>PDC-7: Catalogue Identifier (ST) <b>optional </b> 058 * <li>PDC-8: Other Identifier (ST) <b>optional repeating</b> 059 * <li>PDC-9: Product Code (CE) <b>optional </b> 060 * <li>PDC-10: Marketing Basis (ID) <b>optional </b> 061 * <li>PDC-11: Marketing Approval ID (ST) <b>optional </b> 062 * <li>PDC-12: Labeled Shelf Life (CQ) <b>optional </b> 063 * <li>PDC-13: Expected Shelf Life (CQ) <b>optional </b> 064 * <li>PDC-14: Date First Marketed (TS) <b>optional </b> 065 * <li>PDC-15: Date Last Marketed (TS) <b>optional </b> 066 * </ul> 067 */ 068@SuppressWarnings("unused") 069public class PDC extends AbstractSegment { 070 071 /** 072 * Creates a new PDC segment 073 */ 074 public PDC(Group parent, ModelClassFactory factory) { 075 super(parent, factory); 076 init(factory); 077 } 078 079 private void init(ModelClassFactory factory) { 080 try { 081 this.add(XON.class, true, 0, 250, new Object[]{ getMessage() }, "Manufacturer/Distributor"); 082 this.add(CE.class, true, 1, 250, new Object[]{ getMessage() }, "Country"); 083 this.add(ST.class, true, 1, 60, new Object[]{ getMessage() }, "Brand Name"); 084 this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Device Family Name"); 085 this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Generic Name"); 086 this.add(ST.class, false, 0, 60, new Object[]{ getMessage() }, "Model Identifier"); 087 this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Catalogue Identifier"); 088 this.add(ST.class, false, 0, 60, new Object[]{ getMessage() }, "Other Identifier"); 089 this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Product Code"); 090 this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(330) }, "Marketing Basis"); 091 this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Marketing Approval ID"); 092 this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Labeled Shelf Life"); 093 this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Expected Shelf Life"); 094 this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date First Marketed"); 095 this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date Last Marketed"); 096 } catch(HL7Exception e) { 097 log.error("Unexpected error creating PDC - this is probably a bug in the source code generator.", e); 098 } 099 } 100 101 102 /** 103 * Returns all repetitions of Manufacturer/Distributor (PDC-1). 104 */ 105 public XON[] getManufacturerDistributor() { 106 XON[] retVal = this.getTypedField(1, new XON[0]); 107 return retVal; 108 } 109 110 111 /** 112 * Returns all repetitions of Manufacturer/Distributor (PDC-1). 113 */ 114 public XON[] getPdc1_ManufacturerDistributor() { 115 XON[] retVal = this.getTypedField(1, new XON[0]); 116 return retVal; 117 } 118 119 120 /** 121 * Returns a count of the current number of repetitions of Manufacturer/Distributor (PDC-1). 122 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 123 * it will return zero. 124 */ 125 public int getManufacturerDistributorReps() { 126 return this.getReps(1); 127 } 128 129 130 /** 131 * Returns a specific repetition of 132 * PDC-1: "Manufacturer/Distributor" - creates it if necessary 133 * 134 * @param rep The repetition index (0-indexed) 135 */ 136 public XON getManufacturerDistributor(int rep) { 137 XON retVal = this.getTypedField(1, rep); 138 return retVal; 139 } 140 141 /** 142 * Returns a specific repetition of 143 * PDC-1: "Manufacturer/Distributor" - creates it if necessary 144 * 145 * @param rep The repetition index (0-indexed) 146 */ 147 public XON getPdc1_ManufacturerDistributor(int rep) { 148 XON retVal = this.getTypedField(1, rep); 149 return retVal; 150 } 151 152 /** 153 * Returns a count of the current number of repetitions of Manufacturer/Distributor (PDC-1). 154 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 155 * it will return zero. 156 */ 157 public int getPdc1_ManufacturerDistributorReps() { 158 return this.getReps(1); 159 } 160 161 162 /** 163 * Inserts a repetition of 164 * PDC-1: "Manufacturer/Distributor" at a specific index 165 * 166 * @param rep The repetition index (0-indexed) 167 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 168 */ 169 public XON insertManufacturerDistributor(int rep) throws HL7Exception { 170 return (XON) super.insertRepetition(1, rep); 171 } 172 173 174 /** 175 * Inserts a repetition of 176 * PDC-1: "Manufacturer/Distributor" at a specific index 177 * 178 * @param rep The repetition index (0-indexed) 179 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 180 */ 181 public XON insertPdc1_ManufacturerDistributor(int rep) throws HL7Exception { 182 return (XON) super.insertRepetition(1, rep); 183 } 184 185 186 /** 187 * Removes a repetition of 188 * PDC-1: "Manufacturer/Distributor" at a specific index 189 * 190 * @param rep The repetition index (0-indexed) 191 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 192 */ 193 public XON removeManufacturerDistributor(int rep) throws HL7Exception { 194 return (XON) super.removeRepetition(1, rep); 195 } 196 197 198 /** 199 * Removes a repetition of 200 * PDC-1: "Manufacturer/Distributor" at a specific index 201 * 202 * @param rep The repetition index (0-indexed) 203 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 204 */ 205 public XON removePdc1_ManufacturerDistributor(int rep) throws HL7Exception { 206 return (XON) super.removeRepetition(1, rep); 207 } 208 209 210 211 212 /** 213 * Returns 214 * PDC-2: "Country" - creates it if necessary 215 */ 216 public CE getCountry() { 217 CE retVal = this.getTypedField(2, 0); 218 return retVal; 219 } 220 221 /** 222 * Returns 223 * PDC-2: "Country" - creates it if necessary 224 */ 225 public CE getPdc2_Country() { 226 CE retVal = this.getTypedField(2, 0); 227 return retVal; 228 } 229 230 231 232 /** 233 * Returns 234 * PDC-3: "Brand Name" - creates it if necessary 235 */ 236 public ST getBrandName() { 237 ST retVal = this.getTypedField(3, 0); 238 return retVal; 239 } 240 241 /** 242 * Returns 243 * PDC-3: "Brand Name" - creates it if necessary 244 */ 245 public ST getPdc3_BrandName() { 246 ST retVal = this.getTypedField(3, 0); 247 return retVal; 248 } 249 250 251 252 /** 253 * Returns 254 * PDC-4: "Device Family Name" - creates it if necessary 255 */ 256 public ST getDeviceFamilyName() { 257 ST retVal = this.getTypedField(4, 0); 258 return retVal; 259 } 260 261 /** 262 * Returns 263 * PDC-4: "Device Family Name" - creates it if necessary 264 */ 265 public ST getPdc4_DeviceFamilyName() { 266 ST retVal = this.getTypedField(4, 0); 267 return retVal; 268 } 269 270 271 272 /** 273 * Returns 274 * PDC-5: "Generic Name" - creates it if necessary 275 */ 276 public CE getGenericName() { 277 CE retVal = this.getTypedField(5, 0); 278 return retVal; 279 } 280 281 /** 282 * Returns 283 * PDC-5: "Generic Name" - creates it if necessary 284 */ 285 public CE getPdc5_GenericName() { 286 CE retVal = this.getTypedField(5, 0); 287 return retVal; 288 } 289 290 291 /** 292 * Returns all repetitions of Model Identifier (PDC-6). 293 */ 294 public ST[] getModelIdentifier() { 295 ST[] retVal = this.getTypedField(6, new ST[0]); 296 return retVal; 297 } 298 299 300 /** 301 * Returns all repetitions of Model Identifier (PDC-6). 302 */ 303 public ST[] getPdc6_ModelIdentifier() { 304 ST[] retVal = this.getTypedField(6, new ST[0]); 305 return retVal; 306 } 307 308 309 /** 310 * Returns a count of the current number of repetitions of Model Identifier (PDC-6). 311 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 312 * it will return zero. 313 */ 314 public int getModelIdentifierReps() { 315 return this.getReps(6); 316 } 317 318 319 /** 320 * Returns a specific repetition of 321 * PDC-6: "Model Identifier" - creates it if necessary 322 * 323 * @param rep The repetition index (0-indexed) 324 */ 325 public ST getModelIdentifier(int rep) { 326 ST retVal = this.getTypedField(6, rep); 327 return retVal; 328 } 329 330 /** 331 * Returns a specific repetition of 332 * PDC-6: "Model Identifier" - creates it if necessary 333 * 334 * @param rep The repetition index (0-indexed) 335 */ 336 public ST getPdc6_ModelIdentifier(int rep) { 337 ST retVal = this.getTypedField(6, rep); 338 return retVal; 339 } 340 341 /** 342 * Returns a count of the current number of repetitions of Model Identifier (PDC-6). 343 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 344 * it will return zero. 345 */ 346 public int getPdc6_ModelIdentifierReps() { 347 return this.getReps(6); 348 } 349 350 351 /** 352 * Inserts a repetition of 353 * PDC-6: "Model Identifier" at a specific index 354 * 355 * @param rep The repetition index (0-indexed) 356 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 357 */ 358 public ST insertModelIdentifier(int rep) throws HL7Exception { 359 return (ST) super.insertRepetition(6, rep); 360 } 361 362 363 /** 364 * Inserts a repetition of 365 * PDC-6: "Model Identifier" at a specific index 366 * 367 * @param rep The repetition index (0-indexed) 368 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 369 */ 370 public ST insertPdc6_ModelIdentifier(int rep) throws HL7Exception { 371 return (ST) super.insertRepetition(6, rep); 372 } 373 374 375 /** 376 * Removes a repetition of 377 * PDC-6: "Model Identifier" at a specific index 378 * 379 * @param rep The repetition index (0-indexed) 380 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 381 */ 382 public ST removeModelIdentifier(int rep) throws HL7Exception { 383 return (ST) super.removeRepetition(6, rep); 384 } 385 386 387 /** 388 * Removes a repetition of 389 * PDC-6: "Model Identifier" at a specific index 390 * 391 * @param rep The repetition index (0-indexed) 392 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 393 */ 394 public ST removePdc6_ModelIdentifier(int rep) throws HL7Exception { 395 return (ST) super.removeRepetition(6, rep); 396 } 397 398 399 400 401 /** 402 * Returns 403 * PDC-7: "Catalogue Identifier" - creates it if necessary 404 */ 405 public ST getCatalogueIdentifier() { 406 ST retVal = this.getTypedField(7, 0); 407 return retVal; 408 } 409 410 /** 411 * Returns 412 * PDC-7: "Catalogue Identifier" - creates it if necessary 413 */ 414 public ST getPdc7_CatalogueIdentifier() { 415 ST retVal = this.getTypedField(7, 0); 416 return retVal; 417 } 418 419 420 /** 421 * Returns all repetitions of Other Identifier (PDC-8). 422 */ 423 public ST[] getOtherIdentifier() { 424 ST[] retVal = this.getTypedField(8, new ST[0]); 425 return retVal; 426 } 427 428 429 /** 430 * Returns all repetitions of Other Identifier (PDC-8). 431 */ 432 public ST[] getPdc8_OtherIdentifier() { 433 ST[] retVal = this.getTypedField(8, new ST[0]); 434 return retVal; 435 } 436 437 438 /** 439 * Returns a count of the current number of repetitions of Other Identifier (PDC-8). 440 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 441 * it will return zero. 442 */ 443 public int getOtherIdentifierReps() { 444 return this.getReps(8); 445 } 446 447 448 /** 449 * Returns a specific repetition of 450 * PDC-8: "Other Identifier" - creates it if necessary 451 * 452 * @param rep The repetition index (0-indexed) 453 */ 454 public ST getOtherIdentifier(int rep) { 455 ST retVal = this.getTypedField(8, rep); 456 return retVal; 457 } 458 459 /** 460 * Returns a specific repetition of 461 * PDC-8: "Other Identifier" - creates it if necessary 462 * 463 * @param rep The repetition index (0-indexed) 464 */ 465 public ST getPdc8_OtherIdentifier(int rep) { 466 ST retVal = this.getTypedField(8, rep); 467 return retVal; 468 } 469 470 /** 471 * Returns a count of the current number of repetitions of Other Identifier (PDC-8). 472 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 473 * it will return zero. 474 */ 475 public int getPdc8_OtherIdentifierReps() { 476 return this.getReps(8); 477 } 478 479 480 /** 481 * Inserts a repetition of 482 * PDC-8: "Other Identifier" at a specific index 483 * 484 * @param rep The repetition index (0-indexed) 485 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 486 */ 487 public ST insertOtherIdentifier(int rep) throws HL7Exception { 488 return (ST) super.insertRepetition(8, rep); 489 } 490 491 492 /** 493 * Inserts a repetition of 494 * PDC-8: "Other Identifier" at a specific index 495 * 496 * @param rep The repetition index (0-indexed) 497 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 498 */ 499 public ST insertPdc8_OtherIdentifier(int rep) throws HL7Exception { 500 return (ST) super.insertRepetition(8, rep); 501 } 502 503 504 /** 505 * Removes a repetition of 506 * PDC-8: "Other Identifier" at a specific index 507 * 508 * @param rep The repetition index (0-indexed) 509 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 510 */ 511 public ST removeOtherIdentifier(int rep) throws HL7Exception { 512 return (ST) super.removeRepetition(8, rep); 513 } 514 515 516 /** 517 * Removes a repetition of 518 * PDC-8: "Other Identifier" at a specific index 519 * 520 * @param rep The repetition index (0-indexed) 521 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 522 */ 523 public ST removePdc8_OtherIdentifier(int rep) throws HL7Exception { 524 return (ST) super.removeRepetition(8, rep); 525 } 526 527 528 529 530 /** 531 * Returns 532 * PDC-9: "Product Code" - creates it if necessary 533 */ 534 public CE getProductCode() { 535 CE retVal = this.getTypedField(9, 0); 536 return retVal; 537 } 538 539 /** 540 * Returns 541 * PDC-9: "Product Code" - creates it if necessary 542 */ 543 public CE getPdc9_ProductCode() { 544 CE retVal = this.getTypedField(9, 0); 545 return retVal; 546 } 547 548 549 550 /** 551 * Returns 552 * PDC-10: "Marketing Basis" - creates it if necessary 553 */ 554 public ID getMarketingBasis() { 555 ID retVal = this.getTypedField(10, 0); 556 return retVal; 557 } 558 559 /** 560 * Returns 561 * PDC-10: "Marketing Basis" - creates it if necessary 562 */ 563 public ID getPdc10_MarketingBasis() { 564 ID retVal = this.getTypedField(10, 0); 565 return retVal; 566 } 567 568 569 570 /** 571 * Returns 572 * PDC-11: "Marketing Approval ID" - creates it if necessary 573 */ 574 public ST getMarketingApprovalID() { 575 ST retVal = this.getTypedField(11, 0); 576 return retVal; 577 } 578 579 /** 580 * Returns 581 * PDC-11: "Marketing Approval ID" - creates it if necessary 582 */ 583 public ST getPdc11_MarketingApprovalID() { 584 ST retVal = this.getTypedField(11, 0); 585 return retVal; 586 } 587 588 589 590 /** 591 * Returns 592 * PDC-12: "Labeled Shelf Life" - creates it if necessary 593 */ 594 public CQ getLabeledShelfLife() { 595 CQ retVal = this.getTypedField(12, 0); 596 return retVal; 597 } 598 599 /** 600 * Returns 601 * PDC-12: "Labeled Shelf Life" - creates it if necessary 602 */ 603 public CQ getPdc12_LabeledShelfLife() { 604 CQ retVal = this.getTypedField(12, 0); 605 return retVal; 606 } 607 608 609 610 /** 611 * Returns 612 * PDC-13: "Expected Shelf Life" - creates it if necessary 613 */ 614 public CQ getExpectedShelfLife() { 615 CQ retVal = this.getTypedField(13, 0); 616 return retVal; 617 } 618 619 /** 620 * Returns 621 * PDC-13: "Expected Shelf Life" - creates it if necessary 622 */ 623 public CQ getPdc13_ExpectedShelfLife() { 624 CQ retVal = this.getTypedField(13, 0); 625 return retVal; 626 } 627 628 629 630 /** 631 * Returns 632 * PDC-14: "Date First Marketed" - creates it if necessary 633 */ 634 public TS getDateFirstMarketed() { 635 TS retVal = this.getTypedField(14, 0); 636 return retVal; 637 } 638 639 /** 640 * Returns 641 * PDC-14: "Date First Marketed" - creates it if necessary 642 */ 643 public TS getPdc14_DateFirstMarketed() { 644 TS retVal = this.getTypedField(14, 0); 645 return retVal; 646 } 647 648 649 650 /** 651 * Returns 652 * PDC-15: "Date Last Marketed" - creates it if necessary 653 */ 654 public TS getDateLastMarketed() { 655 TS retVal = this.getTypedField(15, 0); 656 return retVal; 657 } 658 659 /** 660 * Returns 661 * PDC-15: "Date Last Marketed" - creates it if necessary 662 */ 663 public TS getPdc15_DateLastMarketed() { 664 TS retVal = this.getTypedField(15, 0); 665 return retVal; 666 } 667 668 669 670 671 672 /** {@inheritDoc} */ 673 protected Type createNewTypeWithoutReflection(int field) { 674 switch (field) { 675 case 0: return new XON(getMessage()); 676 case 1: return new CE(getMessage()); 677 case 2: return new ST(getMessage()); 678 case 3: return new ST(getMessage()); 679 case 4: return new CE(getMessage()); 680 case 5: return new ST(getMessage()); 681 case 6: return new ST(getMessage()); 682 case 7: return new ST(getMessage()); 683 case 8: return new CE(getMessage()); 684 case 9: return new ID(getMessage(), new Integer( 330 )); 685 case 10: return new ST(getMessage()); 686 case 11: return new CQ(getMessage()); 687 case 12: return new CQ(getMessage()); 688 case 13: return new TS(getMessage()); 689 case 14: return new TS(getMessage()); 690 default: return null; 691 } 692 } 693 694 695} 696