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