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