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.v27.segment; 035 036// import ca.uhn.hl7v2.model.v27.group.*; 037import ca.uhn.hl7v2.model.v27.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 IIM message segment (Inventory Item Master). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>IIM-1: Primary Key Value - IIM (CWE) <b> </b> 053 * <li>IIM-2: Service Item Code (CWE) <b> </b> 054 * <li>IIM-3: Inventory Lot Number (ST) <b>optional </b> 055 * <li>IIM-4: Inventory Expiration Date (DTM) <b>optional </b> 056 * <li>IIM-5: Inventory Manufacturer Name (CWE) <b>optional </b> 057 * <li>IIM-6: Inventory Location (CWE) <b>optional </b> 058 * <li>IIM-7: Inventory Received Date (DTM) <b>optional </b> 059 * <li>IIM-8: Inventory Received Quantity (NM) <b>optional </b> 060 * <li>IIM-9: Inventory Received Quantity Unit (CWE) <b>optional </b> 061 * <li>IIM-10: Inventory Received Item Cost (MO) <b>optional </b> 062 * <li>IIM-11: Inventory On Hand Date (DTM) <b>optional </b> 063 * <li>IIM-12: Inventory On Hand Quantity (NM) <b>optional </b> 064 * <li>IIM-13: Inventory On Hand Quantity Unit (CWE) <b>optional </b> 065 * <li>IIM-14: Procedure Code (CNE) <b>optional </b> 066 * <li>IIM-15: Procedure Code Modifier (CNE) <b>optional repeating</b> 067 * </ul> 068 */ 069@SuppressWarnings("unused") 070public class IIM extends AbstractSegment { 071 072 /** 073 * Creates a new IIM segment 074 */ 075 public IIM(Group parent, ModelClassFactory factory) { 076 super(parent, factory); 077 init(factory); 078 } 079 080 private void init(ModelClassFactory factory) { 081 try { 082 this.add(CWE.class, true, 1, 0, new Object[]{ getMessage() }, "Primary Key Value - IIM"); 083 this.add(CWE.class, true, 1, 0, new Object[]{ getMessage() }, "Service Item Code"); 084 this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Lot Number"); 085 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Expiration Date"); 086 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Manufacturer Name"); 087 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Location"); 088 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Received Date"); 089 this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Received Quantity"); 090 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Received Quantity Unit"); 091 this.add(MO.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory Received Item Cost"); 092 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory On Hand Date"); 093 this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory On Hand Quantity"); 094 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Inventory On Hand Quantity Unit"); 095 this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "Procedure Code"); 096 this.add(CNE.class, false, 0, 0, new Object[]{ getMessage() }, "Procedure Code Modifier"); 097 } catch(HL7Exception e) { 098 log.error("Unexpected error creating IIM - this is probably a bug in the source code generator.", e); 099 } 100 } 101 102 103 104 /** 105 * Returns 106 * IIM-1: "Primary Key Value - IIM" - creates it if necessary 107 */ 108 public CWE getPrimaryKeyValueIIM() { 109 CWE retVal = this.getTypedField(1, 0); 110 return retVal; 111 } 112 113 /** 114 * Returns 115 * IIM-1: "Primary Key Value - IIM" - creates it if necessary 116 */ 117 public CWE getIim1_PrimaryKeyValueIIM() { 118 CWE retVal = this.getTypedField(1, 0); 119 return retVal; 120 } 121 122 123 124 /** 125 * Returns 126 * IIM-2: "Service Item Code" - creates it if necessary 127 */ 128 public CWE getServiceItemCode() { 129 CWE retVal = this.getTypedField(2, 0); 130 return retVal; 131 } 132 133 /** 134 * Returns 135 * IIM-2: "Service Item Code" - creates it if necessary 136 */ 137 public CWE getIim2_ServiceItemCode() { 138 CWE retVal = this.getTypedField(2, 0); 139 return retVal; 140 } 141 142 143 144 /** 145 * Returns 146 * IIM-3: "Inventory Lot Number" - creates it if necessary 147 */ 148 public ST getInventoryLotNumber() { 149 ST retVal = this.getTypedField(3, 0); 150 return retVal; 151 } 152 153 /** 154 * Returns 155 * IIM-3: "Inventory Lot Number" - creates it if necessary 156 */ 157 public ST getIim3_InventoryLotNumber() { 158 ST retVal = this.getTypedField(3, 0); 159 return retVal; 160 } 161 162 163 164 /** 165 * Returns 166 * IIM-4: "Inventory Expiration Date" - creates it if necessary 167 */ 168 public DTM getInventoryExpirationDate() { 169 DTM retVal = this.getTypedField(4, 0); 170 return retVal; 171 } 172 173 /** 174 * Returns 175 * IIM-4: "Inventory Expiration Date" - creates it if necessary 176 */ 177 public DTM getIim4_InventoryExpirationDate() { 178 DTM retVal = this.getTypedField(4, 0); 179 return retVal; 180 } 181 182 183 184 /** 185 * Returns 186 * IIM-5: "Inventory Manufacturer Name" - creates it if necessary 187 */ 188 public CWE getInventoryManufacturerName() { 189 CWE retVal = this.getTypedField(5, 0); 190 return retVal; 191 } 192 193 /** 194 * Returns 195 * IIM-5: "Inventory Manufacturer Name" - creates it if necessary 196 */ 197 public CWE getIim5_InventoryManufacturerName() { 198 CWE retVal = this.getTypedField(5, 0); 199 return retVal; 200 } 201 202 203 204 /** 205 * Returns 206 * IIM-6: "Inventory Location" - creates it if necessary 207 */ 208 public CWE getInventoryLocation() { 209 CWE retVal = this.getTypedField(6, 0); 210 return retVal; 211 } 212 213 /** 214 * Returns 215 * IIM-6: "Inventory Location" - creates it if necessary 216 */ 217 public CWE getIim6_InventoryLocation() { 218 CWE retVal = this.getTypedField(6, 0); 219 return retVal; 220 } 221 222 223 224 /** 225 * Returns 226 * IIM-7: "Inventory Received Date" - creates it if necessary 227 */ 228 public DTM getInventoryReceivedDate() { 229 DTM retVal = this.getTypedField(7, 0); 230 return retVal; 231 } 232 233 /** 234 * Returns 235 * IIM-7: "Inventory Received Date" - creates it if necessary 236 */ 237 public DTM getIim7_InventoryReceivedDate() { 238 DTM retVal = this.getTypedField(7, 0); 239 return retVal; 240 } 241 242 243 244 /** 245 * Returns 246 * IIM-8: "Inventory Received Quantity" - creates it if necessary 247 */ 248 public NM getInventoryReceivedQuantity() { 249 NM retVal = this.getTypedField(8, 0); 250 return retVal; 251 } 252 253 /** 254 * Returns 255 * IIM-8: "Inventory Received Quantity" - creates it if necessary 256 */ 257 public NM getIim8_InventoryReceivedQuantity() { 258 NM retVal = this.getTypedField(8, 0); 259 return retVal; 260 } 261 262 263 264 /** 265 * Returns 266 * IIM-9: "Inventory Received Quantity Unit" - creates it if necessary 267 */ 268 public CWE getInventoryReceivedQuantityUnit() { 269 CWE retVal = this.getTypedField(9, 0); 270 return retVal; 271 } 272 273 /** 274 * Returns 275 * IIM-9: "Inventory Received Quantity Unit" - creates it if necessary 276 */ 277 public CWE getIim9_InventoryReceivedQuantityUnit() { 278 CWE retVal = this.getTypedField(9, 0); 279 return retVal; 280 } 281 282 283 284 /** 285 * Returns 286 * IIM-10: "Inventory Received Item Cost" - creates it if necessary 287 */ 288 public MO getInventoryReceivedItemCost() { 289 MO retVal = this.getTypedField(10, 0); 290 return retVal; 291 } 292 293 /** 294 * Returns 295 * IIM-10: "Inventory Received Item Cost" - creates it if necessary 296 */ 297 public MO getIim10_InventoryReceivedItemCost() { 298 MO retVal = this.getTypedField(10, 0); 299 return retVal; 300 } 301 302 303 304 /** 305 * Returns 306 * IIM-11: "Inventory On Hand Date" - creates it if necessary 307 */ 308 public DTM getInventoryOnHandDate() { 309 DTM retVal = this.getTypedField(11, 0); 310 return retVal; 311 } 312 313 /** 314 * Returns 315 * IIM-11: "Inventory On Hand Date" - creates it if necessary 316 */ 317 public DTM getIim11_InventoryOnHandDate() { 318 DTM retVal = this.getTypedField(11, 0); 319 return retVal; 320 } 321 322 323 324 /** 325 * Returns 326 * IIM-12: "Inventory On Hand Quantity" - creates it if necessary 327 */ 328 public NM getInventoryOnHandQuantity() { 329 NM retVal = this.getTypedField(12, 0); 330 return retVal; 331 } 332 333 /** 334 * Returns 335 * IIM-12: "Inventory On Hand Quantity" - creates it if necessary 336 */ 337 public NM getIim12_InventoryOnHandQuantity() { 338 NM retVal = this.getTypedField(12, 0); 339 return retVal; 340 } 341 342 343 344 /** 345 * Returns 346 * IIM-13: "Inventory On Hand Quantity Unit" - creates it if necessary 347 */ 348 public CWE getInventoryOnHandQuantityUnit() { 349 CWE retVal = this.getTypedField(13, 0); 350 return retVal; 351 } 352 353 /** 354 * Returns 355 * IIM-13: "Inventory On Hand Quantity Unit" - creates it if necessary 356 */ 357 public CWE getIim13_InventoryOnHandQuantityUnit() { 358 CWE retVal = this.getTypedField(13, 0); 359 return retVal; 360 } 361 362 363 364 /** 365 * Returns 366 * IIM-14: "Procedure Code" - creates it if necessary 367 */ 368 public CNE getProcedureCode() { 369 CNE retVal = this.getTypedField(14, 0); 370 return retVal; 371 } 372 373 /** 374 * Returns 375 * IIM-14: "Procedure Code" - creates it if necessary 376 */ 377 public CNE getIim14_ProcedureCode() { 378 CNE retVal = this.getTypedField(14, 0); 379 return retVal; 380 } 381 382 383 /** 384 * Returns all repetitions of Procedure Code Modifier (IIM-15). 385 */ 386 public CNE[] getProcedureCodeModifier() { 387 CNE[] retVal = this.getTypedField(15, new CNE[0]); 388 return retVal; 389 } 390 391 392 /** 393 * Returns all repetitions of Procedure Code Modifier (IIM-15). 394 */ 395 public CNE[] getIim15_ProcedureCodeModifier() { 396 CNE[] retVal = this.getTypedField(15, new CNE[0]); 397 return retVal; 398 } 399 400 401 /** 402 * Returns a count of the current number of repetitions of Procedure Code Modifier (IIM-15). 403 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 404 * it will return zero. 405 */ 406 public int getProcedureCodeModifierReps() { 407 return this.getReps(15); 408 } 409 410 411 /** 412 * Returns a specific repetition of 413 * IIM-15: "Procedure Code Modifier" - creates it if necessary 414 * 415 * @param rep The repetition index (0-indexed) 416 */ 417 public CNE getProcedureCodeModifier(int rep) { 418 CNE retVal = this.getTypedField(15, rep); 419 return retVal; 420 } 421 422 /** 423 * Returns a specific repetition of 424 * IIM-15: "Procedure Code Modifier" - creates it if necessary 425 * 426 * @param rep The repetition index (0-indexed) 427 */ 428 public CNE getIim15_ProcedureCodeModifier(int rep) { 429 CNE retVal = this.getTypedField(15, rep); 430 return retVal; 431 } 432 433 /** 434 * Returns a count of the current number of repetitions of Procedure Code Modifier (IIM-15). 435 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 436 * it will return zero. 437 */ 438 public int getIim15_ProcedureCodeModifierReps() { 439 return this.getReps(15); 440 } 441 442 443 /** 444 * Inserts a repetition of 445 * IIM-15: "Procedure Code Modifier" at a specific index 446 * 447 * @param rep The repetition index (0-indexed) 448 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 449 */ 450 public CNE insertProcedureCodeModifier(int rep) throws HL7Exception { 451 return (CNE) super.insertRepetition(15, rep); 452 } 453 454 455 /** 456 * Inserts a repetition of 457 * IIM-15: "Procedure Code Modifier" at a specific index 458 * 459 * @param rep The repetition index (0-indexed) 460 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 461 */ 462 public CNE insertIim15_ProcedureCodeModifier(int rep) throws HL7Exception { 463 return (CNE) super.insertRepetition(15, rep); 464 } 465 466 467 /** 468 * Removes a repetition of 469 * IIM-15: "Procedure Code Modifier" at a specific index 470 * 471 * @param rep The repetition index (0-indexed) 472 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 473 */ 474 public CNE removeProcedureCodeModifier(int rep) throws HL7Exception { 475 return (CNE) super.removeRepetition(15, rep); 476 } 477 478 479 /** 480 * Removes a repetition of 481 * IIM-15: "Procedure Code Modifier" at a specific index 482 * 483 * @param rep The repetition index (0-indexed) 484 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 485 */ 486 public CNE removeIim15_ProcedureCodeModifier(int rep) throws HL7Exception { 487 return (CNE) super.removeRepetition(15, rep); 488 } 489 490 491 492 493 494 495 /** {@inheritDoc} */ 496 protected Type createNewTypeWithoutReflection(int field) { 497 switch (field) { 498 case 0: return new CWE(getMessage()); 499 case 1: return new CWE(getMessage()); 500 case 2: return new ST(getMessage()); 501 case 3: return new DTM(getMessage()); 502 case 4: return new CWE(getMessage()); 503 case 5: return new CWE(getMessage()); 504 case 6: return new DTM(getMessage()); 505 case 7: return new NM(getMessage()); 506 case 8: return new CWE(getMessage()); 507 case 9: return new MO(getMessage()); 508 case 10: return new DTM(getMessage()); 509 case 11: return new NM(getMessage()); 510 case 12: return new CWE(getMessage()); 511 case 13: return new CNE(getMessage()); 512 case 14: return new CNE(getMessage()); 513 default: return null; 514 } 515 } 516 517 518} 519