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