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/** 049 *<p>Represents an HL7 ORC message segment (COMMON ORDER). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>ORC-1: ORDER CONTROL (ST) <b> </b> 053 * <li>ORC-2: PLACER ORDER # (CM) <b>optional </b> 054 * <li>ORC-3: FILLER ORDER # (CM) <b>optional </b> 055 * <li>ORC-4: PLACER GROUP # (CM) <b>optional </b> 056 * <li>ORC-5: ORDER STATUS (ST) <b>optional </b> 057 * <li>ORC-6: RESPONSE FLAG (ST) <b>optional </b> 058 * <li>ORC-7: TIMING/QUANTITY (CM) <b>optional </b> 059 * <li>ORC-8: PARENT (CM) <b>optional </b> 060 * <li>ORC-9: DATE/TIME OF TRANSACTION (TS) <b>optional </b> 061 * <li>ORC-10: ENTERED BY (CN) <b>optional </b> 062 * <li>ORC-11: VERIFIED BY (CN) <b>optional </b> 063 * <li>ORC-12: ORDERING PROVIDER (CN) <b>optional </b> 064 * <li>ORC-13: ENTERER'S LOCATION (CM) <b>optional </b> 065 * <li>ORC-14: CALL BACK PHONE NUMBER (TN) <b>optional repeating</b> 066 * </ul> 067 */ 068@SuppressWarnings("unused") 069public class ORC extends AbstractSegment { 070 071 /** 072 * Creates a new ORC segment 073 */ 074 public ORC(Group parent, ModelClassFactory factory) { 075 super(parent, factory); 076 init(factory); 077 } 078 079 private void init(ModelClassFactory factory) { 080 try { 081 this.add(ST.class, true, 1, 2, new Object[]{ getMessage() }, "ORDER CONTROL"); 082 this.add(CM.class, false, 1, 75, new Object[]{ getMessage() }, "PLACER ORDER #"); 083 this.add(CM.class, false, 1, 75, new Object[]{ getMessage() }, "FILLER ORDER #"); 084 this.add(CM.class, false, 1, 75, new Object[]{ getMessage() }, "PLACER GROUP #"); 085 this.add(ST.class, false, 1, 2, new Object[]{ getMessage() }, "ORDER STATUS"); 086 this.add(ST.class, false, 1, 1, new Object[]{ getMessage() }, "RESPONSE FLAG"); 087 this.add(CM.class, false, 1, 200, new Object[]{ getMessage() }, "TIMING/QUANTITY"); 088 this.add(CM.class, false, 1, 200, new Object[]{ getMessage() }, "PARENT"); 089 this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "DATE/TIME OF TRANSACTION"); 090 this.add(CN.class, false, 1, 80, new Object[]{ getMessage() }, "ENTERED BY"); 091 this.add(CN.class, false, 1, 80, new Object[]{ getMessage() }, "VERIFIED BY"); 092 this.add(CN.class, false, 1, 80, new Object[]{ getMessage() }, "ORDERING PROVIDER"); 093 this.add(CM.class, false, 1, 80, new Object[]{ getMessage() }, "ENTERER'S LOCATION"); 094 this.add(TN.class, false, 2, 40, new Object[]{ getMessage() }, "CALL BACK PHONE NUMBER"); 095 } catch(HL7Exception e) { 096 log.error("Unexpected error creating ORC - this is probably a bug in the source code generator.", e); 097 } 098 } 099 100 101 102 /** 103 * Returns 104 * ORC-1: "ORDER CONTROL" - creates it if necessary 105 */ 106 public ST getORDERCONTROL() { 107 ST retVal = this.getTypedField(1, 0); 108 return retVal; 109 } 110 111 /** 112 * Returns 113 * ORC-1: "ORDER CONTROL" - creates it if necessary 114 */ 115 public ST getOrc1_ORDERCONTROL() { 116 ST retVal = this.getTypedField(1, 0); 117 return retVal; 118 } 119 120 121 122 /** 123 * Returns 124 * ORC-2: "PLACER ORDER #" - creates it if necessary 125 */ 126 public CM getPLACERORDER() { 127 CM retVal = this.getTypedField(2, 0); 128 return retVal; 129 } 130 131 /** 132 * Returns 133 * ORC-2: "PLACER ORDER #" - creates it if necessary 134 */ 135 public CM getOrc2_PLACERORDER() { 136 CM retVal = this.getTypedField(2, 0); 137 return retVal; 138 } 139 140 141 142 /** 143 * Returns 144 * ORC-3: "FILLER ORDER #" - creates it if necessary 145 */ 146 public CM getFILLERORDER() { 147 CM retVal = this.getTypedField(3, 0); 148 return retVal; 149 } 150 151 /** 152 * Returns 153 * ORC-3: "FILLER ORDER #" - creates it if necessary 154 */ 155 public CM getOrc3_FILLERORDER() { 156 CM retVal = this.getTypedField(3, 0); 157 return retVal; 158 } 159 160 161 162 /** 163 * Returns 164 * ORC-4: "PLACER GROUP #" - creates it if necessary 165 */ 166 public CM getPLACERGROUP() { 167 CM retVal = this.getTypedField(4, 0); 168 return retVal; 169 } 170 171 /** 172 * Returns 173 * ORC-4: "PLACER GROUP #" - creates it if necessary 174 */ 175 public CM getOrc4_PLACERGROUP() { 176 CM retVal = this.getTypedField(4, 0); 177 return retVal; 178 } 179 180 181 182 /** 183 * Returns 184 * ORC-5: "ORDER STATUS" - creates it if necessary 185 */ 186 public ST getORDERSTATUS() { 187 ST retVal = this.getTypedField(5, 0); 188 return retVal; 189 } 190 191 /** 192 * Returns 193 * ORC-5: "ORDER STATUS" - creates it if necessary 194 */ 195 public ST getOrc5_ORDERSTATUS() { 196 ST retVal = this.getTypedField(5, 0); 197 return retVal; 198 } 199 200 201 202 /** 203 * Returns 204 * ORC-6: "RESPONSE FLAG" - creates it if necessary 205 */ 206 public ST getRESPONSEFLAG() { 207 ST retVal = this.getTypedField(6, 0); 208 return retVal; 209 } 210 211 /** 212 * Returns 213 * ORC-6: "RESPONSE FLAG" - creates it if necessary 214 */ 215 public ST getOrc6_RESPONSEFLAG() { 216 ST retVal = this.getTypedField(6, 0); 217 return retVal; 218 } 219 220 221 222 /** 223 * Returns 224 * ORC-7: "TIMING/QUANTITY" - creates it if necessary 225 */ 226 public CM getTIMINGQUANTITY() { 227 CM retVal = this.getTypedField(7, 0); 228 return retVal; 229 } 230 231 /** 232 * Returns 233 * ORC-7: "TIMING/QUANTITY" - creates it if necessary 234 */ 235 public CM getOrc7_TIMINGQUANTITY() { 236 CM retVal = this.getTypedField(7, 0); 237 return retVal; 238 } 239 240 241 242 /** 243 * Returns 244 * ORC-8: "PARENT" - creates it if necessary 245 */ 246 public CM getPARENT() { 247 CM retVal = this.getTypedField(8, 0); 248 return retVal; 249 } 250 251 /** 252 * Returns 253 * ORC-8: "PARENT" - creates it if necessary 254 */ 255 public CM getOrc8_PARENT() { 256 CM retVal = this.getTypedField(8, 0); 257 return retVal; 258 } 259 260 261 262 /** 263 * Returns 264 * ORC-9: "DATE/TIME OF TRANSACTION" - creates it if necessary 265 */ 266 public TS getDATETIMEOFTRANSACTION() { 267 TS retVal = this.getTypedField(9, 0); 268 return retVal; 269 } 270 271 /** 272 * Returns 273 * ORC-9: "DATE/TIME OF TRANSACTION" - creates it if necessary 274 */ 275 public TS getOrc9_DATETIMEOFTRANSACTION() { 276 TS retVal = this.getTypedField(9, 0); 277 return retVal; 278 } 279 280 281 282 /** 283 * Returns 284 * ORC-10: "ENTERED BY" - creates it if necessary 285 */ 286 public CN getENTEREDBY() { 287 CN retVal = this.getTypedField(10, 0); 288 return retVal; 289 } 290 291 /** 292 * Returns 293 * ORC-10: "ENTERED BY" - creates it if necessary 294 */ 295 public CN getOrc10_ENTEREDBY() { 296 CN retVal = this.getTypedField(10, 0); 297 return retVal; 298 } 299 300 301 302 /** 303 * Returns 304 * ORC-11: "VERIFIED BY" - creates it if necessary 305 */ 306 public CN getVERIFIEDBY() { 307 CN retVal = this.getTypedField(11, 0); 308 return retVal; 309 } 310 311 /** 312 * Returns 313 * ORC-11: "VERIFIED BY" - creates it if necessary 314 */ 315 public CN getOrc11_VERIFIEDBY() { 316 CN retVal = this.getTypedField(11, 0); 317 return retVal; 318 } 319 320 321 322 /** 323 * Returns 324 * ORC-12: "ORDERING PROVIDER" - creates it if necessary 325 */ 326 public CN getORDERINGPROVIDER() { 327 CN retVal = this.getTypedField(12, 0); 328 return retVal; 329 } 330 331 /** 332 * Returns 333 * ORC-12: "ORDERING PROVIDER" - creates it if necessary 334 */ 335 public CN getOrc12_ORDERINGPROVIDER() { 336 CN retVal = this.getTypedField(12, 0); 337 return retVal; 338 } 339 340 341 342 /** 343 * Returns 344 * ORC-13: "ENTERER'S LOCATION" - creates it if necessary 345 */ 346 public CM getENTERERSLOCATION() { 347 CM retVal = this.getTypedField(13, 0); 348 return retVal; 349 } 350 351 /** 352 * Returns 353 * ORC-13: "ENTERER'S LOCATION" - creates it if necessary 354 */ 355 public CM getOrc13_ENTERERSLOCATION() { 356 CM retVal = this.getTypedField(13, 0); 357 return retVal; 358 } 359 360 361 /** 362 * Returns all repetitions of CALL BACK PHONE NUMBER (ORC-14). 363 */ 364 public TN[] getCALLBACKPHONENUMBER() { 365 TN[] retVal = this.getTypedField(14, new TN[0]); 366 return retVal; 367 } 368 369 370 /** 371 * Returns all repetitions of CALL BACK PHONE NUMBER (ORC-14). 372 */ 373 public TN[] getOrc14_CALLBACKPHONENUMBER() { 374 TN[] retVal = this.getTypedField(14, new TN[0]); 375 return retVal; 376 } 377 378 379 /** 380 * Returns a count of the current number of repetitions of CALL BACK PHONE NUMBER (ORC-14). 381 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 382 * it will return zero. 383 */ 384 public int getCALLBACKPHONENUMBERReps() { 385 return this.getReps(14); 386 } 387 388 389 /** 390 * Returns a specific repetition of 391 * ORC-14: "CALL BACK PHONE NUMBER" - creates it if necessary 392 * 393 * @param rep The repetition index (0-indexed) 394 */ 395 public TN getCALLBACKPHONENUMBER(int rep) { 396 TN retVal = this.getTypedField(14, rep); 397 return retVal; 398 } 399 400 /** 401 * Returns a specific repetition of 402 * ORC-14: "CALL BACK PHONE NUMBER" - creates it if necessary 403 * 404 * @param rep The repetition index (0-indexed) 405 */ 406 public TN getOrc14_CALLBACKPHONENUMBER(int rep) { 407 TN retVal = this.getTypedField(14, rep); 408 return retVal; 409 } 410 411 /** 412 * Returns a count of the current number of repetitions of CALL BACK PHONE NUMBER (ORC-14). 413 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 414 * it will return zero. 415 */ 416 public int getOrc14_CALLBACKPHONENUMBERReps() { 417 return this.getReps(14); 418 } 419 420 421 /** 422 * Inserts a repetition of 423 * ORC-14: "CALL BACK PHONE NUMBER" at a specific index 424 * 425 * @param rep The repetition index (0-indexed) 426 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 427 */ 428 public TN insertCALLBACKPHONENUMBER(int rep) throws HL7Exception { 429 return (TN) super.insertRepetition(14, rep); 430 } 431 432 433 /** 434 * Inserts a repetition of 435 * ORC-14: "CALL BACK PHONE NUMBER" at a specific index 436 * 437 * @param rep The repetition index (0-indexed) 438 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 439 */ 440 public TN insertOrc14_CALLBACKPHONENUMBER(int rep) throws HL7Exception { 441 return (TN) super.insertRepetition(14, rep); 442 } 443 444 445 /** 446 * Removes a repetition of 447 * ORC-14: "CALL BACK PHONE NUMBER" at a specific index 448 * 449 * @param rep The repetition index (0-indexed) 450 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 451 */ 452 public TN removeCALLBACKPHONENUMBER(int rep) throws HL7Exception { 453 return (TN) super.removeRepetition(14, rep); 454 } 455 456 457 /** 458 * Removes a repetition of 459 * ORC-14: "CALL BACK PHONE NUMBER" at a specific index 460 * 461 * @param rep The repetition index (0-indexed) 462 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 463 */ 464 public TN removeOrc14_CALLBACKPHONENUMBER(int rep) throws HL7Exception { 465 return (TN) super.removeRepetition(14, rep); 466 } 467 468 469 470 471 472 473 /** {@inheritDoc} */ 474 protected Type createNewTypeWithoutReflection(int field) { 475 switch (field) { 476 case 0: return new ST(getMessage()); 477 case 1: return new CM(getMessage()); 478 case 2: return new CM(getMessage()); 479 case 3: return new CM(getMessage()); 480 case 4: return new ST(getMessage()); 481 case 5: return new ST(getMessage()); 482 case 6: return new CM(getMessage()); 483 case 7: return new CM(getMessage()); 484 case 8: return new TS(getMessage()); 485 case 9: return new CN(getMessage()); 486 case 10: return new CN(getMessage()); 487 case 11: return new CN(getMessage()); 488 case 12: return new CM(getMessage()); 489 case 13: return new TN(getMessage()); 490 default: return null; 491 } 492 } 493 494 495} 496