View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v25.segment;
35  
36  // import ca.uhn.hl7v2.model.v25.group.*;
37  import ca.uhn.hl7v2.model.v25.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 IIM message segment (Inventory Item Master). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>IIM-1: Primary Key Value - IIM (CWE) <b> </b>
53       * <li>IIM-2: Service Item Code (CWE) <b> </b>
54       * <li>IIM-3: Inventory Lot Number (ST) <b>optional </b>
55       * <li>IIM-4: Inventory Expiration Date (TS) <b>optional </b>
56       * <li>IIM-5: Inventory Manufacturer Name (CWE) <b>optional </b>
57       * <li>IIM-6: Inventory Location (CWE) <b>optional </b>
58       * <li>IIM-7: Inventory Received Date (TS) <b>optional </b>
59       * <li>IIM-8: Inventory Received Quantity (NM) <b>optional </b>
60       * <li>IIM-9: Inventory Received Quantity Unit (CWE) <b>optional </b>
61       * <li>IIM-10: Inventory Received Item Cost (MO) <b>optional </b>
62       * <li>IIM-11: Inventory On Hand Date (TS) <b>optional </b>
63       * <li>IIM-12: Inventory On Hand Quantity (NM) <b>optional </b>
64       * <li>IIM-13: Inventory On Hand Quantity Unit (CWE) <b>optional </b>
65       * <li>IIM-14: Procedure Code (CE) <b>optional </b>
66       * <li>IIM-15: Procedure Code Modifier (CE) <b>optional repeating</b>
67   * </ul>
68   */
69  @SuppressWarnings("unused")
70  public class IIM extends AbstractSegment {
71  
72      /** 
73       * Creates a new IIM segment
74       */
75      public IIM(Group parent, ModelClassFactory factory) {
76         super(parent, factory);
77         init(factory);
78      }
79  
80      private void init(ModelClassFactory factory) {
81         try {
82                                    this.add(CWE.class, true, 1, 250, new Object[]{ getMessage() }, "Primary Key Value - IIM");
83                                    this.add(CWE.class, true, 1, 250, new Object[]{ getMessage() }, "Service Item Code");
84                                    this.add(ST.class, false, 1, 250, new Object[]{ getMessage() }, "Inventory Lot Number");
85                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Inventory Expiration Date");
86                                    this.add(CWE.class, false, 1, 250, new Object[]{ getMessage() }, "Inventory Manufacturer Name");
87                                    this.add(CWE.class, false, 1, 250, new Object[]{ getMessage() }, "Inventory Location");
88                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Inventory Received Date");
89                                    this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "Inventory Received Quantity");
90                                    this.add(CWE.class, false, 1, 250, new Object[]{ getMessage() }, "Inventory Received Quantity Unit");
91                                    this.add(MO.class, false, 1, 12, new Object[]{ getMessage() }, "Inventory Received Item Cost");
92                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Inventory On Hand Date");
93                                    this.add(NM.class, false, 1, 12, new Object[]{ getMessage() }, "Inventory On Hand Quantity");
94                                    this.add(CWE.class, false, 1, 250, new Object[]{ getMessage() }, "Inventory On Hand Quantity Unit");
95                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Procedure Code");
96                                    this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Procedure Code Modifier");
97         } catch(HL7Exception e) {
98            log.error("Unexpected error creating IIM - this is probably a bug in the source code generator.", e);
99         }
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 TS getInventoryExpirationDate() { 
169 		TS 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 TS getIim4_InventoryExpirationDate() { 
178 		TS 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 TS getInventoryReceivedDate() { 
229 		TS 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 TS getIim7_InventoryReceivedDate() { 
238 		TS 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 TS getInventoryOnHandDate() { 
309 		TS 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 TS getIim11_InventoryOnHandDate() { 
318 		TS 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 CE getProcedureCode() { 
369 		CE 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 CE getIim14_ProcedureCode() { 
378 		CE 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 CE[] getProcedureCodeModifier() {
387     	CE[] retVal = this.getTypedField(15, new CE[0]);
388     	return retVal;
389     }
390 
391 
392     /**
393      * Returns all repetitions of Procedure Code Modifier (IIM-15).
394      */
395     public CE[] getIim15_ProcedureCodeModifier() {
396     	CE[] retVal = this.getTypedField(15, new CE[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 CE getProcedureCodeModifier(int rep) { 
418 		CE 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 CE getIim15_ProcedureCodeModifier(int rep) { 
429 		CE 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 CE insertProcedureCodeModifier(int rep) throws HL7Exception { 
451         return (CE) 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 CE insertIim15_ProcedureCodeModifier(int rep) throws HL7Exception { 
463         return (CE) 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 CE removeProcedureCodeModifier(int rep) throws HL7Exception { 
475         return (CE) 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 CE removeIim15_ProcedureCodeModifier(int rep) throws HL7Exception { 
487         return (CE) 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 TS(getMessage());
502           case 4: return new CWE(getMessage());
503           case 5: return new CWE(getMessage());
504           case 6: return new TS(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 TS(getMessage());
509           case 11: return new NM(getMessage());
510           case 12: return new CWE(getMessage());
511           case 13: return new CE(getMessage());
512           case 14: return new CE(getMessage());
513           default: return null;
514        }
515    }
516 
517 
518 }
519