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