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.v21.segment; 035 036// import ca.uhn.hl7v2.model.v21.group.*; 037import ca.uhn.hl7v2.model.v21.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 URD message segment (RESULTS/UPDATE DEFINITION). 049 * This segment has the following fields:</p> 050 * <ul> 051 * <li>URD-1: R/U DATE/TIME (TS) <b>optional </b> 052 * <li>URD-2: REPORT PRIORITY (ID) <b>optional </b> 053 * <li>URD-3: R/U WHO SUBJECT DEFINITION (ST) <b> repeating</b> 054 * <li>URD-4: R/U WHAT SUBJECT DEFINITION (ID) <b>optional repeating</b> 055 * <li>URD-5: R/U WHAT DEPARTMENT CODE (ST) <b>optional repeating</b> 056 * <li>URD-6: R/U DISPLAY/PRINT LOCATIONS (ST) <b>optional repeating</b> 057 * <li>URD-7: R/U RESULTS LEVEL (ID) <b>optional </b> 058 * </ul> 059 */ 060@SuppressWarnings("unused") 061public class URD extends AbstractSegment { 062 063 /** 064 * Creates a new URD segment 065 */ 066 public URD(Group parent, ModelClassFactory factory) { 067 super(parent, factory); 068 init(factory); 069 } 070 071 private void init(ModelClassFactory factory) { 072 try { 073 this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "R/U DATE/TIME"); 074 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(109) }, "REPORT PRIORITY"); 075 this.add(ST.class, true, 0, 20, new Object[]{ getMessage() }, "R/U WHO SUBJECT DEFINITION"); 076 this.add(ID.class, false, 0, 3, new Object[]{ getMessage(), new Integer(48) }, "R/U WHAT SUBJECT DEFINITION"); 077 this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "R/U WHAT DEPARTMENT CODE"); 078 this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "R/U DISPLAY/PRINT LOCATIONS"); 079 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(108) }, "R/U RESULTS LEVEL"); 080 } catch(HL7Exception e) { 081 log.error("Unexpected error creating URD - this is probably a bug in the source code generator.", e); 082 } 083 } 084 085 086 087 /** 088 * Returns 089 * URD-1: "R/U DATE/TIME" - creates it if necessary 090 */ 091 public TS getRUDATETIME() { 092 TS retVal = this.getTypedField(1, 0); 093 return retVal; 094 } 095 096 /** 097 * Returns 098 * URD-1: "R/U DATE/TIME" - creates it if necessary 099 */ 100 public TS getUrd1_RUDATETIME() { 101 TS retVal = this.getTypedField(1, 0); 102 return retVal; 103 } 104 105 106 107 /** 108 * Returns 109 * URD-2: "REPORT PRIORITY" - creates it if necessary 110 */ 111 public ID getREPORTPRIORITY() { 112 ID retVal = this.getTypedField(2, 0); 113 return retVal; 114 } 115 116 /** 117 * Returns 118 * URD-2: "REPORT PRIORITY" - creates it if necessary 119 */ 120 public ID getUrd2_REPORTPRIORITY() { 121 ID retVal = this.getTypedField(2, 0); 122 return retVal; 123 } 124 125 126 /** 127 * Returns all repetitions of R/U WHO SUBJECT DEFINITION (URD-3). 128 */ 129 public ST[] getRUWHOSUBJECTDEFINITION() { 130 ST[] retVal = this.getTypedField(3, new ST[0]); 131 return retVal; 132 } 133 134 135 /** 136 * Returns all repetitions of R/U WHO SUBJECT DEFINITION (URD-3). 137 */ 138 public ST[] getUrd3_RUWHOSUBJECTDEFINITION() { 139 ST[] retVal = this.getTypedField(3, new ST[0]); 140 return retVal; 141 } 142 143 144 /** 145 * Returns a count of the current number of repetitions of R/U WHO SUBJECT DEFINITION (URD-3). 146 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 147 * it will return zero. 148 */ 149 public int getRUWHOSUBJECTDEFINITIONReps() { 150 return this.getReps(3); 151 } 152 153 154 /** 155 * Returns a specific repetition of 156 * URD-3: "R/U WHO SUBJECT DEFINITION" - creates it if necessary 157 * 158 * @param rep The repetition index (0-indexed) 159 */ 160 public ST getRUWHOSUBJECTDEFINITION(int rep) { 161 ST retVal = this.getTypedField(3, rep); 162 return retVal; 163 } 164 165 /** 166 * Returns a specific repetition of 167 * URD-3: "R/U WHO SUBJECT DEFINITION" - creates it if necessary 168 * 169 * @param rep The repetition index (0-indexed) 170 */ 171 public ST getUrd3_RUWHOSUBJECTDEFINITION(int rep) { 172 ST retVal = this.getTypedField(3, rep); 173 return retVal; 174 } 175 176 /** 177 * Returns a count of the current number of repetitions of R/U WHO SUBJECT DEFINITION (URD-3). 178 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 179 * it will return zero. 180 */ 181 public int getUrd3_RUWHOSUBJECTDEFINITIONReps() { 182 return this.getReps(3); 183 } 184 185 186 /** 187 * Inserts a repetition of 188 * URD-3: "R/U WHO SUBJECT DEFINITION" 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 ST insertRUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 194 return (ST) super.insertRepetition(3, rep); 195 } 196 197 198 /** 199 * Inserts a repetition of 200 * URD-3: "R/U WHO SUBJECT DEFINITION" 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 ST insertUrd3_RUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 206 return (ST) super.insertRepetition(3, rep); 207 } 208 209 210 /** 211 * Removes a repetition of 212 * URD-3: "R/U WHO SUBJECT DEFINITION" at a specific index 213 * 214 * @param rep The repetition index (0-indexed) 215 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 216 */ 217 public ST removeRUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 218 return (ST) super.removeRepetition(3, rep); 219 } 220 221 222 /** 223 * Removes a repetition of 224 * URD-3: "R/U WHO SUBJECT DEFINITION" at a specific index 225 * 226 * @param rep The repetition index (0-indexed) 227 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 228 */ 229 public ST removeUrd3_RUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 230 return (ST) super.removeRepetition(3, rep); 231 } 232 233 234 235 /** 236 * Returns all repetitions of R/U WHAT SUBJECT DEFINITION (URD-4). 237 */ 238 public ID[] getRUWHATSUBJECTDEFINITION() { 239 ID[] retVal = this.getTypedField(4, new ID[0]); 240 return retVal; 241 } 242 243 244 /** 245 * Returns all repetitions of R/U WHAT SUBJECT DEFINITION (URD-4). 246 */ 247 public ID[] getUrd4_RUWHATSUBJECTDEFINITION() { 248 ID[] retVal = this.getTypedField(4, new ID[0]); 249 return retVal; 250 } 251 252 253 /** 254 * Returns a count of the current number of repetitions of R/U WHAT SUBJECT DEFINITION (URD-4). 255 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 256 * it will return zero. 257 */ 258 public int getRUWHATSUBJECTDEFINITIONReps() { 259 return this.getReps(4); 260 } 261 262 263 /** 264 * Returns a specific repetition of 265 * URD-4: "R/U WHAT SUBJECT DEFINITION" - creates it if necessary 266 * 267 * @param rep The repetition index (0-indexed) 268 */ 269 public ID getRUWHATSUBJECTDEFINITION(int rep) { 270 ID retVal = this.getTypedField(4, rep); 271 return retVal; 272 } 273 274 /** 275 * Returns a specific repetition of 276 * URD-4: "R/U WHAT SUBJECT DEFINITION" - creates it if necessary 277 * 278 * @param rep The repetition index (0-indexed) 279 */ 280 public ID getUrd4_RUWHATSUBJECTDEFINITION(int rep) { 281 ID retVal = this.getTypedField(4, rep); 282 return retVal; 283 } 284 285 /** 286 * Returns a count of the current number of repetitions of R/U WHAT SUBJECT DEFINITION (URD-4). 287 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 288 * it will return zero. 289 */ 290 public int getUrd4_RUWHATSUBJECTDEFINITIONReps() { 291 return this.getReps(4); 292 } 293 294 295 /** 296 * Inserts a repetition of 297 * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index 298 * 299 * @param rep The repetition index (0-indexed) 300 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 301 */ 302 public ID insertRUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 303 return (ID) super.insertRepetition(4, rep); 304 } 305 306 307 /** 308 * Inserts a repetition of 309 * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index 310 * 311 * @param rep The repetition index (0-indexed) 312 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 313 */ 314 public ID insertUrd4_RUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 315 return (ID) super.insertRepetition(4, rep); 316 } 317 318 319 /** 320 * Removes a repetition of 321 * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index 322 * 323 * @param rep The repetition index (0-indexed) 324 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 325 */ 326 public ID removeRUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 327 return (ID) super.removeRepetition(4, rep); 328 } 329 330 331 /** 332 * Removes a repetition of 333 * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index 334 * 335 * @param rep The repetition index (0-indexed) 336 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 337 */ 338 public ID removeUrd4_RUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 339 return (ID) super.removeRepetition(4, rep); 340 } 341 342 343 344 /** 345 * Returns all repetitions of R/U WHAT DEPARTMENT CODE (URD-5). 346 */ 347 public ST[] getRUWHATDEPARTMENTCODE() { 348 ST[] retVal = this.getTypedField(5, new ST[0]); 349 return retVal; 350 } 351 352 353 /** 354 * Returns all repetitions of R/U WHAT DEPARTMENT CODE (URD-5). 355 */ 356 public ST[] getUrd5_RUWHATDEPARTMENTCODE() { 357 ST[] retVal = this.getTypedField(5, new ST[0]); 358 return retVal; 359 } 360 361 362 /** 363 * Returns a count of the current number of repetitions of R/U WHAT DEPARTMENT CODE (URD-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 getRUWHATDEPARTMENTCODEReps() { 368 return this.getReps(5); 369 } 370 371 372 /** 373 * Returns a specific repetition of 374 * URD-5: "R/U WHAT DEPARTMENT CODE" - creates it if necessary 375 * 376 * @param rep The repetition index (0-indexed) 377 */ 378 public ST getRUWHATDEPARTMENTCODE(int rep) { 379 ST retVal = this.getTypedField(5, rep); 380 return retVal; 381 } 382 383 /** 384 * Returns a specific repetition of 385 * URD-5: "R/U WHAT DEPARTMENT CODE" - creates it if necessary 386 * 387 * @param rep The repetition index (0-indexed) 388 */ 389 public ST getUrd5_RUWHATDEPARTMENTCODE(int rep) { 390 ST retVal = this.getTypedField(5, rep); 391 return retVal; 392 } 393 394 /** 395 * Returns a count of the current number of repetitions of R/U WHAT DEPARTMENT CODE (URD-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 getUrd5_RUWHATDEPARTMENTCODEReps() { 400 return this.getReps(5); 401 } 402 403 404 /** 405 * Inserts a repetition of 406 * URD-5: "R/U WHAT DEPARTMENT CODE" 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 ST insertRUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 412 return (ST) super.insertRepetition(5, rep); 413 } 414 415 416 /** 417 * Inserts a repetition of 418 * URD-5: "R/U WHAT DEPARTMENT CODE" 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 ST insertUrd5_RUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 424 return (ST) super.insertRepetition(5, rep); 425 } 426 427 428 /** 429 * Removes a repetition of 430 * URD-5: "R/U WHAT DEPARTMENT CODE" 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 ST removeRUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 436 return (ST) super.removeRepetition(5, rep); 437 } 438 439 440 /** 441 * Removes a repetition of 442 * URD-5: "R/U WHAT DEPARTMENT CODE" 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 ST removeUrd5_RUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 448 return (ST) super.removeRepetition(5, rep); 449 } 450 451 452 453 /** 454 * Returns all repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-6). 455 */ 456 public ST[] getRUDISPLAYPRINTLOCATIONS() { 457 ST[] retVal = this.getTypedField(6, new ST[0]); 458 return retVal; 459 } 460 461 462 /** 463 * Returns all repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-6). 464 */ 465 public ST[] getUrd6_RUDISPLAYPRINTLOCATIONS() { 466 ST[] retVal = this.getTypedField(6, new ST[0]); 467 return retVal; 468 } 469 470 471 /** 472 * Returns a count of the current number of repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-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 getRUDISPLAYPRINTLOCATIONSReps() { 477 return this.getReps(6); 478 } 479 480 481 /** 482 * Returns a specific repetition of 483 * URD-6: "R/U DISPLAY/PRINT LOCATIONS" - creates it if necessary 484 * 485 * @param rep The repetition index (0-indexed) 486 */ 487 public ST getRUDISPLAYPRINTLOCATIONS(int rep) { 488 ST retVal = this.getTypedField(6, rep); 489 return retVal; 490 } 491 492 /** 493 * Returns a specific repetition of 494 * URD-6: "R/U DISPLAY/PRINT LOCATIONS" - creates it if necessary 495 * 496 * @param rep The repetition index (0-indexed) 497 */ 498 public ST getUrd6_RUDISPLAYPRINTLOCATIONS(int rep) { 499 ST retVal = this.getTypedField(6, rep); 500 return retVal; 501 } 502 503 /** 504 * Returns a count of the current number of repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-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 getUrd6_RUDISPLAYPRINTLOCATIONSReps() { 509 return this.getReps(6); 510 } 511 512 513 /** 514 * Inserts a repetition of 515 * URD-6: "R/U DISPLAY/PRINT LOCATIONS" 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 ST insertRUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 521 return (ST) super.insertRepetition(6, rep); 522 } 523 524 525 /** 526 * Inserts a repetition of 527 * URD-6: "R/U DISPLAY/PRINT LOCATIONS" 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 ST insertUrd6_RUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 533 return (ST) super.insertRepetition(6, rep); 534 } 535 536 537 /** 538 * Removes a repetition of 539 * URD-6: "R/U DISPLAY/PRINT LOCATIONS" 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 ST removeRUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 545 return (ST) super.removeRepetition(6, rep); 546 } 547 548 549 /** 550 * Removes a repetition of 551 * URD-6: "R/U DISPLAY/PRINT LOCATIONS" 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 ST removeUrd6_RUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 557 return (ST) super.removeRepetition(6, rep); 558 } 559 560 561 562 563 /** 564 * Returns 565 * URD-7: "R/U RESULTS LEVEL" - creates it if necessary 566 */ 567 public ID getRURESULTSLEVEL() { 568 ID retVal = this.getTypedField(7, 0); 569 return retVal; 570 } 571 572 /** 573 * Returns 574 * URD-7: "R/U RESULTS LEVEL" - creates it if necessary 575 */ 576 public ID getUrd7_RURESULTSLEVEL() { 577 ID retVal = this.getTypedField(7, 0); 578 return retVal; 579 } 580 581 582 583 584 585 /** {@inheritDoc} */ 586 protected Type createNewTypeWithoutReflection(int field) { 587 switch (field) { 588 case 0: return new TS(getMessage()); 589 case 1: return new ID(getMessage(), new Integer( 109 )); 590 case 2: return new ST(getMessage()); 591 case 3: return new ID(getMessage(), new Integer( 48 )); 592 case 4: return new ST(getMessage()); 593 case 5: return new ST(getMessage()); 594 case 6: return new ID(getMessage(), new Integer( 108 )); 595 default: return null; 596 } 597 } 598 599 600} 601