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.v24.segment;
035
036// import ca.uhn.hl7v2.model.v24.group.*;
037import ca.uhn.hl7v2.model.v24.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 INV message segment (Inventory Detail). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>INV-1: Substance Identifier (CE) <b> </b>
052     * <li>INV-2: Substance Status (CE) <b> repeating</b>
053     * <li>INV-3: Substance Type (CE) <b>optional </b>
054     * <li>INV-4: Inventory Container Identifier (CE) <b>optional </b>
055     * <li>INV-5: Container Carrier Identifier (CE) <b>optional </b>
056     * <li>INV-6: Position on Carrier (CE) <b>optional </b>
057     * <li>INV-7: Initial Quantity (NM) <b>optional </b>
058     * <li>INV-8: Current Quantity (NM) <b>optional </b>
059     * <li>INV-9: Available Quantity (NM) <b>optional </b>
060     * <li>INV-10: Consumption Quantity (NM) <b>optional </b>
061     * <li>INV-11: Quantity Units (CE) <b>optional </b>
062     * <li>INV-12: Expiration Date/Time (TS) <b>optional </b>
063     * <li>INV-13: First Used Date/Time (TS) <b>optional </b>
064     * <li>INV-14: On Board Stability Duration (TQ) <b>optional </b>
065     * <li>INV-15: Test/Fluid Identifier(s) (CE) <b>optional repeating</b>
066     * <li>INV-16: Manufacturer Lot Number (ST) <b>optional </b>
067     * <li>INV-17: Manufacturer Identifier (CE) <b>optional </b>
068     * <li>INV-18: Supplier Identifier (CE) <b>optional </b>
069 * </ul>
070 */
071@SuppressWarnings("unused")
072public class INV extends AbstractSegment {
073
074    /** 
075     * Creates a new INV segment
076     */
077    public INV(Group parent, ModelClassFactory factory) {
078       super(parent, factory);
079       init(factory);
080    }
081
082    private void init(ModelClassFactory factory) {
083       try {
084                                  this.add(CE.class, true, 1, 250, new Object[]{ getMessage() }, "Substance Identifier");
085                                  this.add(CE.class, true, 0, 250, new Object[]{ getMessage() }, "Substance Status");
086                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Substance Type");
087                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Inventory Container Identifier");
088                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Container Carrier Identifier");
089                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Position on Carrier");
090                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Initial Quantity");
091                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Current Quantity");
092                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Available Quantity");
093                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Consumption Quantity");
094                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Quantity Units");
095                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expiration Date/Time");
096                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "First Used Date/Time");
097                                  this.add(TQ.class, false, 1, 200, new Object[]{ getMessage() }, "On Board Stability Duration");
098                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Test/Fluid Identifier(s)");
099                                  this.add(ST.class, false, 1, 200, new Object[]{ getMessage() }, "Manufacturer Lot Number");
100                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Manufacturer Identifier");
101                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Supplier Identifier");
102       } catch(HL7Exception e) {
103          log.error("Unexpected error creating INV - this is probably a bug in the source code generator.", e);
104       }
105    }
106
107
108
109    /**
110     * Returns
111     * INV-1: "Substance Identifier" - creates it if necessary
112     */
113    public CE getSubstanceIdentifier() { 
114                CE retVal = this.getTypedField(1, 0);
115                return retVal;
116    }
117    
118    /**
119     * Returns
120     * INV-1: "Substance Identifier" - creates it if necessary
121     */
122    public CE getInv1_SubstanceIdentifier() { 
123                CE retVal = this.getTypedField(1, 0);
124                return retVal;
125    }
126
127
128    /**
129     * Returns all repetitions of Substance Status (INV-2).
130     */
131    public CE[] getSubstanceStatus() {
132        CE[] retVal = this.getTypedField(2, new CE[0]);
133        return retVal;
134    }
135
136
137    /**
138     * Returns all repetitions of Substance Status (INV-2).
139     */
140    public CE[] getInv2_SubstanceStatus() {
141        CE[] retVal = this.getTypedField(2, new CE[0]);
142        return retVal;
143    }
144
145
146    /**
147     * Returns a count of the current number of repetitions of Substance Status (INV-2).
148     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
149     * it will return zero.
150     */
151    public int getSubstanceStatusReps() {
152        return this.getReps(2);
153    }
154
155
156    /**
157     * Returns a specific repetition of
158     * INV-2: "Substance Status" - creates it if necessary
159     *
160     * @param rep The repetition index (0-indexed)
161     */
162    public CE getSubstanceStatus(int rep) { 
163                CE retVal = this.getTypedField(2, rep);
164                return retVal;
165    }
166
167    /**
168     * Returns a specific repetition of
169     * INV-2: "Substance Status" - creates it if necessary
170     *
171     * @param rep The repetition index (0-indexed)
172     */
173    public CE getInv2_SubstanceStatus(int rep) { 
174                CE retVal = this.getTypedField(2, rep);
175                return retVal;
176    }
177
178    /**
179     * Returns a count of the current number of repetitions of Substance Status (INV-2).
180     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
181     * it will return zero.
182     */
183    public int getInv2_SubstanceStatusReps() {
184        return this.getReps(2);
185    }
186
187
188    /**
189     * Inserts a repetition of
190     * INV-2: "Substance Status" at a specific index
191     *
192     * @param rep The repetition index (0-indexed)
193     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
194     */
195    public CE insertSubstanceStatus(int rep) throws HL7Exception { 
196        return (CE) super.insertRepetition(2, rep);
197    }
198
199
200    /**
201     * Inserts a repetition of
202     * INV-2: "Substance Status" at a specific index
203     *
204     * @param rep The repetition index (0-indexed)
205     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
206     */
207    public CE insertInv2_SubstanceStatus(int rep) throws HL7Exception { 
208        return (CE) super.insertRepetition(2, rep);
209    }
210
211
212    /**
213     * Removes a repetition of
214     * INV-2: "Substance Status" at a specific index
215     *
216     * @param rep The repetition index (0-indexed)
217     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
218     */
219    public CE removeSubstanceStatus(int rep) throws HL7Exception { 
220        return (CE) super.removeRepetition(2, rep);
221    }
222
223
224    /**
225     * Removes a repetition of
226     * INV-2: "Substance Status" at a specific index
227     *
228     * @param rep The repetition index (0-indexed)
229     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
230     */
231    public CE removeInv2_SubstanceStatus(int rep) throws HL7Exception { 
232        return (CE) super.removeRepetition(2, rep);
233    }
234
235
236
237
238    /**
239     * Returns
240     * INV-3: "Substance Type" - creates it if necessary
241     */
242    public CE getSubstanceType() { 
243                CE retVal = this.getTypedField(3, 0);
244                return retVal;
245    }
246    
247    /**
248     * Returns
249     * INV-3: "Substance Type" - creates it if necessary
250     */
251    public CE getInv3_SubstanceType() { 
252                CE retVal = this.getTypedField(3, 0);
253                return retVal;
254    }
255
256
257
258    /**
259     * Returns
260     * INV-4: "Inventory Container Identifier" - creates it if necessary
261     */
262    public CE getInventoryContainerIdentifier() { 
263                CE retVal = this.getTypedField(4, 0);
264                return retVal;
265    }
266    
267    /**
268     * Returns
269     * INV-4: "Inventory Container Identifier" - creates it if necessary
270     */
271    public CE getInv4_InventoryContainerIdentifier() { 
272                CE retVal = this.getTypedField(4, 0);
273                return retVal;
274    }
275
276
277
278    /**
279     * Returns
280     * INV-5: "Container Carrier Identifier" - creates it if necessary
281     */
282    public CE getContainerCarrierIdentifier() { 
283                CE retVal = this.getTypedField(5, 0);
284                return retVal;
285    }
286    
287    /**
288     * Returns
289     * INV-5: "Container Carrier Identifier" - creates it if necessary
290     */
291    public CE getInv5_ContainerCarrierIdentifier() { 
292                CE retVal = this.getTypedField(5, 0);
293                return retVal;
294    }
295
296
297
298    /**
299     * Returns
300     * INV-6: "Position on Carrier" - creates it if necessary
301     */
302    public CE getPositionOnCarrier() { 
303                CE retVal = this.getTypedField(6, 0);
304                return retVal;
305    }
306    
307    /**
308     * Returns
309     * INV-6: "Position on Carrier" - creates it if necessary
310     */
311    public CE getInv6_PositionOnCarrier() { 
312                CE retVal = this.getTypedField(6, 0);
313                return retVal;
314    }
315
316
317
318    /**
319     * Returns
320     * INV-7: "Initial Quantity" - creates it if necessary
321     */
322    public NM getInitialQuantity() { 
323                NM retVal = this.getTypedField(7, 0);
324                return retVal;
325    }
326    
327    /**
328     * Returns
329     * INV-7: "Initial Quantity" - creates it if necessary
330     */
331    public NM getInv7_InitialQuantity() { 
332                NM retVal = this.getTypedField(7, 0);
333                return retVal;
334    }
335
336
337
338    /**
339     * Returns
340     * INV-8: "Current Quantity" - creates it if necessary
341     */
342    public NM getCurrentQuantity() { 
343                NM retVal = this.getTypedField(8, 0);
344                return retVal;
345    }
346    
347    /**
348     * Returns
349     * INV-8: "Current Quantity" - creates it if necessary
350     */
351    public NM getInv8_CurrentQuantity() { 
352                NM retVal = this.getTypedField(8, 0);
353                return retVal;
354    }
355
356
357
358    /**
359     * Returns
360     * INV-9: "Available Quantity" - creates it if necessary
361     */
362    public NM getAvailableQuantity() { 
363                NM retVal = this.getTypedField(9, 0);
364                return retVal;
365    }
366    
367    /**
368     * Returns
369     * INV-9: "Available Quantity" - creates it if necessary
370     */
371    public NM getInv9_AvailableQuantity() { 
372                NM retVal = this.getTypedField(9, 0);
373                return retVal;
374    }
375
376
377
378    /**
379     * Returns
380     * INV-10: "Consumption Quantity" - creates it if necessary
381     */
382    public NM getConsumptionQuantity() { 
383                NM retVal = this.getTypedField(10, 0);
384                return retVal;
385    }
386    
387    /**
388     * Returns
389     * INV-10: "Consumption Quantity" - creates it if necessary
390     */
391    public NM getInv10_ConsumptionQuantity() { 
392                NM retVal = this.getTypedField(10, 0);
393                return retVal;
394    }
395
396
397
398    /**
399     * Returns
400     * INV-11: "Quantity Units" - creates it if necessary
401     */
402    public CE getQuantityUnits() { 
403                CE retVal = this.getTypedField(11, 0);
404                return retVal;
405    }
406    
407    /**
408     * Returns
409     * INV-11: "Quantity Units" - creates it if necessary
410     */
411    public CE getInv11_QuantityUnits() { 
412                CE retVal = this.getTypedField(11, 0);
413                return retVal;
414    }
415
416
417
418    /**
419     * Returns
420     * INV-12: "Expiration Date/Time" - creates it if necessary
421     */
422    public TS getExpirationDateTime() { 
423                TS retVal = this.getTypedField(12, 0);
424                return retVal;
425    }
426    
427    /**
428     * Returns
429     * INV-12: "Expiration Date/Time" - creates it if necessary
430     */
431    public TS getInv12_ExpirationDateTime() { 
432                TS retVal = this.getTypedField(12, 0);
433                return retVal;
434    }
435
436
437
438    /**
439     * Returns
440     * INV-13: "First Used Date/Time" - creates it if necessary
441     */
442    public TS getFirstUsedDateTime() { 
443                TS retVal = this.getTypedField(13, 0);
444                return retVal;
445    }
446    
447    /**
448     * Returns
449     * INV-13: "First Used Date/Time" - creates it if necessary
450     */
451    public TS getInv13_FirstUsedDateTime() { 
452                TS retVal = this.getTypedField(13, 0);
453                return retVal;
454    }
455
456
457
458    /**
459     * Returns
460     * INV-14: "On Board Stability Duration" - creates it if necessary
461     */
462    public TQ getOnBoardStabilityDuration() { 
463                TQ retVal = this.getTypedField(14, 0);
464                return retVal;
465    }
466    
467    /**
468     * Returns
469     * INV-14: "On Board Stability Duration" - creates it if necessary
470     */
471    public TQ getInv14_OnBoardStabilityDuration() { 
472                TQ retVal = this.getTypedField(14, 0);
473                return retVal;
474    }
475
476
477    /**
478     * Returns all repetitions of Test/Fluid Identifier(s) (INV-15).
479     */
480    public CE[] getTestFluidIdentifierS() {
481        CE[] retVal = this.getTypedField(15, new CE[0]);
482        return retVal;
483    }
484
485
486    /**
487     * Returns all repetitions of Test/Fluid Identifier(s) (INV-15).
488     */
489    public CE[] getInv15_TestFluidIdentifierS() {
490        CE[] retVal = this.getTypedField(15, new CE[0]);
491        return retVal;
492    }
493
494
495    /**
496     * Returns a count of the current number of repetitions of Test/Fluid Identifier(s) (INV-15).
497     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
498     * it will return zero.
499     */
500    public int getTestFluidIdentifierSReps() {
501        return this.getReps(15);
502    }
503
504
505    /**
506     * Returns a specific repetition of
507     * INV-15: "Test/Fluid Identifier(s)" - creates it if necessary
508     *
509     * @param rep The repetition index (0-indexed)
510     */
511    public CE getTestFluidIdentifierS(int rep) { 
512                CE retVal = this.getTypedField(15, rep);
513                return retVal;
514    }
515
516    /**
517     * Returns a specific repetition of
518     * INV-15: "Test/Fluid Identifier(s)" - creates it if necessary
519     *
520     * @param rep The repetition index (0-indexed)
521     */
522    public CE getInv15_TestFluidIdentifierS(int rep) { 
523                CE retVal = this.getTypedField(15, rep);
524                return retVal;
525    }
526
527    /**
528     * Returns a count of the current number of repetitions of Test/Fluid Identifier(s) (INV-15).
529     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
530     * it will return zero.
531     */
532    public int getInv15_TestFluidIdentifierSReps() {
533        return this.getReps(15);
534    }
535
536
537    /**
538     * Inserts a repetition of
539     * INV-15: "Test/Fluid Identifier(s)" at a specific index
540     *
541     * @param rep The repetition index (0-indexed)
542     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
543     */
544    public CE insertTestFluidIdentifierS(int rep) throws HL7Exception { 
545        return (CE) super.insertRepetition(15, rep);
546    }
547
548
549    /**
550     * Inserts a repetition of
551     * INV-15: "Test/Fluid Identifier(s)" at a specific index
552     *
553     * @param rep The repetition index (0-indexed)
554     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
555     */
556    public CE insertInv15_TestFluidIdentifierS(int rep) throws HL7Exception { 
557        return (CE) super.insertRepetition(15, rep);
558    }
559
560
561    /**
562     * Removes a repetition of
563     * INV-15: "Test/Fluid Identifier(s)" at a specific index
564     *
565     * @param rep The repetition index (0-indexed)
566     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
567     */
568    public CE removeTestFluidIdentifierS(int rep) throws HL7Exception { 
569        return (CE) super.removeRepetition(15, rep);
570    }
571
572
573    /**
574     * Removes a repetition of
575     * INV-15: "Test/Fluid Identifier(s)" at a specific index
576     *
577     * @param rep The repetition index (0-indexed)
578     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
579     */
580    public CE removeInv15_TestFluidIdentifierS(int rep) throws HL7Exception { 
581        return (CE) super.removeRepetition(15, rep);
582    }
583
584
585
586
587    /**
588     * Returns
589     * INV-16: "Manufacturer Lot Number" - creates it if necessary
590     */
591    public ST getManufacturerLotNumber() { 
592                ST retVal = this.getTypedField(16, 0);
593                return retVal;
594    }
595    
596    /**
597     * Returns
598     * INV-16: "Manufacturer Lot Number" - creates it if necessary
599     */
600    public ST getInv16_ManufacturerLotNumber() { 
601                ST retVal = this.getTypedField(16, 0);
602                return retVal;
603    }
604
605
606
607    /**
608     * Returns
609     * INV-17: "Manufacturer Identifier" - creates it if necessary
610     */
611    public CE getManufacturerIdentifier() { 
612                CE retVal = this.getTypedField(17, 0);
613                return retVal;
614    }
615    
616    /**
617     * Returns
618     * INV-17: "Manufacturer Identifier" - creates it if necessary
619     */
620    public CE getInv17_ManufacturerIdentifier() { 
621                CE retVal = this.getTypedField(17, 0);
622                return retVal;
623    }
624
625
626
627    /**
628     * Returns
629     * INV-18: "Supplier Identifier" - creates it if necessary
630     */
631    public CE getSupplierIdentifier() { 
632                CE retVal = this.getTypedField(18, 0);
633                return retVal;
634    }
635    
636    /**
637     * Returns
638     * INV-18: "Supplier Identifier" - creates it if necessary
639     */
640    public CE getInv18_SupplierIdentifier() { 
641                CE retVal = this.getTypedField(18, 0);
642                return retVal;
643    }
644
645
646
647
648
649    /** {@inheritDoc} */   
650    protected Type createNewTypeWithoutReflection(int field) {
651       switch (field) {
652          case 0: return new CE(getMessage());
653          case 1: return new CE(getMessage());
654          case 2: return new CE(getMessage());
655          case 3: return new CE(getMessage());
656          case 4: return new CE(getMessage());
657          case 5: return new CE(getMessage());
658          case 6: return new NM(getMessage());
659          case 7: return new NM(getMessage());
660          case 8: return new NM(getMessage());
661          case 9: return new NM(getMessage());
662          case 10: return new CE(getMessage());
663          case 11: return new TS(getMessage());
664          case 12: return new TS(getMessage());
665          case 13: return new TQ(getMessage());
666          case 14: return new CE(getMessage());
667          case 15: return new ST(getMessage());
668          case 16: return new CE(getMessage());
669          case 17: return new CE(getMessage());
670          default: return null;
671       }
672   }
673
674
675}
676