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.v251.segment;
035
036// import ca.uhn.hl7v2.model.v251.group.*;
037import ca.uhn.hl7v2.model.v251.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 LOC message segment (Location Identification). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>LOC-1: Primary Key Value - LOC (PL) <b> </b>
053     * <li>LOC-2: Location Description (ST) <b>optional </b>
054     * <li>LOC-3: Location Type - LOC (IS) <b> repeating</b>
055     * <li>LOC-4: Organization Name - LOC (XON) <b>optional repeating</b>
056     * <li>LOC-5: Location Address (XAD) <b>optional repeating</b>
057     * <li>LOC-6: Location Phone (XTN) <b>optional repeating</b>
058     * <li>LOC-7: License Number (CE) <b>optional repeating</b>
059     * <li>LOC-8: Location Equipment (IS) <b>optional repeating</b>
060     * <li>LOC-9: Location Service Code (IS) <b>optional </b>
061 * </ul>
062 */
063@SuppressWarnings("unused")
064public class LOC extends AbstractSegment {
065
066    /** 
067     * Creates a new LOC segment
068     */
069    public LOC(Group parent, ModelClassFactory factory) {
070       super(parent, factory);
071       init(factory);
072    }
073
074    private void init(ModelClassFactory factory) {
075       try {
076                                  this.add(PL.class, true, 1, 200, new Object[]{ getMessage() }, "Primary Key Value - LOC");
077                                  this.add(ST.class, false, 1, 48, new Object[]{ getMessage() }, "Location Description");
078                                              this.add(IS.class, true, 0, 2, new Object[]{ getMessage(), new Integer(260) }, "Location Type - LOC");
079                                  this.add(XON.class, false, 0, 250, new Object[]{ getMessage() }, "Organization Name - LOC");
080                                  this.add(XAD.class, false, 0, 250, new Object[]{ getMessage() }, "Location Address");
081                                  this.add(XTN.class, false, 0, 250, new Object[]{ getMessage() }, "Location Phone");
082                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "License Number");
083                                              this.add(IS.class, false, 0, 3, new Object[]{ getMessage(), new Integer(261) }, "Location Equipment");
084                                              this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(442) }, "Location Service Code");
085       } catch(HL7Exception e) {
086          log.error("Unexpected error creating LOC - this is probably a bug in the source code generator.", e);
087       }
088    }
089
090
091
092    /**
093     * Returns
094     * LOC-1: "Primary Key Value - LOC" - creates it if necessary
095     */
096    public PL getPrimaryKeyValueLOC() { 
097                PL retVal = this.getTypedField(1, 0);
098                return retVal;
099    }
100    
101    /**
102     * Returns
103     * LOC-1: "Primary Key Value - LOC" - creates it if necessary
104     */
105    public PL getLoc1_PrimaryKeyValueLOC() { 
106                PL retVal = this.getTypedField(1, 0);
107                return retVal;
108    }
109
110
111
112    /**
113     * Returns
114     * LOC-2: "Location Description" - creates it if necessary
115     */
116    public ST getLocationDescription() { 
117                ST retVal = this.getTypedField(2, 0);
118                return retVal;
119    }
120    
121    /**
122     * Returns
123     * LOC-2: "Location Description" - creates it if necessary
124     */
125    public ST getLoc2_LocationDescription() { 
126                ST retVal = this.getTypedField(2, 0);
127                return retVal;
128    }
129
130
131    /**
132     * Returns all repetitions of Location Type - LOC (LOC-3).
133     */
134    public IS[] getLocationTypeLOC() {
135        IS[] retVal = this.getTypedField(3, new IS[0]);
136        return retVal;
137    }
138
139
140    /**
141     * Returns all repetitions of Location Type - LOC (LOC-3).
142     */
143    public IS[] getLoc3_LocationTypeLOC() {
144        IS[] retVal = this.getTypedField(3, new IS[0]);
145        return retVal;
146    }
147
148
149    /**
150     * Returns a count of the current number of repetitions of Location Type - LOC (LOC-3).
151     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
152     * it will return zero.
153     */
154    public int getLocationTypeLOCReps() {
155        return this.getReps(3);
156    }
157
158
159    /**
160     * Returns a specific repetition of
161     * LOC-3: "Location Type - LOC" - creates it if necessary
162     *
163     * @param rep The repetition index (0-indexed)
164     */
165    public IS getLocationTypeLOC(int rep) { 
166                IS retVal = this.getTypedField(3, rep);
167                return retVal;
168    }
169
170    /**
171     * Returns a specific repetition of
172     * LOC-3: "Location Type - LOC" - creates it if necessary
173     *
174     * @param rep The repetition index (0-indexed)
175     */
176    public IS getLoc3_LocationTypeLOC(int rep) { 
177                IS retVal = this.getTypedField(3, rep);
178                return retVal;
179    }
180
181    /**
182     * Returns a count of the current number of repetitions of Location Type - LOC (LOC-3).
183     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
184     * it will return zero.
185     */
186    public int getLoc3_LocationTypeLOCReps() {
187        return this.getReps(3);
188    }
189
190
191    /**
192     * Inserts a repetition of
193     * LOC-3: "Location Type - LOC" at a specific index
194     *
195     * @param rep The repetition index (0-indexed)
196     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
197     */
198    public IS insertLocationTypeLOC(int rep) throws HL7Exception { 
199        return (IS) super.insertRepetition(3, rep);
200    }
201
202
203    /**
204     * Inserts a repetition of
205     * LOC-3: "Location Type - LOC" at a specific index
206     *
207     * @param rep The repetition index (0-indexed)
208     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
209     */
210    public IS insertLoc3_LocationTypeLOC(int rep) throws HL7Exception { 
211        return (IS) super.insertRepetition(3, rep);
212    }
213
214
215    /**
216     * Removes a repetition of
217     * LOC-3: "Location Type - LOC" at a specific index
218     *
219     * @param rep The repetition index (0-indexed)
220     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
221     */
222    public IS removeLocationTypeLOC(int rep) throws HL7Exception { 
223        return (IS) super.removeRepetition(3, rep);
224    }
225
226
227    /**
228     * Removes a repetition of
229     * LOC-3: "Location Type - LOC" at a specific index
230     *
231     * @param rep The repetition index (0-indexed)
232     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
233     */
234    public IS removeLoc3_LocationTypeLOC(int rep) throws HL7Exception { 
235        return (IS) super.removeRepetition(3, rep);
236    }
237
238
239
240    /**
241     * Returns all repetitions of Organization Name - LOC (LOC-4).
242     */
243    public XON[] getOrganizationNameLOC() {
244        XON[] retVal = this.getTypedField(4, new XON[0]);
245        return retVal;
246    }
247
248
249    /**
250     * Returns all repetitions of Organization Name - LOC (LOC-4).
251     */
252    public XON[] getLoc4_OrganizationNameLOC() {
253        XON[] retVal = this.getTypedField(4, new XON[0]);
254        return retVal;
255    }
256
257
258    /**
259     * Returns a count of the current number of repetitions of Organization Name - LOC (LOC-4).
260     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
261     * it will return zero.
262     */
263    public int getOrganizationNameLOCReps() {
264        return this.getReps(4);
265    }
266
267
268    /**
269     * Returns a specific repetition of
270     * LOC-4: "Organization Name - LOC" - creates it if necessary
271     *
272     * @param rep The repetition index (0-indexed)
273     */
274    public XON getOrganizationNameLOC(int rep) { 
275                XON retVal = this.getTypedField(4, rep);
276                return retVal;
277    }
278
279    /**
280     * Returns a specific repetition of
281     * LOC-4: "Organization Name - LOC" - creates it if necessary
282     *
283     * @param rep The repetition index (0-indexed)
284     */
285    public XON getLoc4_OrganizationNameLOC(int rep) { 
286                XON retVal = this.getTypedField(4, rep);
287                return retVal;
288    }
289
290    /**
291     * Returns a count of the current number of repetitions of Organization Name - LOC (LOC-4).
292     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
293     * it will return zero.
294     */
295    public int getLoc4_OrganizationNameLOCReps() {
296        return this.getReps(4);
297    }
298
299
300    /**
301     * Inserts a repetition of
302     * LOC-4: "Organization Name - LOC" at a specific index
303     *
304     * @param rep The repetition index (0-indexed)
305     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
306     */
307    public XON insertOrganizationNameLOC(int rep) throws HL7Exception { 
308        return (XON) super.insertRepetition(4, rep);
309    }
310
311
312    /**
313     * Inserts a repetition of
314     * LOC-4: "Organization Name - LOC" at a specific index
315     *
316     * @param rep The repetition index (0-indexed)
317     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
318     */
319    public XON insertLoc4_OrganizationNameLOC(int rep) throws HL7Exception { 
320        return (XON) super.insertRepetition(4, rep);
321    }
322
323
324    /**
325     * Removes a repetition of
326     * LOC-4: "Organization Name - LOC" at a specific index
327     *
328     * @param rep The repetition index (0-indexed)
329     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
330     */
331    public XON removeOrganizationNameLOC(int rep) throws HL7Exception { 
332        return (XON) super.removeRepetition(4, rep);
333    }
334
335
336    /**
337     * Removes a repetition of
338     * LOC-4: "Organization Name - LOC" 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 XON removeLoc4_OrganizationNameLOC(int rep) throws HL7Exception { 
344        return (XON) super.removeRepetition(4, rep);
345    }
346
347
348
349    /**
350     * Returns all repetitions of Location Address (LOC-5).
351     */
352    public XAD[] getLocationAddress() {
353        XAD[] retVal = this.getTypedField(5, new XAD[0]);
354        return retVal;
355    }
356
357
358    /**
359     * Returns all repetitions of Location Address (LOC-5).
360     */
361    public XAD[] getLoc5_LocationAddress() {
362        XAD[] retVal = this.getTypedField(5, new XAD[0]);
363        return retVal;
364    }
365
366
367    /**
368     * Returns a count of the current number of repetitions of Location Address (LOC-5).
369     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
370     * it will return zero.
371     */
372    public int getLocationAddressReps() {
373        return this.getReps(5);
374    }
375
376
377    /**
378     * Returns a specific repetition of
379     * LOC-5: "Location Address" - creates it if necessary
380     *
381     * @param rep The repetition index (0-indexed)
382     */
383    public XAD getLocationAddress(int rep) { 
384                XAD retVal = this.getTypedField(5, rep);
385                return retVal;
386    }
387
388    /**
389     * Returns a specific repetition of
390     * LOC-5: "Location Address" - creates it if necessary
391     *
392     * @param rep The repetition index (0-indexed)
393     */
394    public XAD getLoc5_LocationAddress(int rep) { 
395                XAD retVal = this.getTypedField(5, rep);
396                return retVal;
397    }
398
399    /**
400     * Returns a count of the current number of repetitions of Location Address (LOC-5).
401     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
402     * it will return zero.
403     */
404    public int getLoc5_LocationAddressReps() {
405        return this.getReps(5);
406    }
407
408
409    /**
410     * Inserts a repetition of
411     * LOC-5: "Location Address" at a specific index
412     *
413     * @param rep The repetition index (0-indexed)
414     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
415     */
416    public XAD insertLocationAddress(int rep) throws HL7Exception { 
417        return (XAD) super.insertRepetition(5, rep);
418    }
419
420
421    /**
422     * Inserts a repetition of
423     * LOC-5: "Location Address" at a specific index
424     *
425     * @param rep The repetition index (0-indexed)
426     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
427     */
428    public XAD insertLoc5_LocationAddress(int rep) throws HL7Exception { 
429        return (XAD) super.insertRepetition(5, rep);
430    }
431
432
433    /**
434     * Removes a repetition of
435     * LOC-5: "Location Address" at a specific index
436     *
437     * @param rep The repetition index (0-indexed)
438     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
439     */
440    public XAD removeLocationAddress(int rep) throws HL7Exception { 
441        return (XAD) super.removeRepetition(5, rep);
442    }
443
444
445    /**
446     * Removes a repetition of
447     * LOC-5: "Location Address" at a specific index
448     *
449     * @param rep The repetition index (0-indexed)
450     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
451     */
452    public XAD removeLoc5_LocationAddress(int rep) throws HL7Exception { 
453        return (XAD) super.removeRepetition(5, rep);
454    }
455
456
457
458    /**
459     * Returns all repetitions of Location Phone (LOC-6).
460     */
461    public XTN[] getLocationPhone() {
462        XTN[] retVal = this.getTypedField(6, new XTN[0]);
463        return retVal;
464    }
465
466
467    /**
468     * Returns all repetitions of Location Phone (LOC-6).
469     */
470    public XTN[] getLoc6_LocationPhone() {
471        XTN[] retVal = this.getTypedField(6, new XTN[0]);
472        return retVal;
473    }
474
475
476    /**
477     * Returns a count of the current number of repetitions of Location Phone (LOC-6).
478     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
479     * it will return zero.
480     */
481    public int getLocationPhoneReps() {
482        return this.getReps(6);
483    }
484
485
486    /**
487     * Returns a specific repetition of
488     * LOC-6: "Location Phone" - creates it if necessary
489     *
490     * @param rep The repetition index (0-indexed)
491     */
492    public XTN getLocationPhone(int rep) { 
493                XTN retVal = this.getTypedField(6, rep);
494                return retVal;
495    }
496
497    /**
498     * Returns a specific repetition of
499     * LOC-6: "Location Phone" - creates it if necessary
500     *
501     * @param rep The repetition index (0-indexed)
502     */
503    public XTN getLoc6_LocationPhone(int rep) { 
504                XTN retVal = this.getTypedField(6, rep);
505                return retVal;
506    }
507
508    /**
509     * Returns a count of the current number of repetitions of Location Phone (LOC-6).
510     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
511     * it will return zero.
512     */
513    public int getLoc6_LocationPhoneReps() {
514        return this.getReps(6);
515    }
516
517
518    /**
519     * Inserts a repetition of
520     * LOC-6: "Location Phone" at a specific index
521     *
522     * @param rep The repetition index (0-indexed)
523     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
524     */
525    public XTN insertLocationPhone(int rep) throws HL7Exception { 
526        return (XTN) super.insertRepetition(6, rep);
527    }
528
529
530    /**
531     * Inserts a repetition of
532     * LOC-6: "Location Phone" at a specific index
533     *
534     * @param rep The repetition index (0-indexed)
535     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
536     */
537    public XTN insertLoc6_LocationPhone(int rep) throws HL7Exception { 
538        return (XTN) super.insertRepetition(6, rep);
539    }
540
541
542    /**
543     * Removes a repetition of
544     * LOC-6: "Location Phone" 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 XTN removeLocationPhone(int rep) throws HL7Exception { 
550        return (XTN) super.removeRepetition(6, rep);
551    }
552
553
554    /**
555     * Removes a repetition of
556     * LOC-6: "Location Phone" 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 XTN removeLoc6_LocationPhone(int rep) throws HL7Exception { 
562        return (XTN) super.removeRepetition(6, rep);
563    }
564
565
566
567    /**
568     * Returns all repetitions of License Number (LOC-7).
569     */
570    public CE[] getLicenseNumber() {
571        CE[] retVal = this.getTypedField(7, new CE[0]);
572        return retVal;
573    }
574
575
576    /**
577     * Returns all repetitions of License Number (LOC-7).
578     */
579    public CE[] getLoc7_LicenseNumber() {
580        CE[] retVal = this.getTypedField(7, new CE[0]);
581        return retVal;
582    }
583
584
585    /**
586     * Returns a count of the current number of repetitions of License Number (LOC-7).
587     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
588     * it will return zero.
589     */
590    public int getLicenseNumberReps() {
591        return this.getReps(7);
592    }
593
594
595    /**
596     * Returns a specific repetition of
597     * LOC-7: "License Number" - creates it if necessary
598     *
599     * @param rep The repetition index (0-indexed)
600     */
601    public CE getLicenseNumber(int rep) { 
602                CE retVal = this.getTypedField(7, rep);
603                return retVal;
604    }
605
606    /**
607     * Returns a specific repetition of
608     * LOC-7: "License Number" - creates it if necessary
609     *
610     * @param rep The repetition index (0-indexed)
611     */
612    public CE getLoc7_LicenseNumber(int rep) { 
613                CE retVal = this.getTypedField(7, rep);
614                return retVal;
615    }
616
617    /**
618     * Returns a count of the current number of repetitions of License Number (LOC-7).
619     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
620     * it will return zero.
621     */
622    public int getLoc7_LicenseNumberReps() {
623        return this.getReps(7);
624    }
625
626
627    /**
628     * Inserts a repetition of
629     * LOC-7: "License Number" at a specific index
630     *
631     * @param rep The repetition index (0-indexed)
632     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
633     */
634    public CE insertLicenseNumber(int rep) throws HL7Exception { 
635        return (CE) super.insertRepetition(7, rep);
636    }
637
638
639    /**
640     * Inserts a repetition of
641     * LOC-7: "License Number" at a specific index
642     *
643     * @param rep The repetition index (0-indexed)
644     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
645     */
646    public CE insertLoc7_LicenseNumber(int rep) throws HL7Exception { 
647        return (CE) super.insertRepetition(7, rep);
648    }
649
650
651    /**
652     * Removes a repetition of
653     * LOC-7: "License Number" at a specific index
654     *
655     * @param rep The repetition index (0-indexed)
656     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
657     */
658    public CE removeLicenseNumber(int rep) throws HL7Exception { 
659        return (CE) super.removeRepetition(7, rep);
660    }
661
662
663    /**
664     * Removes a repetition of
665     * LOC-7: "License Number" at a specific index
666     *
667     * @param rep The repetition index (0-indexed)
668     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
669     */
670    public CE removeLoc7_LicenseNumber(int rep) throws HL7Exception { 
671        return (CE) super.removeRepetition(7, rep);
672    }
673
674
675
676    /**
677     * Returns all repetitions of Location Equipment (LOC-8).
678     */
679    public IS[] getLocationEquipment() {
680        IS[] retVal = this.getTypedField(8, new IS[0]);
681        return retVal;
682    }
683
684
685    /**
686     * Returns all repetitions of Location Equipment (LOC-8).
687     */
688    public IS[] getLoc8_LocationEquipment() {
689        IS[] retVal = this.getTypedField(8, new IS[0]);
690        return retVal;
691    }
692
693
694    /**
695     * Returns a count of the current number of repetitions of Location Equipment (LOC-8).
696     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
697     * it will return zero.
698     */
699    public int getLocationEquipmentReps() {
700        return this.getReps(8);
701    }
702
703
704    /**
705     * Returns a specific repetition of
706     * LOC-8: "Location Equipment" - creates it if necessary
707     *
708     * @param rep The repetition index (0-indexed)
709     */
710    public IS getLocationEquipment(int rep) { 
711                IS retVal = this.getTypedField(8, rep);
712                return retVal;
713    }
714
715    /**
716     * Returns a specific repetition of
717     * LOC-8: "Location Equipment" - creates it if necessary
718     *
719     * @param rep The repetition index (0-indexed)
720     */
721    public IS getLoc8_LocationEquipment(int rep) { 
722                IS retVal = this.getTypedField(8, rep);
723                return retVal;
724    }
725
726    /**
727     * Returns a count of the current number of repetitions of Location Equipment (LOC-8).
728     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
729     * it will return zero.
730     */
731    public int getLoc8_LocationEquipmentReps() {
732        return this.getReps(8);
733    }
734
735
736    /**
737     * Inserts a repetition of
738     * LOC-8: "Location Equipment" at a specific index
739     *
740     * @param rep The repetition index (0-indexed)
741     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
742     */
743    public IS insertLocationEquipment(int rep) throws HL7Exception { 
744        return (IS) super.insertRepetition(8, rep);
745    }
746
747
748    /**
749     * Inserts a repetition of
750     * LOC-8: "Location Equipment" at a specific index
751     *
752     * @param rep The repetition index (0-indexed)
753     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
754     */
755    public IS insertLoc8_LocationEquipment(int rep) throws HL7Exception { 
756        return (IS) super.insertRepetition(8, rep);
757    }
758
759
760    /**
761     * Removes a repetition of
762     * LOC-8: "Location Equipment" at a specific index
763     *
764     * @param rep The repetition index (0-indexed)
765     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
766     */
767    public IS removeLocationEquipment(int rep) throws HL7Exception { 
768        return (IS) super.removeRepetition(8, rep);
769    }
770
771
772    /**
773     * Removes a repetition of
774     * LOC-8: "Location Equipment" at a specific index
775     *
776     * @param rep The repetition index (0-indexed)
777     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
778     */
779    public IS removeLoc8_LocationEquipment(int rep) throws HL7Exception { 
780        return (IS) super.removeRepetition(8, rep);
781    }
782
783
784
785
786    /**
787     * Returns
788     * LOC-9: "Location Service Code" - creates it if necessary
789     */
790    public IS getLocationServiceCode() { 
791                IS retVal = this.getTypedField(9, 0);
792                return retVal;
793    }
794    
795    /**
796     * Returns
797     * LOC-9: "Location Service Code" - creates it if necessary
798     */
799    public IS getLoc9_LocationServiceCode() { 
800                IS retVal = this.getTypedField(9, 0);
801                return retVal;
802    }
803
804
805
806
807
808    /** {@inheritDoc} */   
809    protected Type createNewTypeWithoutReflection(int field) {
810       switch (field) {
811          case 0: return new PL(getMessage());
812          case 1: return new ST(getMessage());
813          case 2: return new IS(getMessage(), new Integer( 260 ));
814          case 3: return new XON(getMessage());
815          case 4: return new XAD(getMessage());
816          case 5: return new XTN(getMessage());
817          case 6: return new CE(getMessage());
818          case 7: return new IS(getMessage(), new Integer( 261 ));
819          case 8: return new IS(getMessage(), new Integer( 442 ));
820          default: return null;
821       }
822   }
823
824
825}
826