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