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