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 INV message segment (Inventory Detail). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>INV-1: Substance Identifier (CE) <b> </b>
53       * <li>INV-2: Substance Status (CE) <b> repeating</b>
54       * <li>INV-3: Substance Type (CE) <b>optional </b>
55       * <li>INV-4: Inventory Container Identifier (CE) <b>optional </b>
56       * <li>INV-5: Container Carrier Identifier (CE) <b>optional </b>
57       * <li>INV-6: Position on Carrier (CE) <b>optional </b>
58       * <li>INV-7: Initial Quantity (NM) <b>optional </b>
59       * <li>INV-8: Current Quantity (NM) <b>optional </b>
60       * <li>INV-9: Available Quantity (NM) <b>optional </b>
61       * <li>INV-10: Consumption Quantity (NM) <b>optional </b>
62       * <li>INV-11: Quantity Units (CE) <b>optional </b>
63       * <li>INV-12: Expiration Date/Time (TS) <b>optional </b>
64       * <li>INV-13: First Used Date/Time (TS) <b>optional </b>
65       * <li>INV-14: On Board Stability Duration (TQ) <b>optional </b>
66       * <li>INV-15: Test/Fluid Identifier(s) (CE) <b>optional repeating</b>
67       * <li>INV-16: Manufacturer Lot Number (ST) <b>optional </b>
68       * <li>INV-17: Manufacturer Identifier (CE) <b>optional </b>
69       * <li>INV-18: Supplier Identifier (CE) <b>optional </b>
70       * <li>INV-19: On Board Stability Time (CQ) <b>optional </b>
71       * <li>INV-20: Target Value (CQ) <b>optional </b>
72   * </ul>
73   */
74  @SuppressWarnings("unused")
75  public class INV extends AbstractSegment {
76  
77      /** 
78       * Creates a new INV segment
79       */
80      public INV(Group parent, ModelClassFactory factory) {
81         super(parent, factory);
82         init(factory);
83      }
84  
85      private void init(ModelClassFactory factory) {
86         try {
87                                    this.add(CE.class, true, 1, 250, new Object[]{ getMessage() }, "Substance Identifier");
88                                    this.add(CE.class, true, 0, 250, new Object[]{ getMessage() }, "Substance Status");
89                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Substance Type");
90                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Inventory Container Identifier");
91                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Container Carrier Identifier");
92                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Position on Carrier");
93                                    this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Initial Quantity");
94                                    this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Current Quantity");
95                                    this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Available Quantity");
96                                    this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Consumption Quantity");
97                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Quantity Units");
98                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expiration Date/Time");
99                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "First Used Date/Time");
100                                   this.add(TQ.class, false, 1, 200, new Object[]{ getMessage() }, "On Board Stability Duration");
101                                   this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Test/Fluid Identifier(s)");
102                                   this.add(ST.class, false, 1, 200, new Object[]{ getMessage() }, "Manufacturer Lot Number");
103                                   this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Manufacturer Identifier");
104                                   this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Supplier Identifier");
105                                   this.add(CQ.class, false, 1, 20, new Object[]{ getMessage() }, "On Board Stability Time");
106                                   this.add(CQ.class, false, 1, 20, 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 CE getSubstanceIdentifier() { 
119 		CE 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 CE getInv1_SubstanceIdentifier() { 
128 		CE retVal = this.getTypedField(1, 0);
129 		return retVal;
130     }
131 
132 
133     /**
134      * Returns all repetitions of Substance Status (INV-2).
135      */
136     public CE[] getSubstanceStatus() {
137     	CE[] retVal = this.getTypedField(2, new CE[0]);
138     	return retVal;
139     }
140 
141 
142     /**
143      * Returns all repetitions of Substance Status (INV-2).
144      */
145     public CE[] getInv2_SubstanceStatus() {
146     	CE[] retVal = this.getTypedField(2, new CE[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 CE getSubstanceStatus(int rep) { 
168 		CE 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 CE getInv2_SubstanceStatus(int rep) { 
179 		CE 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 CE insertSubstanceStatus(int rep) throws HL7Exception { 
201         return (CE) 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 CE insertInv2_SubstanceStatus(int rep) throws HL7Exception { 
213         return (CE) 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 CE removeSubstanceStatus(int rep) throws HL7Exception { 
225         return (CE) 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 CE removeInv2_SubstanceStatus(int rep) throws HL7Exception { 
237         return (CE) super.removeRepetition(2, rep);
238     }
239 
240 
241 
242 
243     /**
244      * Returns
245      * INV-3: "Substance Type" - creates it if necessary
246      */
247     public CE getSubstanceType() { 
248 		CE 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 CE getInv3_SubstanceType() { 
257 		CE 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 CE getInventoryContainerIdentifier() { 
268 		CE 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 CE getInv4_InventoryContainerIdentifier() { 
277 		CE 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 CE getContainerCarrierIdentifier() { 
288 		CE 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 CE getInv5_ContainerCarrierIdentifier() { 
297 		CE 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 CE getPositionOnCarrier() { 
308 		CE 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 CE getInv6_PositionOnCarrier() { 
317 		CE 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 CE getQuantityUnits() { 
408 		CE 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 CE getInv11_QuantityUnits() { 
417 		CE 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 TS getExpirationDateTime() { 
428 		TS 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 TS getInv12_ExpirationDateTime() { 
437 		TS 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 TS getFirstUsedDateTime() { 
448 		TS 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 TS getInv13_FirstUsedDateTime() { 
457 		TS 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 TQ getOnBoardStabilityDuration() { 
468 		TQ 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 TQ getInv14_OnBoardStabilityDuration() { 
477 		TQ 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 CE[] getTestFluidIdentifierS() {
486     	CE[] retVal = this.getTypedField(15, new CE[0]);
487     	return retVal;
488     }
489 
490 
491     /**
492      * Returns all repetitions of Test/Fluid Identifier(s) (INV-15).
493      */
494     public CE[] getInv15_TestFluidIdentifierS() {
495     	CE[] retVal = this.getTypedField(15, new CE[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 CE getTestFluidIdentifierS(int rep) { 
517 		CE 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 CE getInv15_TestFluidIdentifierS(int rep) { 
528 		CE 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 CE insertTestFluidIdentifierS(int rep) throws HL7Exception { 
550         return (CE) 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 CE insertInv15_TestFluidIdentifierS(int rep) throws HL7Exception { 
562         return (CE) 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 CE removeTestFluidIdentifierS(int rep) throws HL7Exception { 
574         return (CE) 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 CE removeInv15_TestFluidIdentifierS(int rep) throws HL7Exception { 
586         return (CE) 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 CE getManufacturerIdentifier() { 
617 		CE 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 CE getInv17_ManufacturerIdentifier() { 
626 		CE 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 CE getSupplierIdentifier() { 
637 		CE 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 CE getInv18_SupplierIdentifier() { 
646 		CE 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 CE(getMessage());
698           case 1: return new CE(getMessage());
699           case 2: return new CE(getMessage());
700           case 3: return new CE(getMessage());
701           case 4: return new CE(getMessage());
702           case 5: return new CE(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 CE(getMessage());
708           case 11: return new TS(getMessage());
709           case 12: return new TS(getMessage());
710           case 13: return new TQ(getMessage());
711           case 14: return new CE(getMessage());
712           case 15: return new ST(getMessage());
713           case 16: return new CE(getMessage());
714           case 17: return new CE(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