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.v23.segment;
035
036// import ca.uhn.hl7v2.model.v23.group.*;
037import ca.uhn.hl7v2.model.v23.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 RXG message segment (Pharmacy give segment). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>RXG-1: Give Sub-ID Counter (ID) <b>optional </b>
052     * <li>RXG-2: Dispense Sub-ID Counter (NM) <b> </b>
053     * <li>RXG-3: Quantity/Timing (TQ) <b> </b>
054     * <li>RXG-4: Give Code (CE) <b> </b>
055     * <li>RXG-5: Give Amount - Minimum (NM) <b> </b>
056     * <li>RXG-6: Give Amount - Maximum (NM) <b>optional </b>
057     * <li>RXG-7: Give Units (CE) <b> </b>
058     * <li>RXG-8: Give Dosage Form (CE) <b>optional </b>
059     * <li>RXG-9: Administration Notes (CE) <b>optional repeating</b>
060     * <li>RXG-10: Substitution Status (ID) <b>optional </b>
061     * <li>RXG-11: Dispense-To Location (CM_LA1) <b>optional </b>
062     * <li>RXG-12: Needs Human Review (ID) <b>optional </b>
063     * <li>RXG-13: Pharmacy Special Administration Instructions (CE) <b>optional </b>
064     * <li>RXG-14: Give Per (Time Unit) (ST) <b>optional </b>
065     * <li>RXG-15: Give Rate Amount (ST) <b>optional </b>
066     * <li>RXG-16: Give Rate Units (CE) <b>optional </b>
067     * <li>RXG-17: Give Strength (NM) <b>optional </b>
068     * <li>RXG-18: Give Strength Units (CE) <b>optional </b>
069     * <li>RXG-19: Substance Lot Number (ST) <b>optional repeating</b>
070     * <li>RXG-20: Substance Expiration Date (TS) <b>optional repeating</b>
071     * <li>RXG-21: Substance Manufacturer Name (CE) <b>optional repeating</b>
072     * <li>RXG-22: Indication (CE) <b>optional </b>
073 * </ul>
074 */
075@SuppressWarnings("unused")
076public class RXG extends AbstractSegment {
077
078    /** 
079     * Creates a new RXG segment
080     */
081    public RXG(Group parent, ModelClassFactory factory) {
082       super(parent, factory);
083       init(factory);
084    }
085
086    private void init(ModelClassFactory factory) {
087       try {
088                                              this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Give Sub-ID Counter");
089                                  this.add(NM.class, true, 1, 4, new Object[]{ getMessage() }, "Dispense Sub-ID Counter");
090                                  this.add(TQ.class, true, 1, 200, new Object[]{ getMessage() }, "Quantity/Timing");
091                                  this.add(CE.class, true, 1, 100, new Object[]{ getMessage() }, "Give Code");
092                                  this.add(NM.class, true, 1, 20, new Object[]{ getMessage() }, "Give Amount - Minimum");
093                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Give Amount - Maximum");
094                                  this.add(CE.class, true, 1, 60, new Object[]{ getMessage() }, "Give Units");
095                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Give Dosage Form");
096                                  this.add(CE.class, false, 0, 200, new Object[]{ getMessage() }, "Administration Notes");
097                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(167) }, "Substitution Status");
098                                  this.add(CM_LA1.class, false, 1, 200, new Object[]{ getMessage() }, "Dispense-To Location");
099                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Needs Human Review");
100                                  this.add(CE.class, false, 1, 200, new Object[]{ getMessage() }, "Pharmacy Special Administration Instructions");
101                                  this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "Give Per (Time Unit)");
102                                  this.add(ST.class, false, 1, 6, new Object[]{ getMessage() }, "Give Rate Amount");
103                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Give Rate Units");
104                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Give Strength");
105                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Give Strength Units");
106                                  this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "Substance Lot Number");
107                                  this.add(TS.class, false, 0, 26, new Object[]{ getMessage() }, "Substance Expiration Date");
108                                  this.add(CE.class, false, 0, 60, new Object[]{ getMessage() }, "Substance Manufacturer Name");
109                                  this.add(CE.class, false, 1, 200, new Object[]{ getMessage() }, "Indication");
110       } catch(HL7Exception e) {
111          log.error("Unexpected error creating RXG - this is probably a bug in the source code generator.", e);
112       }
113    }
114
115
116
117    /**
118     * Returns
119     * RXG-1: "Give Sub-ID Counter" - creates it if necessary
120     */
121    public ID getGiveSubIDCounter() { 
122                ID retVal = this.getTypedField(1, 0);
123                return retVal;
124    }
125    
126    /**
127     * Returns
128     * RXG-1: "Give Sub-ID Counter" - creates it if necessary
129     */
130    public ID getRxg1_GiveSubIDCounter() { 
131                ID retVal = this.getTypedField(1, 0);
132                return retVal;
133    }
134
135
136
137    /**
138     * Returns
139     * RXG-2: "Dispense Sub-ID Counter" - creates it if necessary
140     */
141    public NM getDispenseSubIDCounter() { 
142                NM retVal = this.getTypedField(2, 0);
143                return retVal;
144    }
145    
146    /**
147     * Returns
148     * RXG-2: "Dispense Sub-ID Counter" - creates it if necessary
149     */
150    public NM getRxg2_DispenseSubIDCounter() { 
151                NM retVal = this.getTypedField(2, 0);
152                return retVal;
153    }
154
155
156
157    /**
158     * Returns
159     * RXG-3: "Quantity/Timing" - creates it if necessary
160     */
161    public TQ getQuantityTiming() { 
162                TQ retVal = this.getTypedField(3, 0);
163                return retVal;
164    }
165    
166    /**
167     * Returns
168     * RXG-3: "Quantity/Timing" - creates it if necessary
169     */
170    public TQ getRxg3_QuantityTiming() { 
171                TQ retVal = this.getTypedField(3, 0);
172                return retVal;
173    }
174
175
176
177    /**
178     * Returns
179     * RXG-4: "Give Code" - creates it if necessary
180     */
181    public CE getGiveCode() { 
182                CE retVal = this.getTypedField(4, 0);
183                return retVal;
184    }
185    
186    /**
187     * Returns
188     * RXG-4: "Give Code" - creates it if necessary
189     */
190    public CE getRxg4_GiveCode() { 
191                CE retVal = this.getTypedField(4, 0);
192                return retVal;
193    }
194
195
196
197    /**
198     * Returns
199     * RXG-5: "Give Amount - Minimum" - creates it if necessary
200     */
201    public NM getGiveAmountMinimum() { 
202                NM retVal = this.getTypedField(5, 0);
203                return retVal;
204    }
205    
206    /**
207     * Returns
208     * RXG-5: "Give Amount - Minimum" - creates it if necessary
209     */
210    public NM getRxg5_GiveAmountMinimum() { 
211                NM retVal = this.getTypedField(5, 0);
212                return retVal;
213    }
214
215
216
217    /**
218     * Returns
219     * RXG-6: "Give Amount - Maximum" - creates it if necessary
220     */
221    public NM getGiveAmountMaximum() { 
222                NM retVal = this.getTypedField(6, 0);
223                return retVal;
224    }
225    
226    /**
227     * Returns
228     * RXG-6: "Give Amount - Maximum" - creates it if necessary
229     */
230    public NM getRxg6_GiveAmountMaximum() { 
231                NM retVal = this.getTypedField(6, 0);
232                return retVal;
233    }
234
235
236
237    /**
238     * Returns
239     * RXG-7: "Give Units" - creates it if necessary
240     */
241    public CE getGiveUnits() { 
242                CE retVal = this.getTypedField(7, 0);
243                return retVal;
244    }
245    
246    /**
247     * Returns
248     * RXG-7: "Give Units" - creates it if necessary
249     */
250    public CE getRxg7_GiveUnits() { 
251                CE retVal = this.getTypedField(7, 0);
252                return retVal;
253    }
254
255
256
257    /**
258     * Returns
259     * RXG-8: "Give Dosage Form" - creates it if necessary
260     */
261    public CE getGiveDosageForm() { 
262                CE retVal = this.getTypedField(8, 0);
263                return retVal;
264    }
265    
266    /**
267     * Returns
268     * RXG-8: "Give Dosage Form" - creates it if necessary
269     */
270    public CE getRxg8_GiveDosageForm() { 
271                CE retVal = this.getTypedField(8, 0);
272                return retVal;
273    }
274
275
276    /**
277     * Returns all repetitions of Administration Notes (RXG-9).
278     */
279    public CE[] getAdministrationNotes() {
280        CE[] retVal = this.getTypedField(9, new CE[0]);
281        return retVal;
282    }
283
284
285    /**
286     * Returns all repetitions of Administration Notes (RXG-9).
287     */
288    public CE[] getRxg9_AdministrationNotes() {
289        CE[] retVal = this.getTypedField(9, new CE[0]);
290        return retVal;
291    }
292
293
294    /**
295     * Returns a count of the current number of repetitions of Administration Notes (RXG-9).
296     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
297     * it will return zero.
298     */
299    public int getAdministrationNotesReps() {
300        return this.getReps(9);
301    }
302
303
304    /**
305     * Returns a specific repetition of
306     * RXG-9: "Administration Notes" - creates it if necessary
307     *
308     * @param rep The repetition index (0-indexed)
309     */
310    public CE getAdministrationNotes(int rep) { 
311                CE retVal = this.getTypedField(9, rep);
312                return retVal;
313    }
314
315    /**
316     * Returns a specific repetition of
317     * RXG-9: "Administration Notes" - creates it if necessary
318     *
319     * @param rep The repetition index (0-indexed)
320     */
321    public CE getRxg9_AdministrationNotes(int rep) { 
322                CE retVal = this.getTypedField(9, rep);
323                return retVal;
324    }
325
326    /**
327     * Returns a count of the current number of repetitions of Administration Notes (RXG-9).
328     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
329     * it will return zero.
330     */
331    public int getRxg9_AdministrationNotesReps() {
332        return this.getReps(9);
333    }
334
335
336    /**
337     * Inserts a repetition of
338     * RXG-9: "Administration Notes" at a specific index
339     *
340     * @param rep The repetition index (0-indexed)
341     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
342     */
343    public CE insertAdministrationNotes(int rep) throws HL7Exception { 
344        return (CE) super.insertRepetition(9, rep);
345    }
346
347
348    /**
349     * Inserts a repetition of
350     * RXG-9: "Administration Notes" at a specific index
351     *
352     * @param rep The repetition index (0-indexed)
353     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
354     */
355    public CE insertRxg9_AdministrationNotes(int rep) throws HL7Exception { 
356        return (CE) super.insertRepetition(9, rep);
357    }
358
359
360    /**
361     * Removes a repetition of
362     * RXG-9: "Administration Notes" at a specific index
363     *
364     * @param rep The repetition index (0-indexed)
365     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
366     */
367    public CE removeAdministrationNotes(int rep) throws HL7Exception { 
368        return (CE) super.removeRepetition(9, rep);
369    }
370
371
372    /**
373     * Removes a repetition of
374     * RXG-9: "Administration Notes" at a specific index
375     *
376     * @param rep The repetition index (0-indexed)
377     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
378     */
379    public CE removeRxg9_AdministrationNotes(int rep) throws HL7Exception { 
380        return (CE) super.removeRepetition(9, rep);
381    }
382
383
384
385
386    /**
387     * Returns
388     * RXG-10: "Substitution Status" - creates it if necessary
389     */
390    public ID getSubstitutionStatus() { 
391                ID retVal = this.getTypedField(10, 0);
392                return retVal;
393    }
394    
395    /**
396     * Returns
397     * RXG-10: "Substitution Status" - creates it if necessary
398     */
399    public ID getRxg10_SubstitutionStatus() { 
400                ID retVal = this.getTypedField(10, 0);
401                return retVal;
402    }
403
404
405
406    /**
407     * Returns
408     * RXG-11: "Dispense-To Location" - creates it if necessary
409     */
410    public CM_LA1 getDispenseToLocation() { 
411                CM_LA1 retVal = this.getTypedField(11, 0);
412                return retVal;
413    }
414    
415    /**
416     * Returns
417     * RXG-11: "Dispense-To Location" - creates it if necessary
418     */
419    public CM_LA1 getRxg11_DispenseToLocation() { 
420                CM_LA1 retVal = this.getTypedField(11, 0);
421                return retVal;
422    }
423
424
425
426    /**
427     * Returns
428     * RXG-12: "Needs Human Review" - creates it if necessary
429     */
430    public ID getNeedsHumanReview() { 
431                ID retVal = this.getTypedField(12, 0);
432                return retVal;
433    }
434    
435    /**
436     * Returns
437     * RXG-12: "Needs Human Review" - creates it if necessary
438     */
439    public ID getRxg12_NeedsHumanReview() { 
440                ID retVal = this.getTypedField(12, 0);
441                return retVal;
442    }
443
444
445
446    /**
447     * Returns
448     * RXG-13: "Pharmacy Special Administration Instructions" - creates it if necessary
449     */
450    public CE getPharmacySpecialAdministrationInstructions() { 
451                CE retVal = this.getTypedField(13, 0);
452                return retVal;
453    }
454    
455    /**
456     * Returns
457     * RXG-13: "Pharmacy Special Administration Instructions" - creates it if necessary
458     */
459    public CE getRxg13_PharmacySpecialAdministrationInstructions() { 
460                CE retVal = this.getTypedField(13, 0);
461                return retVal;
462    }
463
464
465
466    /**
467     * Returns
468     * RXG-14: "Give Per (Time Unit)" - creates it if necessary
469     */
470    public ST getGivePerTimeUnit() { 
471                ST retVal = this.getTypedField(14, 0);
472                return retVal;
473    }
474    
475    /**
476     * Returns
477     * RXG-14: "Give Per (Time Unit)" - creates it if necessary
478     */
479    public ST getRxg14_GivePerTimeUnit() { 
480                ST retVal = this.getTypedField(14, 0);
481                return retVal;
482    }
483
484
485
486    /**
487     * Returns
488     * RXG-15: "Give Rate Amount" - creates it if necessary
489     */
490    public ST getGiveRateAmount() { 
491                ST retVal = this.getTypedField(15, 0);
492                return retVal;
493    }
494    
495    /**
496     * Returns
497     * RXG-15: "Give Rate Amount" - creates it if necessary
498     */
499    public ST getRxg15_GiveRateAmount() { 
500                ST retVal = this.getTypedField(15, 0);
501                return retVal;
502    }
503
504
505
506    /**
507     * Returns
508     * RXG-16: "Give Rate Units" - creates it if necessary
509     */
510    public CE getGiveRateUnits() { 
511                CE retVal = this.getTypedField(16, 0);
512                return retVal;
513    }
514    
515    /**
516     * Returns
517     * RXG-16: "Give Rate Units" - creates it if necessary
518     */
519    public CE getRxg16_GiveRateUnits() { 
520                CE retVal = this.getTypedField(16, 0);
521                return retVal;
522    }
523
524
525
526    /**
527     * Returns
528     * RXG-17: "Give Strength" - creates it if necessary
529     */
530    public NM getGiveStrength() { 
531                NM retVal = this.getTypedField(17, 0);
532                return retVal;
533    }
534    
535    /**
536     * Returns
537     * RXG-17: "Give Strength" - creates it if necessary
538     */
539    public NM getRxg17_GiveStrength() { 
540                NM retVal = this.getTypedField(17, 0);
541                return retVal;
542    }
543
544
545
546    /**
547     * Returns
548     * RXG-18: "Give Strength Units" - creates it if necessary
549     */
550    public CE getGiveStrengthUnits() { 
551                CE retVal = this.getTypedField(18, 0);
552                return retVal;
553    }
554    
555    /**
556     * Returns
557     * RXG-18: "Give Strength Units" - creates it if necessary
558     */
559    public CE getRxg18_GiveStrengthUnits() { 
560                CE retVal = this.getTypedField(18, 0);
561                return retVal;
562    }
563
564
565    /**
566     * Returns all repetitions of Substance Lot Number (RXG-19).
567     */
568    public ST[] getSubstanceLotNumber() {
569        ST[] retVal = this.getTypedField(19, new ST[0]);
570        return retVal;
571    }
572
573
574    /**
575     * Returns all repetitions of Substance Lot Number (RXG-19).
576     */
577    public ST[] getRxg19_SubstanceLotNumber() {
578        ST[] retVal = this.getTypedField(19, new ST[0]);
579        return retVal;
580    }
581
582
583    /**
584     * Returns a count of the current number of repetitions of Substance Lot Number (RXG-19).
585     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
586     * it will return zero.
587     */
588    public int getSubstanceLotNumberReps() {
589        return this.getReps(19);
590    }
591
592
593    /**
594     * Returns a specific repetition of
595     * RXG-19: "Substance Lot Number" - creates it if necessary
596     *
597     * @param rep The repetition index (0-indexed)
598     */
599    public ST getSubstanceLotNumber(int rep) { 
600                ST retVal = this.getTypedField(19, rep);
601                return retVal;
602    }
603
604    /**
605     * Returns a specific repetition of
606     * RXG-19: "Substance Lot Number" - creates it if necessary
607     *
608     * @param rep The repetition index (0-indexed)
609     */
610    public ST getRxg19_SubstanceLotNumber(int rep) { 
611                ST retVal = this.getTypedField(19, rep);
612                return retVal;
613    }
614
615    /**
616     * Returns a count of the current number of repetitions of Substance Lot Number (RXG-19).
617     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
618     * it will return zero.
619     */
620    public int getRxg19_SubstanceLotNumberReps() {
621        return this.getReps(19);
622    }
623
624
625    /**
626     * Inserts a repetition of
627     * RXG-19: "Substance Lot Number" at a specific index
628     *
629     * @param rep The repetition index (0-indexed)
630     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
631     */
632    public ST insertSubstanceLotNumber(int rep) throws HL7Exception { 
633        return (ST) super.insertRepetition(19, rep);
634    }
635
636
637    /**
638     * Inserts a repetition of
639     * RXG-19: "Substance Lot Number" at a specific index
640     *
641     * @param rep The repetition index (0-indexed)
642     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
643     */
644    public ST insertRxg19_SubstanceLotNumber(int rep) throws HL7Exception { 
645        return (ST) super.insertRepetition(19, rep);
646    }
647
648
649    /**
650     * Removes a repetition of
651     * RXG-19: "Substance Lot Number" at a specific index
652     *
653     * @param rep The repetition index (0-indexed)
654     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
655     */
656    public ST removeSubstanceLotNumber(int rep) throws HL7Exception { 
657        return (ST) super.removeRepetition(19, rep);
658    }
659
660
661    /**
662     * Removes a repetition of
663     * RXG-19: "Substance Lot Number" at a specific index
664     *
665     * @param rep The repetition index (0-indexed)
666     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
667     */
668    public ST removeRxg19_SubstanceLotNumber(int rep) throws HL7Exception { 
669        return (ST) super.removeRepetition(19, rep);
670    }
671
672
673
674    /**
675     * Returns all repetitions of Substance Expiration Date (RXG-20).
676     */
677    public TS[] getSubstanceExpirationDate() {
678        TS[] retVal = this.getTypedField(20, new TS[0]);
679        return retVal;
680    }
681
682
683    /**
684     * Returns all repetitions of Substance Expiration Date (RXG-20).
685     */
686    public TS[] getRxg20_SubstanceExpirationDate() {
687        TS[] retVal = this.getTypedField(20, new TS[0]);
688        return retVal;
689    }
690
691
692    /**
693     * Returns a count of the current number of repetitions of Substance Expiration Date (RXG-20).
694     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
695     * it will return zero.
696     */
697    public int getSubstanceExpirationDateReps() {
698        return this.getReps(20);
699    }
700
701
702    /**
703     * Returns a specific repetition of
704     * RXG-20: "Substance Expiration Date" - creates it if necessary
705     *
706     * @param rep The repetition index (0-indexed)
707     */
708    public TS getSubstanceExpirationDate(int rep) { 
709                TS retVal = this.getTypedField(20, rep);
710                return retVal;
711    }
712
713    /**
714     * Returns a specific repetition of
715     * RXG-20: "Substance Expiration Date" - creates it if necessary
716     *
717     * @param rep The repetition index (0-indexed)
718     */
719    public TS getRxg20_SubstanceExpirationDate(int rep) { 
720                TS retVal = this.getTypedField(20, rep);
721                return retVal;
722    }
723
724    /**
725     * Returns a count of the current number of repetitions of Substance Expiration Date (RXG-20).
726     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
727     * it will return zero.
728     */
729    public int getRxg20_SubstanceExpirationDateReps() {
730        return this.getReps(20);
731    }
732
733
734    /**
735     * Inserts a repetition of
736     * RXG-20: "Substance Expiration Date" at a specific index
737     *
738     * @param rep The repetition index (0-indexed)
739     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
740     */
741    public TS insertSubstanceExpirationDate(int rep) throws HL7Exception { 
742        return (TS) super.insertRepetition(20, rep);
743    }
744
745
746    /**
747     * Inserts a repetition of
748     * RXG-20: "Substance Expiration Date" at a specific index
749     *
750     * @param rep The repetition index (0-indexed)
751     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
752     */
753    public TS insertRxg20_SubstanceExpirationDate(int rep) throws HL7Exception { 
754        return (TS) super.insertRepetition(20, rep);
755    }
756
757
758    /**
759     * Removes a repetition of
760     * RXG-20: "Substance Expiration Date" at a specific index
761     *
762     * @param rep The repetition index (0-indexed)
763     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
764     */
765    public TS removeSubstanceExpirationDate(int rep) throws HL7Exception { 
766        return (TS) super.removeRepetition(20, rep);
767    }
768
769
770    /**
771     * Removes a repetition of
772     * RXG-20: "Substance Expiration Date" at a specific index
773     *
774     * @param rep The repetition index (0-indexed)
775     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
776     */
777    public TS removeRxg20_SubstanceExpirationDate(int rep) throws HL7Exception { 
778        return (TS) super.removeRepetition(20, rep);
779    }
780
781
782
783    /**
784     * Returns all repetitions of Substance Manufacturer Name (RXG-21).
785     */
786    public CE[] getSubstanceManufacturerName() {
787        CE[] retVal = this.getTypedField(21, new CE[0]);
788        return retVal;
789    }
790
791
792    /**
793     * Returns all repetitions of Substance Manufacturer Name (RXG-21).
794     */
795    public CE[] getRxg21_SubstanceManufacturerName() {
796        CE[] retVal = this.getTypedField(21, new CE[0]);
797        return retVal;
798    }
799
800
801    /**
802     * Returns a count of the current number of repetitions of Substance Manufacturer Name (RXG-21).
803     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
804     * it will return zero.
805     */
806    public int getSubstanceManufacturerNameReps() {
807        return this.getReps(21);
808    }
809
810
811    /**
812     * Returns a specific repetition of
813     * RXG-21: "Substance Manufacturer Name" - creates it if necessary
814     *
815     * @param rep The repetition index (0-indexed)
816     */
817    public CE getSubstanceManufacturerName(int rep) { 
818                CE retVal = this.getTypedField(21, rep);
819                return retVal;
820    }
821
822    /**
823     * Returns a specific repetition of
824     * RXG-21: "Substance Manufacturer Name" - creates it if necessary
825     *
826     * @param rep The repetition index (0-indexed)
827     */
828    public CE getRxg21_SubstanceManufacturerName(int rep) { 
829                CE retVal = this.getTypedField(21, rep);
830                return retVal;
831    }
832
833    /**
834     * Returns a count of the current number of repetitions of Substance Manufacturer Name (RXG-21).
835     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
836     * it will return zero.
837     */
838    public int getRxg21_SubstanceManufacturerNameReps() {
839        return this.getReps(21);
840    }
841
842
843    /**
844     * Inserts a repetition of
845     * RXG-21: "Substance Manufacturer Name" at a specific index
846     *
847     * @param rep The repetition index (0-indexed)
848     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
849     */
850    public CE insertSubstanceManufacturerName(int rep) throws HL7Exception { 
851        return (CE) super.insertRepetition(21, rep);
852    }
853
854
855    /**
856     * Inserts a repetition of
857     * RXG-21: "Substance Manufacturer Name" at a specific index
858     *
859     * @param rep The repetition index (0-indexed)
860     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
861     */
862    public CE insertRxg21_SubstanceManufacturerName(int rep) throws HL7Exception { 
863        return (CE) super.insertRepetition(21, rep);
864    }
865
866
867    /**
868     * Removes a repetition of
869     * RXG-21: "Substance Manufacturer Name" at a specific index
870     *
871     * @param rep The repetition index (0-indexed)
872     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
873     */
874    public CE removeSubstanceManufacturerName(int rep) throws HL7Exception { 
875        return (CE) super.removeRepetition(21, rep);
876    }
877
878
879    /**
880     * Removes a repetition of
881     * RXG-21: "Substance Manufacturer Name" at a specific index
882     *
883     * @param rep The repetition index (0-indexed)
884     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
885     */
886    public CE removeRxg21_SubstanceManufacturerName(int rep) throws HL7Exception { 
887        return (CE) super.removeRepetition(21, rep);
888    }
889
890
891
892
893    /**
894     * Returns
895     * RXG-22: "Indication" - creates it if necessary
896     */
897    public CE getIndication() { 
898                CE retVal = this.getTypedField(22, 0);
899                return retVal;
900    }
901    
902    /**
903     * Returns
904     * RXG-22: "Indication" - creates it if necessary
905     */
906    public CE getRxg22_Indication() { 
907                CE retVal = this.getTypedField(22, 0);
908                return retVal;
909    }
910
911
912
913
914
915    /** {@inheritDoc} */   
916    protected Type createNewTypeWithoutReflection(int field) {
917       switch (field) {
918          case 0: return new ID(getMessage(), new Integer( 0 ));
919          case 1: return new NM(getMessage());
920          case 2: return new TQ(getMessage());
921          case 3: return new CE(getMessage());
922          case 4: return new NM(getMessage());
923          case 5: return new NM(getMessage());
924          case 6: return new CE(getMessage());
925          case 7: return new CE(getMessage());
926          case 8: return new CE(getMessage());
927          case 9: return new ID(getMessage(), new Integer( 167 ));
928          case 10: return new CM_LA1(getMessage());
929          case 11: return new ID(getMessage(), new Integer( 136 ));
930          case 12: return new CE(getMessage());
931          case 13: return new ST(getMessage());
932          case 14: return new ST(getMessage());
933          case 15: return new CE(getMessage());
934          case 16: return new NM(getMessage());
935          case 17: return new CE(getMessage());
936          case 18: return new ST(getMessage());
937          case 19: return new TS(getMessage());
938          case 20: return new CE(getMessage());
939          case 21: return new CE(getMessage());
940          default: return null;
941       }
942   }
943
944
945}
946