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 RF1 message segment (Referral Information). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>RF1-1: Referral Status (CWE) <b>optional </b> 053 * <li>RF1-2: Referral Priority (CWE) <b>optional </b> 054 * <li>RF1-3: Referral Type (CWE) <b>optional </b> 055 * <li>RF1-4: Referral Disposition (CWE) <b>optional repeating</b> 056 * <li>RF1-5: Referral Category (CWE) <b>optional </b> 057 * <li>RF1-6: Originating Referral Identifier (EI) <b> </b> 058 * <li>RF1-7: Effective Date (DTM) <b>optional </b> 059 * <li>RF1-8: Expiration Date (DTM) <b>optional </b> 060 * <li>RF1-9: Process Date (DTM) <b>optional </b> 061 * <li>RF1-10: Referral Reason (CWE) <b>optional repeating</b> 062 * <li>RF1-11: External Referral Identifier (EI) <b>optional repeating</b> 063 * <li>RF1-12: Referral Documentation Completion Status (CWE) <b>optional </b> 064 * </ul> 065 */ 066@SuppressWarnings("unused") 067public class RF1 extends AbstractSegment { 068 069 /** 070 * Creates a new RF1 segment 071 */ 072 public RF1(Group parent, ModelClassFactory factory) { 073 super(parent, factory); 074 init(factory); 075 } 076 077 private void init(ModelClassFactory factory) { 078 try { 079 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Referral Status"); 080 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Referral Priority"); 081 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Referral Type"); 082 this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "Referral Disposition"); 083 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Referral Category"); 084 this.add(EI.class, true, 1, 0, new Object[]{ getMessage() }, "Originating Referral Identifier"); 085 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Effective Date"); 086 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Expiration Date"); 087 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Process Date"); 088 this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "Referral Reason"); 089 this.add(EI.class, false, 0, 0, new Object[]{ getMessage() }, "External Referral Identifier"); 090 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Referral Documentation Completion Status"); 091 } catch(HL7Exception e) { 092 log.error("Unexpected error creating RF1 - this is probably a bug in the source code generator.", e); 093 } 094 } 095 096 097 098 /** 099 * Returns 100 * RF1-1: "Referral Status" - creates it if necessary 101 */ 102 public CWE getReferralStatus() { 103 CWE retVal = this.getTypedField(1, 0); 104 return retVal; 105 } 106 107 /** 108 * Returns 109 * RF1-1: "Referral Status" - creates it if necessary 110 */ 111 public CWE getRf11_ReferralStatus() { 112 CWE retVal = this.getTypedField(1, 0); 113 return retVal; 114 } 115 116 117 118 /** 119 * Returns 120 * RF1-2: "Referral Priority" - creates it if necessary 121 */ 122 public CWE getReferralPriority() { 123 CWE retVal = this.getTypedField(2, 0); 124 return retVal; 125 } 126 127 /** 128 * Returns 129 * RF1-2: "Referral Priority" - creates it if necessary 130 */ 131 public CWE getRf12_ReferralPriority() { 132 CWE retVal = this.getTypedField(2, 0); 133 return retVal; 134 } 135 136 137 138 /** 139 * Returns 140 * RF1-3: "Referral Type" - creates it if necessary 141 */ 142 public CWE getReferralType() { 143 CWE retVal = this.getTypedField(3, 0); 144 return retVal; 145 } 146 147 /** 148 * Returns 149 * RF1-3: "Referral Type" - creates it if necessary 150 */ 151 public CWE getRf13_ReferralType() { 152 CWE retVal = this.getTypedField(3, 0); 153 return retVal; 154 } 155 156 157 /** 158 * Returns all repetitions of Referral Disposition (RF1-4). 159 */ 160 public CWE[] getReferralDisposition() { 161 CWE[] retVal = this.getTypedField(4, new CWE[0]); 162 return retVal; 163 } 164 165 166 /** 167 * Returns all repetitions of Referral Disposition (RF1-4). 168 */ 169 public CWE[] getRf14_ReferralDisposition() { 170 CWE[] retVal = this.getTypedField(4, new CWE[0]); 171 return retVal; 172 } 173 174 175 /** 176 * Returns a count of the current number of repetitions of Referral Disposition (RF1-4). 177 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 178 * it will return zero. 179 */ 180 public int getReferralDispositionReps() { 181 return this.getReps(4); 182 } 183 184 185 /** 186 * Returns a specific repetition of 187 * RF1-4: "Referral Disposition" - creates it if necessary 188 * 189 * @param rep The repetition index (0-indexed) 190 */ 191 public CWE getReferralDisposition(int rep) { 192 CWE retVal = this.getTypedField(4, rep); 193 return retVal; 194 } 195 196 /** 197 * Returns a specific repetition of 198 * RF1-4: "Referral Disposition" - creates it if necessary 199 * 200 * @param rep The repetition index (0-indexed) 201 */ 202 public CWE getRf14_ReferralDisposition(int rep) { 203 CWE retVal = this.getTypedField(4, rep); 204 return retVal; 205 } 206 207 /** 208 * Returns a count of the current number of repetitions of Referral Disposition (RF1-4). 209 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 210 * it will return zero. 211 */ 212 public int getRf14_ReferralDispositionReps() { 213 return this.getReps(4); 214 } 215 216 217 /** 218 * Inserts a repetition of 219 * RF1-4: "Referral Disposition" at a specific index 220 * 221 * @param rep The repetition index (0-indexed) 222 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 223 */ 224 public CWE insertReferralDisposition(int rep) throws HL7Exception { 225 return (CWE) super.insertRepetition(4, rep); 226 } 227 228 229 /** 230 * Inserts a repetition of 231 * RF1-4: "Referral Disposition" at a specific index 232 * 233 * @param rep The repetition index (0-indexed) 234 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 235 */ 236 public CWE insertRf14_ReferralDisposition(int rep) throws HL7Exception { 237 return (CWE) super.insertRepetition(4, rep); 238 } 239 240 241 /** 242 * Removes a repetition of 243 * RF1-4: "Referral Disposition" at a specific index 244 * 245 * @param rep The repetition index (0-indexed) 246 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 247 */ 248 public CWE removeReferralDisposition(int rep) throws HL7Exception { 249 return (CWE) super.removeRepetition(4, rep); 250 } 251 252 253 /** 254 * Removes a repetition of 255 * RF1-4: "Referral Disposition" at a specific index 256 * 257 * @param rep The repetition index (0-indexed) 258 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 259 */ 260 public CWE removeRf14_ReferralDisposition(int rep) throws HL7Exception { 261 return (CWE) super.removeRepetition(4, rep); 262 } 263 264 265 266 267 /** 268 * Returns 269 * RF1-5: "Referral Category" - creates it if necessary 270 */ 271 public CWE getReferralCategory() { 272 CWE retVal = this.getTypedField(5, 0); 273 return retVal; 274 } 275 276 /** 277 * Returns 278 * RF1-5: "Referral Category" - creates it if necessary 279 */ 280 public CWE getRf15_ReferralCategory() { 281 CWE retVal = this.getTypedField(5, 0); 282 return retVal; 283 } 284 285 286 287 /** 288 * Returns 289 * RF1-6: "Originating Referral Identifier" - creates it if necessary 290 */ 291 public EI getOriginatingReferralIdentifier() { 292 EI retVal = this.getTypedField(6, 0); 293 return retVal; 294 } 295 296 /** 297 * Returns 298 * RF1-6: "Originating Referral Identifier" - creates it if necessary 299 */ 300 public EI getRf16_OriginatingReferralIdentifier() { 301 EI retVal = this.getTypedField(6, 0); 302 return retVal; 303 } 304 305 306 307 /** 308 * Returns 309 * RF1-7: "Effective Date" - creates it if necessary 310 */ 311 public DTM getEffectiveDate() { 312 DTM retVal = this.getTypedField(7, 0); 313 return retVal; 314 } 315 316 /** 317 * Returns 318 * RF1-7: "Effective Date" - creates it if necessary 319 */ 320 public DTM getRf17_EffectiveDate() { 321 DTM retVal = this.getTypedField(7, 0); 322 return retVal; 323 } 324 325 326 327 /** 328 * Returns 329 * RF1-8: "Expiration Date" - creates it if necessary 330 */ 331 public DTM getExpirationDate() { 332 DTM retVal = this.getTypedField(8, 0); 333 return retVal; 334 } 335 336 /** 337 * Returns 338 * RF1-8: "Expiration Date" - creates it if necessary 339 */ 340 public DTM getRf18_ExpirationDate() { 341 DTM retVal = this.getTypedField(8, 0); 342 return retVal; 343 } 344 345 346 347 /** 348 * Returns 349 * RF1-9: "Process Date" - creates it if necessary 350 */ 351 public DTM getProcessDate() { 352 DTM retVal = this.getTypedField(9, 0); 353 return retVal; 354 } 355 356 /** 357 * Returns 358 * RF1-9: "Process Date" - creates it if necessary 359 */ 360 public DTM getRf19_ProcessDate() { 361 DTM retVal = this.getTypedField(9, 0); 362 return retVal; 363 } 364 365 366 /** 367 * Returns all repetitions of Referral Reason (RF1-10). 368 */ 369 public CWE[] getReferralReason() { 370 CWE[] retVal = this.getTypedField(10, new CWE[0]); 371 return retVal; 372 } 373 374 375 /** 376 * Returns all repetitions of Referral Reason (RF1-10). 377 */ 378 public CWE[] getRf110_ReferralReason() { 379 CWE[] retVal = this.getTypedField(10, new CWE[0]); 380 return retVal; 381 } 382 383 384 /** 385 * Returns a count of the current number of repetitions of Referral Reason (RF1-10). 386 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 387 * it will return zero. 388 */ 389 public int getReferralReasonReps() { 390 return this.getReps(10); 391 } 392 393 394 /** 395 * Returns a specific repetition of 396 * RF1-10: "Referral Reason" - creates it if necessary 397 * 398 * @param rep The repetition index (0-indexed) 399 */ 400 public CWE getReferralReason(int rep) { 401 CWE retVal = this.getTypedField(10, rep); 402 return retVal; 403 } 404 405 /** 406 * Returns a specific repetition of 407 * RF1-10: "Referral Reason" - creates it if necessary 408 * 409 * @param rep The repetition index (0-indexed) 410 */ 411 public CWE getRf110_ReferralReason(int rep) { 412 CWE retVal = this.getTypedField(10, rep); 413 return retVal; 414 } 415 416 /** 417 * Returns a count of the current number of repetitions of Referral Reason (RF1-10). 418 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 419 * it will return zero. 420 */ 421 public int getRf110_ReferralReasonReps() { 422 return this.getReps(10); 423 } 424 425 426 /** 427 * Inserts a repetition of 428 * RF1-10: "Referral Reason" at a specific index 429 * 430 * @param rep The repetition index (0-indexed) 431 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 432 */ 433 public CWE insertReferralReason(int rep) throws HL7Exception { 434 return (CWE) super.insertRepetition(10, rep); 435 } 436 437 438 /** 439 * Inserts a repetition of 440 * RF1-10: "Referral Reason" at a specific index 441 * 442 * @param rep The repetition index (0-indexed) 443 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 444 */ 445 public CWE insertRf110_ReferralReason(int rep) throws HL7Exception { 446 return (CWE) super.insertRepetition(10, rep); 447 } 448 449 450 /** 451 * Removes a repetition of 452 * RF1-10: "Referral Reason" at a specific index 453 * 454 * @param rep The repetition index (0-indexed) 455 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 456 */ 457 public CWE removeReferralReason(int rep) throws HL7Exception { 458 return (CWE) super.removeRepetition(10, rep); 459 } 460 461 462 /** 463 * Removes a repetition of 464 * RF1-10: "Referral Reason" at a specific index 465 * 466 * @param rep The repetition index (0-indexed) 467 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 468 */ 469 public CWE removeRf110_ReferralReason(int rep) throws HL7Exception { 470 return (CWE) super.removeRepetition(10, rep); 471 } 472 473 474 475 /** 476 * Returns all repetitions of External Referral Identifier (RF1-11). 477 */ 478 public EI[] getExternalReferralIdentifier() { 479 EI[] retVal = this.getTypedField(11, new EI[0]); 480 return retVal; 481 } 482 483 484 /** 485 * Returns all repetitions of External Referral Identifier (RF1-11). 486 */ 487 public EI[] getRf111_ExternalReferralIdentifier() { 488 EI[] retVal = this.getTypedField(11, new EI[0]); 489 return retVal; 490 } 491 492 493 /** 494 * Returns a count of the current number of repetitions of External Referral Identifier (RF1-11). 495 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 496 * it will return zero. 497 */ 498 public int getExternalReferralIdentifierReps() { 499 return this.getReps(11); 500 } 501 502 503 /** 504 * Returns a specific repetition of 505 * RF1-11: "External Referral Identifier" - creates it if necessary 506 * 507 * @param rep The repetition index (0-indexed) 508 */ 509 public EI getExternalReferralIdentifier(int rep) { 510 EI retVal = this.getTypedField(11, rep); 511 return retVal; 512 } 513 514 /** 515 * Returns a specific repetition of 516 * RF1-11: "External Referral Identifier" - creates it if necessary 517 * 518 * @param rep The repetition index (0-indexed) 519 */ 520 public EI getRf111_ExternalReferralIdentifier(int rep) { 521 EI retVal = this.getTypedField(11, rep); 522 return retVal; 523 } 524 525 /** 526 * Returns a count of the current number of repetitions of External Referral Identifier (RF1-11). 527 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 528 * it will return zero. 529 */ 530 public int getRf111_ExternalReferralIdentifierReps() { 531 return this.getReps(11); 532 } 533 534 535 /** 536 * Inserts a repetition of 537 * RF1-11: "External Referral Identifier" 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 EI insertExternalReferralIdentifier(int rep) throws HL7Exception { 543 return (EI) super.insertRepetition(11, rep); 544 } 545 546 547 /** 548 * Inserts a repetition of 549 * RF1-11: "External Referral Identifier" 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 EI insertRf111_ExternalReferralIdentifier(int rep) throws HL7Exception { 555 return (EI) super.insertRepetition(11, rep); 556 } 557 558 559 /** 560 * Removes a repetition of 561 * RF1-11: "External Referral Identifier" at a specific index 562 * 563 * @param rep The repetition index (0-indexed) 564 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 565 */ 566 public EI removeExternalReferralIdentifier(int rep) throws HL7Exception { 567 return (EI) super.removeRepetition(11, rep); 568 } 569 570 571 /** 572 * Removes a repetition of 573 * RF1-11: "External Referral Identifier" at a specific index 574 * 575 * @param rep The repetition index (0-indexed) 576 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 577 */ 578 public EI removeRf111_ExternalReferralIdentifier(int rep) throws HL7Exception { 579 return (EI) super.removeRepetition(11, rep); 580 } 581 582 583 584 585 /** 586 * Returns 587 * RF1-12: "Referral Documentation Completion Status" - creates it if necessary 588 */ 589 public CWE getReferralDocumentationCompletionStatus() { 590 CWE retVal = this.getTypedField(12, 0); 591 return retVal; 592 } 593 594 /** 595 * Returns 596 * RF1-12: "Referral Documentation Completion Status" - creates it if necessary 597 */ 598 public CWE getRf112_ReferralDocumentationCompletionStatus() { 599 CWE retVal = this.getTypedField(12, 0); 600 return retVal; 601 } 602 603 604 605 606 607 /** {@inheritDoc} */ 608 protected Type createNewTypeWithoutReflection(int field) { 609 switch (field) { 610 case 0: return new CWE(getMessage()); 611 case 1: return new CWE(getMessage()); 612 case 2: return new CWE(getMessage()); 613 case 3: return new CWE(getMessage()); 614 case 4: return new CWE(getMessage()); 615 case 5: return new EI(getMessage()); 616 case 6: return new DTM(getMessage()); 617 case 7: return new DTM(getMessage()); 618 case 8: return new DTM(getMessage()); 619 case 9: return new CWE(getMessage()); 620 case 10: return new EI(getMessage()); 621 case 11: return new CWE(getMessage()); 622 default: return null; 623 } 624 } 625 626 627} 628