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