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