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.v23.segment;
35  
36  // import ca.uhn.hl7v2.model.v23.group.*;
37  import ca.uhn.hl7v2.model.v23.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 PRA message segment (Practitioner detail segment). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>PRA-1: PRA - Primary Key Value (ST) <b> </b>
53       * <li>PRA-2: Practioner Group (CE) <b>optional repeating</b>
54       * <li>PRA-3: Practioner Category (ID) <b>optional repeating</b>
55       * <li>PRA-4: Provider Billing (ID) <b>optional </b>
56       * <li>PRA-5: Specialty (CM_SPD) <b>optional repeating</b>
57       * <li>PRA-6: Practitioner ID Numbers (CM_PLN) <b>optional repeating</b>
58       * <li>PRA-7: Privileges (CM_PIP) <b>optional repeating</b>
59   * </ul>
60   */
61  @SuppressWarnings("unused")
62  public class PRA extends AbstractSegment {
63  
64      /** 
65       * Creates a new PRA segment
66       */
67      public PRA(Group parent, ModelClassFactory factory) {
68         super(parent, factory);
69         init(factory);
70      }
71  
72      private void init(ModelClassFactory factory) {
73         try {
74                                    this.add(ST.class, true, 1, 20, new Object[]{ getMessage() }, "PRA - Primary Key Value");
75                                    this.add(CE.class, false, 0, 60, new Object[]{ getMessage() }, "Practioner Group");
76                                                this.add(ID.class, false, 0, 3, new Object[]{ getMessage(), new Integer(0) }, "Practioner Category");
77                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(186) }, "Provider Billing");
78                                    this.add(CM_SPD.class, false, 0, 100, new Object[]{ getMessage() }, "Specialty");
79                                    this.add(CM_PLN.class, false, 0, 100, new Object[]{ getMessage() }, "Practitioner ID Numbers");
80                                    this.add(CM_PIP.class, false, 0, 200, new Object[]{ getMessage() }, "Privileges");
81         } catch(HL7Exception e) {
82            log.error("Unexpected error creating PRA - this is probably a bug in the source code generator.", e);
83         }
84      }
85  
86  
87  
88      /**
89       * Returns
90       * PRA-1: "PRA - Primary Key Value" - creates it if necessary
91       */
92      public ST getPRAPrimaryKeyValue() { 
93  		ST retVal = this.getTypedField(1, 0);
94  		return retVal;
95      }
96      
97      /**
98       * Returns
99       * PRA-1: "PRA - Primary Key Value" - creates it if necessary
100      */
101     public ST getPra1_PRAPrimaryKeyValue() { 
102 		ST retVal = this.getTypedField(1, 0);
103 		return retVal;
104     }
105 
106 
107     /**
108      * Returns all repetitions of Practioner Group (PRA-2).
109      */
110     public CE[] getPractionerGroup() {
111     	CE[] retVal = this.getTypedField(2, new CE[0]);
112     	return retVal;
113     }
114 
115 
116     /**
117      * Returns all repetitions of Practioner Group (PRA-2).
118      */
119     public CE[] getPra2_PractionerGroup() {
120     	CE[] retVal = this.getTypedField(2, new CE[0]);
121     	return retVal;
122     }
123 
124 
125     /**
126      * Returns a count of the current number of repetitions of Practioner Group (PRA-2).
127      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
128      * it will return zero.
129      */
130     public int getPractionerGroupReps() {
131     	return this.getReps(2);
132     }
133 
134 
135     /**
136      * Returns a specific repetition of
137      * PRA-2: "Practioner Group" - creates it if necessary
138      *
139      * @param rep The repetition index (0-indexed)
140      */
141     public CE getPractionerGroup(int rep) { 
142 		CE retVal = this.getTypedField(2, rep);
143 		return retVal;
144     }
145 
146     /**
147      * Returns a specific repetition of
148      * PRA-2: "Practioner Group" - creates it if necessary
149      *
150      * @param rep The repetition index (0-indexed)
151      */
152     public CE getPra2_PractionerGroup(int rep) { 
153 		CE retVal = this.getTypedField(2, rep);
154 		return retVal;
155     }
156 
157     /**
158      * Returns a count of the current number of repetitions of Practioner Group (PRA-2).
159      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
160      * it will return zero.
161      */
162     public int getPra2_PractionerGroupReps() {
163     	return this.getReps(2);
164     }
165 
166 
167     /**
168      * Inserts a repetition of
169      * PRA-2: "Practioner Group" at a specific index
170      *
171      * @param rep The repetition index (0-indexed)
172      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
173      */
174     public CE insertPractionerGroup(int rep) throws HL7Exception { 
175         return (CE) super.insertRepetition(2, rep);
176     }
177 
178 
179     /**
180      * Inserts a repetition of
181      * PRA-2: "Practioner Group" at a specific index
182      *
183      * @param rep The repetition index (0-indexed)
184      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
185      */
186     public CE insertPra2_PractionerGroup(int rep) throws HL7Exception { 
187         return (CE) super.insertRepetition(2, rep);
188     }
189 
190 
191     /**
192      * Removes a repetition of
193      * PRA-2: "Practioner Group" 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 CE removePractionerGroup(int rep) throws HL7Exception { 
199         return (CE) super.removeRepetition(2, rep);
200     }
201 
202 
203     /**
204      * Removes a repetition of
205      * PRA-2: "Practioner Group" 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 CE removePra2_PractionerGroup(int rep) throws HL7Exception { 
211         return (CE) super.removeRepetition(2, rep);
212     }
213 
214 
215 
216     /**
217      * Returns all repetitions of Practioner Category (PRA-3).
218      */
219     public ID[] getPractionerCategory() {
220     	ID[] retVal = this.getTypedField(3, new ID[0]);
221     	return retVal;
222     }
223 
224 
225     /**
226      * Returns all repetitions of Practioner Category (PRA-3).
227      */
228     public ID[] getPra3_PractionerCategory() {
229     	ID[] retVal = this.getTypedField(3, new ID[0]);
230     	return retVal;
231     }
232 
233 
234     /**
235      * Returns a count of the current number of repetitions of Practioner Category (PRA-3).
236      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
237      * it will return zero.
238      */
239     public int getPractionerCategoryReps() {
240     	return this.getReps(3);
241     }
242 
243 
244     /**
245      * Returns a specific repetition of
246      * PRA-3: "Practioner Category" - creates it if necessary
247      *
248      * @param rep The repetition index (0-indexed)
249      */
250     public ID getPractionerCategory(int rep) { 
251 		ID retVal = this.getTypedField(3, rep);
252 		return retVal;
253     }
254 
255     /**
256      * Returns a specific repetition of
257      * PRA-3: "Practioner Category" - creates it if necessary
258      *
259      * @param rep The repetition index (0-indexed)
260      */
261     public ID getPra3_PractionerCategory(int rep) { 
262 		ID retVal = this.getTypedField(3, rep);
263 		return retVal;
264     }
265 
266     /**
267      * Returns a count of the current number of repetitions of Practioner Category (PRA-3).
268      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
269      * it will return zero.
270      */
271     public int getPra3_PractionerCategoryReps() {
272     	return this.getReps(3);
273     }
274 
275 
276     /**
277      * Inserts a repetition of
278      * PRA-3: "Practioner Category" at a specific index
279      *
280      * @param rep The repetition index (0-indexed)
281      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
282      */
283     public ID insertPractionerCategory(int rep) throws HL7Exception { 
284         return (ID) super.insertRepetition(3, rep);
285     }
286 
287 
288     /**
289      * Inserts a repetition of
290      * PRA-3: "Practioner Category" at a specific index
291      *
292      * @param rep The repetition index (0-indexed)
293      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
294      */
295     public ID insertPra3_PractionerCategory(int rep) throws HL7Exception { 
296         return (ID) super.insertRepetition(3, rep);
297     }
298 
299 
300     /**
301      * Removes a repetition of
302      * PRA-3: "Practioner Category" 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 ID removePractionerCategory(int rep) throws HL7Exception { 
308         return (ID) super.removeRepetition(3, rep);
309     }
310 
311 
312     /**
313      * Removes a repetition of
314      * PRA-3: "Practioner Category" 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 ID removePra3_PractionerCategory(int rep) throws HL7Exception { 
320         return (ID) super.removeRepetition(3, rep);
321     }
322 
323 
324 
325 
326     /**
327      * Returns
328      * PRA-4: "Provider Billing" - creates it if necessary
329      */
330     public ID getProviderBilling() { 
331 		ID retVal = this.getTypedField(4, 0);
332 		return retVal;
333     }
334     
335     /**
336      * Returns
337      * PRA-4: "Provider Billing" - creates it if necessary
338      */
339     public ID getPra4_ProviderBilling() { 
340 		ID retVal = this.getTypedField(4, 0);
341 		return retVal;
342     }
343 
344 
345     /**
346      * Returns all repetitions of Specialty (PRA-5).
347      */
348     public CM_SPD[] getSpecialty() {
349     	CM_SPD[] retVal = this.getTypedField(5, new CM_SPD[0]);
350     	return retVal;
351     }
352 
353 
354     /**
355      * Returns all repetitions of Specialty (PRA-5).
356      */
357     public CM_SPD[] getPra5_Specialty() {
358     	CM_SPD[] retVal = this.getTypedField(5, new CM_SPD[0]);
359     	return retVal;
360     }
361 
362 
363     /**
364      * Returns a count of the current number of repetitions of Specialty (PRA-5).
365      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
366      * it will return zero.
367      */
368     public int getSpecialtyReps() {
369     	return this.getReps(5);
370     }
371 
372 
373     /**
374      * Returns a specific repetition of
375      * PRA-5: "Specialty" - creates it if necessary
376      *
377      * @param rep The repetition index (0-indexed)
378      */
379     public CM_SPD getSpecialty(int rep) { 
380 		CM_SPD retVal = this.getTypedField(5, rep);
381 		return retVal;
382     }
383 
384     /**
385      * Returns a specific repetition of
386      * PRA-5: "Specialty" - creates it if necessary
387      *
388      * @param rep The repetition index (0-indexed)
389      */
390     public CM_SPD getPra5_Specialty(int rep) { 
391 		CM_SPD retVal = this.getTypedField(5, rep);
392 		return retVal;
393     }
394 
395     /**
396      * Returns a count of the current number of repetitions of Specialty (PRA-5).
397      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
398      * it will return zero.
399      */
400     public int getPra5_SpecialtyReps() {
401     	return this.getReps(5);
402     }
403 
404 
405     /**
406      * Inserts a repetition of
407      * PRA-5: "Specialty" at a specific index
408      *
409      * @param rep The repetition index (0-indexed)
410      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
411      */
412     public CM_SPD insertSpecialty(int rep) throws HL7Exception { 
413         return (CM_SPD) super.insertRepetition(5, rep);
414     }
415 
416 
417     /**
418      * Inserts a repetition of
419      * PRA-5: "Specialty" at a specific index
420      *
421      * @param rep The repetition index (0-indexed)
422      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
423      */
424     public CM_SPD insertPra5_Specialty(int rep) throws HL7Exception { 
425         return (CM_SPD) super.insertRepetition(5, rep);
426     }
427 
428 
429     /**
430      * Removes a repetition of
431      * PRA-5: "Specialty" at a specific index
432      *
433      * @param rep The repetition index (0-indexed)
434      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
435      */
436     public CM_SPD removeSpecialty(int rep) throws HL7Exception { 
437         return (CM_SPD) super.removeRepetition(5, rep);
438     }
439 
440 
441     /**
442      * Removes a repetition of
443      * PRA-5: "Specialty" at a specific index
444      *
445      * @param rep The repetition index (0-indexed)
446      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
447      */
448     public CM_SPD removePra5_Specialty(int rep) throws HL7Exception { 
449         return (CM_SPD) super.removeRepetition(5, rep);
450     }
451 
452 
453 
454     /**
455      * Returns all repetitions of Practitioner ID Numbers (PRA-6).
456      */
457     public CM_PLN[] getPractitionerIDNumbers() {
458     	CM_PLN[] retVal = this.getTypedField(6, new CM_PLN[0]);
459     	return retVal;
460     }
461 
462 
463     /**
464      * Returns all repetitions of Practitioner ID Numbers (PRA-6).
465      */
466     public CM_PLN[] getPra6_PractitionerIDNumbers() {
467     	CM_PLN[] retVal = this.getTypedField(6, new CM_PLN[0]);
468     	return retVal;
469     }
470 
471 
472     /**
473      * Returns a count of the current number of repetitions of Practitioner ID Numbers (PRA-6).
474      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
475      * it will return zero.
476      */
477     public int getPractitionerIDNumbersReps() {
478     	return this.getReps(6);
479     }
480 
481 
482     /**
483      * Returns a specific repetition of
484      * PRA-6: "Practitioner ID Numbers" - creates it if necessary
485      *
486      * @param rep The repetition index (0-indexed)
487      */
488     public CM_PLN getPractitionerIDNumbers(int rep) { 
489 		CM_PLN retVal = this.getTypedField(6, rep);
490 		return retVal;
491     }
492 
493     /**
494      * Returns a specific repetition of
495      * PRA-6: "Practitioner ID Numbers" - creates it if necessary
496      *
497      * @param rep The repetition index (0-indexed)
498      */
499     public CM_PLN getPra6_PractitionerIDNumbers(int rep) { 
500 		CM_PLN retVal = this.getTypedField(6, rep);
501 		return retVal;
502     }
503 
504     /**
505      * Returns a count of the current number of repetitions of Practitioner ID Numbers (PRA-6).
506      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
507      * it will return zero.
508      */
509     public int getPra6_PractitionerIDNumbersReps() {
510     	return this.getReps(6);
511     }
512 
513 
514     /**
515      * Inserts a repetition of
516      * PRA-6: "Practitioner ID Numbers" at a specific index
517      *
518      * @param rep The repetition index (0-indexed)
519      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
520      */
521     public CM_PLN insertPractitionerIDNumbers(int rep) throws HL7Exception { 
522         return (CM_PLN) super.insertRepetition(6, rep);
523     }
524 
525 
526     /**
527      * Inserts a repetition of
528      * PRA-6: "Practitioner ID Numbers" at a specific index
529      *
530      * @param rep The repetition index (0-indexed)
531      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
532      */
533     public CM_PLN insertPra6_PractitionerIDNumbers(int rep) throws HL7Exception { 
534         return (CM_PLN) super.insertRepetition(6, rep);
535     }
536 
537 
538     /**
539      * Removes a repetition of
540      * PRA-6: "Practitioner ID Numbers" at a specific index
541      *
542      * @param rep The repetition index (0-indexed)
543      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
544      */
545     public CM_PLN removePractitionerIDNumbers(int rep) throws HL7Exception { 
546         return (CM_PLN) super.removeRepetition(6, rep);
547     }
548 
549 
550     /**
551      * Removes a repetition of
552      * PRA-6: "Practitioner ID Numbers" at a specific index
553      *
554      * @param rep The repetition index (0-indexed)
555      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
556      */
557     public CM_PLN removePra6_PractitionerIDNumbers(int rep) throws HL7Exception { 
558         return (CM_PLN) super.removeRepetition(6, rep);
559     }
560 
561 
562 
563     /**
564      * Returns all repetitions of Privileges (PRA-7).
565      */
566     public CM_PIP[] getPrivileges() {
567     	CM_PIP[] retVal = this.getTypedField(7, new CM_PIP[0]);
568     	return retVal;
569     }
570 
571 
572     /**
573      * Returns all repetitions of Privileges (PRA-7).
574      */
575     public CM_PIP[] getPra7_Privileges() {
576     	CM_PIP[] retVal = this.getTypedField(7, new CM_PIP[0]);
577     	return retVal;
578     }
579 
580 
581     /**
582      * Returns a count of the current number of repetitions of Privileges (PRA-7).
583      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
584      * it will return zero.
585      */
586     public int getPrivilegesReps() {
587     	return this.getReps(7);
588     }
589 
590 
591     /**
592      * Returns a specific repetition of
593      * PRA-7: "Privileges" - creates it if necessary
594      *
595      * @param rep The repetition index (0-indexed)
596      */
597     public CM_PIP getPrivileges(int rep) { 
598 		CM_PIP retVal = this.getTypedField(7, rep);
599 		return retVal;
600     }
601 
602     /**
603      * Returns a specific repetition of
604      * PRA-7: "Privileges" - creates it if necessary
605      *
606      * @param rep The repetition index (0-indexed)
607      */
608     public CM_PIP getPra7_Privileges(int rep) { 
609 		CM_PIP retVal = this.getTypedField(7, rep);
610 		return retVal;
611     }
612 
613     /**
614      * Returns a count of the current number of repetitions of Privileges (PRA-7).
615      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
616      * it will return zero.
617      */
618     public int getPra7_PrivilegesReps() {
619     	return this.getReps(7);
620     }
621 
622 
623     /**
624      * Inserts a repetition of
625      * PRA-7: "Privileges" at a specific index
626      *
627      * @param rep The repetition index (0-indexed)
628      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
629      */
630     public CM_PIP insertPrivileges(int rep) throws HL7Exception { 
631         return (CM_PIP) super.insertRepetition(7, rep);
632     }
633 
634 
635     /**
636      * Inserts a repetition of
637      * PRA-7: "Privileges" at a specific index
638      *
639      * @param rep The repetition index (0-indexed)
640      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
641      */
642     public CM_PIP insertPra7_Privileges(int rep) throws HL7Exception { 
643         return (CM_PIP) super.insertRepetition(7, rep);
644     }
645 
646 
647     /**
648      * Removes a repetition of
649      * PRA-7: "Privileges" at a specific index
650      *
651      * @param rep The repetition index (0-indexed)
652      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
653      */
654     public CM_PIP removePrivileges(int rep) throws HL7Exception { 
655         return (CM_PIP) super.removeRepetition(7, rep);
656     }
657 
658 
659     /**
660      * Removes a repetition of
661      * PRA-7: "Privileges" at a specific index
662      *
663      * @param rep The repetition index (0-indexed)
664      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
665      */
666     public CM_PIP removePra7_Privileges(int rep) throws HL7Exception { 
667         return (CM_PIP) super.removeRepetition(7, rep);
668     }
669 
670 
671 
672 
673 
674 
675     /** {@inheritDoc} */   
676     protected Type createNewTypeWithoutReflection(int field) {
677        switch (field) {
678           case 0: return new ST(getMessage());
679           case 1: return new CE(getMessage());
680           case 2: return new ID(getMessage(), new Integer( 0 ));
681           case 3: return new ID(getMessage(), new Integer( 186 ));
682           case 4: return new CM_SPD(getMessage());
683           case 5: return new CM_PLN(getMessage());
684           case 6: return new CM_PIP(getMessage());
685           default: return null;
686        }
687    }
688 
689 
690 }
691