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.v26.segment;
35  
36  // import ca.uhn.hl7v2.model.v26.group.*;
37  import ca.uhn.hl7v2.model.v26.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 PD1 message segment (Patient Additional Demographic). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>PD1-1: Living Dependency (IS) <b>optional repeating</b>
53       * <li>PD1-2: Living Arrangement (IS) <b>optional </b>
54       * <li>PD1-3: Patient Primary Facility (XON) <b>optional repeating</b>
55       * <li>PD1-4: Patient Primary Care Provider Name & ID No. (XCN) <b>optional repeating</b>
56       * <li>PD1-5: Student Indicator (IS) <b>optional </b>
57       * <li>PD1-6: Handicap (IS) <b>optional </b>
58       * <li>PD1-7: Living Will Code (IS) <b>optional </b>
59       * <li>PD1-8: Organ Donor Code (IS) <b>optional </b>
60       * <li>PD1-9: Separate Bill (ID) <b>optional </b>
61       * <li>PD1-10: Duplicate Patient (CX) <b>optional repeating</b>
62       * <li>PD1-11: Publicity Code (CWE) <b>optional </b>
63       * <li>PD1-12: Protection Indicator (ID) <b>optional </b>
64       * <li>PD1-13: Protection Indicator Effective Date (DT) <b>optional </b>
65       * <li>PD1-14: Place of Worship (XON) <b>optional repeating</b>
66       * <li>PD1-15: Advance Directive Code (CWE) <b>optional repeating</b>
67       * <li>PD1-16: Immunization Registry Status (IS) <b>optional </b>
68       * <li>PD1-17: Immunization Registry Status Effective Date (DT) <b>optional </b>
69       * <li>PD1-18: Publicity Code Effective Date (DT) <b>optional </b>
70       * <li>PD1-19: Military Branch (IS) <b>optional </b>
71       * <li>PD1-20: Military Rank/Grade (IS) <b>optional </b>
72       * <li>PD1-21: Military Status (IS) <b>optional </b>
73       * <li>PD1-22: Advance Directive Last Verified Date (DT) <b>optional </b>
74   * </ul>
75   */
76  @SuppressWarnings("unused")
77  public class PD1 extends AbstractSegment {
78  
79      /** 
80       * Creates a new PD1 segment
81       */
82      public PD1(Group parent, ModelClassFactory factory) {
83         super(parent, factory);
84         init(factory);
85      }
86  
87      private void init(ModelClassFactory factory) {
88         try {
89                                                this.add(IS.class, false, 0, 2, new Object[]{ getMessage(), new Integer(223) }, "Living Dependency");
90                                                this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(220) }, "Living Arrangement");
91                                    this.add(XON.class, false, 0, 250, new Object[]{ getMessage() }, "Patient Primary Facility");
92                                    this.add(XCN.class, false, 0, 0, new Object[]{ getMessage() }, "Patient Primary Care Provider Name & ID No.");
93                                                this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(231) }, "Student Indicator");
94                                                this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(295) }, "Handicap");
95                                                this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(315) }, "Living Will Code");
96                                                this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(316) }, "Organ Donor Code");
97                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Separate Bill");
98                                    this.add(CX.class, false, 0, 250, new Object[]{ getMessage() }, "Duplicate Patient");
99                                    this.add(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Publicity Code");
100                                               this.add(ID.class, false, 1, 0, new Object[]{ getMessage(), new Integer(136) }, "Protection Indicator");
101                                   this.add(DT.class, false, 1, 0, new Object[]{ getMessage() }, "Protection Indicator Effective Date");
102                                   this.add(XON.class, false, 0, 250, new Object[]{ getMessage() }, "Place of Worship");
103                                   this.add(CWE.class, false, 0, 705, new Object[]{ getMessage() }, "Advance Directive Code");
104                                               this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(441) }, "Immunization Registry Status");
105                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Immunization Registry Status Effective Date");
106                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Publicity Code Effective Date");
107                                               this.add(IS.class, false, 1, 5, new Object[]{ getMessage(), new Integer(140) }, "Military Branch");
108                                               this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(141) }, "Military Rank/Grade");
109                                               this.add(IS.class, false, 1, 3, new Object[]{ getMessage(), new Integer(142) }, "Military Status");
110                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Advance Directive Last Verified Date");
111        } catch(HL7Exception e) {
112           log.error("Unexpected error creating PD1 - this is probably a bug in the source code generator.", e);
113        }
114     }
115 
116 
117     /**
118      * Returns all repetitions of Living Dependency (PD1-1).
119      */
120     public IS[] getLivingDependency() {
121     	IS[] retVal = this.getTypedField(1, new IS[0]);
122     	return retVal;
123     }
124 
125 
126     /**
127      * Returns all repetitions of Living Dependency (PD1-1).
128      */
129     public IS[] getPd11_LivingDependency() {
130     	IS[] retVal = this.getTypedField(1, new IS[0]);
131     	return retVal;
132     }
133 
134 
135     /**
136      * Returns a count of the current number of repetitions of Living Dependency (PD1-1).
137      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
138      * it will return zero.
139      */
140     public int getLivingDependencyReps() {
141     	return this.getReps(1);
142     }
143 
144 
145     /**
146      * Returns a specific repetition of
147      * PD1-1: "Living Dependency" - creates it if necessary
148      *
149      * @param rep The repetition index (0-indexed)
150      */
151     public IS getLivingDependency(int rep) { 
152 		IS retVal = this.getTypedField(1, rep);
153 		return retVal;
154     }
155 
156     /**
157      * Returns a specific repetition of
158      * PD1-1: "Living Dependency" - creates it if necessary
159      *
160      * @param rep The repetition index (0-indexed)
161      */
162     public IS getPd11_LivingDependency(int rep) { 
163 		IS retVal = this.getTypedField(1, rep);
164 		return retVal;
165     }
166 
167     /**
168      * Returns a count of the current number of repetitions of Living Dependency (PD1-1).
169      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
170      * it will return zero.
171      */
172     public int getPd11_LivingDependencyReps() {
173     	return this.getReps(1);
174     }
175 
176 
177     /**
178      * Inserts a repetition of
179      * PD1-1: "Living Dependency" at a specific index
180      *
181      * @param rep The repetition index (0-indexed)
182      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
183      */
184     public IS insertLivingDependency(int rep) throws HL7Exception { 
185         return (IS) super.insertRepetition(1, rep);
186     }
187 
188 
189     /**
190      * Inserts a repetition of
191      * PD1-1: "Living Dependency" at a specific index
192      *
193      * @param rep The repetition index (0-indexed)
194      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
195      */
196     public IS insertPd11_LivingDependency(int rep) throws HL7Exception { 
197         return (IS) super.insertRepetition(1, rep);
198     }
199 
200 
201     /**
202      * Removes a repetition of
203      * PD1-1: "Living Dependency" at a specific index
204      *
205      * @param rep The repetition index (0-indexed)
206      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
207      */
208     public IS removeLivingDependency(int rep) throws HL7Exception { 
209         return (IS) super.removeRepetition(1, rep);
210     }
211 
212 
213     /**
214      * Removes a repetition of
215      * PD1-1: "Living Dependency" at a specific index
216      *
217      * @param rep The repetition index (0-indexed)
218      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
219      */
220     public IS removePd11_LivingDependency(int rep) throws HL7Exception { 
221         return (IS) super.removeRepetition(1, rep);
222     }
223 
224 
225 
226 
227     /**
228      * Returns
229      * PD1-2: "Living Arrangement" - creates it if necessary
230      */
231     public IS getLivingArrangement() { 
232 		IS retVal = this.getTypedField(2, 0);
233 		return retVal;
234     }
235     
236     /**
237      * Returns
238      * PD1-2: "Living Arrangement" - creates it if necessary
239      */
240     public IS getPd12_LivingArrangement() { 
241 		IS retVal = this.getTypedField(2, 0);
242 		return retVal;
243     }
244 
245 
246     /**
247      * Returns all repetitions of Patient Primary Facility (PD1-3).
248      */
249     public XON[] getPatientPrimaryFacility() {
250     	XON[] retVal = this.getTypedField(3, new XON[0]);
251     	return retVal;
252     }
253 
254 
255     /**
256      * Returns all repetitions of Patient Primary Facility (PD1-3).
257      */
258     public XON[] getPd13_PatientPrimaryFacility() {
259     	XON[] retVal = this.getTypedField(3, new XON[0]);
260     	return retVal;
261     }
262 
263 
264     /**
265      * Returns a count of the current number of repetitions of Patient Primary Facility (PD1-3).
266      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
267      * it will return zero.
268      */
269     public int getPatientPrimaryFacilityReps() {
270     	return this.getReps(3);
271     }
272 
273 
274     /**
275      * Returns a specific repetition of
276      * PD1-3: "Patient Primary Facility" - creates it if necessary
277      *
278      * @param rep The repetition index (0-indexed)
279      */
280     public XON getPatientPrimaryFacility(int rep) { 
281 		XON retVal = this.getTypedField(3, rep);
282 		return retVal;
283     }
284 
285     /**
286      * Returns a specific repetition of
287      * PD1-3: "Patient Primary Facility" - creates it if necessary
288      *
289      * @param rep The repetition index (0-indexed)
290      */
291     public XON getPd13_PatientPrimaryFacility(int rep) { 
292 		XON retVal = this.getTypedField(3, rep);
293 		return retVal;
294     }
295 
296     /**
297      * Returns a count of the current number of repetitions of Patient Primary Facility (PD1-3).
298      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
299      * it will return zero.
300      */
301     public int getPd13_PatientPrimaryFacilityReps() {
302     	return this.getReps(3);
303     }
304 
305 
306     /**
307      * Inserts a repetition of
308      * PD1-3: "Patient Primary Facility" at a specific index
309      *
310      * @param rep The repetition index (0-indexed)
311      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
312      */
313     public XON insertPatientPrimaryFacility(int rep) throws HL7Exception { 
314         return (XON) super.insertRepetition(3, rep);
315     }
316 
317 
318     /**
319      * Inserts a repetition of
320      * PD1-3: "Patient Primary Facility" at a specific index
321      *
322      * @param rep The repetition index (0-indexed)
323      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
324      */
325     public XON insertPd13_PatientPrimaryFacility(int rep) throws HL7Exception { 
326         return (XON) super.insertRepetition(3, rep);
327     }
328 
329 
330     /**
331      * Removes a repetition of
332      * PD1-3: "Patient Primary Facility" at a specific index
333      *
334      * @param rep The repetition index (0-indexed)
335      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
336      */
337     public XON removePatientPrimaryFacility(int rep) throws HL7Exception { 
338         return (XON) super.removeRepetition(3, rep);
339     }
340 
341 
342     /**
343      * Removes a repetition of
344      * PD1-3: "Patient Primary Facility" at a specific index
345      *
346      * @param rep The repetition index (0-indexed)
347      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
348      */
349     public XON removePd13_PatientPrimaryFacility(int rep) throws HL7Exception { 
350         return (XON) super.removeRepetition(3, rep);
351     }
352 
353 
354 
355     /**
356      * Returns all repetitions of Patient Primary Care Provider Name & ID No. (PD1-4).
357      */
358     public XCN[] getPatientPrimaryCareProviderNameIDNo() {
359     	XCN[] retVal = this.getTypedField(4, new XCN[0]);
360     	return retVal;
361     }
362 
363 
364     /**
365      * Returns all repetitions of Patient Primary Care Provider Name & ID No. (PD1-4).
366      */
367     public XCN[] getPd14_PatientPrimaryCareProviderNameIDNo() {
368     	XCN[] retVal = this.getTypedField(4, new XCN[0]);
369     	return retVal;
370     }
371 
372 
373     /**
374      * Returns a count of the current number of repetitions of Patient Primary Care Provider Name & ID No. (PD1-4).
375      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
376      * it will return zero.
377      */
378     public int getPatientPrimaryCareProviderNameIDNoReps() {
379     	return this.getReps(4);
380     }
381 
382 
383     /**
384      * Returns a specific repetition of
385      * PD1-4: "Patient Primary Care Provider Name & ID No." - creates it if necessary
386      *
387      * @param rep The repetition index (0-indexed)
388      */
389     public XCN getPatientPrimaryCareProviderNameIDNo(int rep) { 
390 		XCN retVal = this.getTypedField(4, rep);
391 		return retVal;
392     }
393 
394     /**
395      * Returns a specific repetition of
396      * PD1-4: "Patient Primary Care Provider Name & ID No." - creates it if necessary
397      *
398      * @param rep The repetition index (0-indexed)
399      */
400     public XCN getPd14_PatientPrimaryCareProviderNameIDNo(int rep) { 
401 		XCN retVal = this.getTypedField(4, rep);
402 		return retVal;
403     }
404 
405     /**
406      * Returns a count of the current number of repetitions of Patient Primary Care Provider Name & ID No. (PD1-4).
407      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
408      * it will return zero.
409      */
410     public int getPd14_PatientPrimaryCareProviderNameIDNoReps() {
411     	return this.getReps(4);
412     }
413 
414 
415     /**
416      * Inserts a repetition of
417      * PD1-4: "Patient Primary Care Provider Name & ID No." at a specific index
418      *
419      * @param rep The repetition index (0-indexed)
420      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
421      */
422     public XCN insertPatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception { 
423         return (XCN) super.insertRepetition(4, rep);
424     }
425 
426 
427     /**
428      * Inserts a repetition of
429      * PD1-4: "Patient Primary Care Provider Name & ID No." at a specific index
430      *
431      * @param rep The repetition index (0-indexed)
432      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
433      */
434     public XCN insertPd14_PatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception { 
435         return (XCN) super.insertRepetition(4, rep);
436     }
437 
438 
439     /**
440      * Removes a repetition of
441      * PD1-4: "Patient Primary Care Provider Name & ID No." at a specific index
442      *
443      * @param rep The repetition index (0-indexed)
444      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
445      */
446     public XCN removePatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception { 
447         return (XCN) super.removeRepetition(4, rep);
448     }
449 
450 
451     /**
452      * Removes a repetition of
453      * PD1-4: "Patient Primary Care Provider Name & ID No." at a specific index
454      *
455      * @param rep The repetition index (0-indexed)
456      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
457      */
458     public XCN removePd14_PatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception { 
459         return (XCN) super.removeRepetition(4, rep);
460     }
461 
462 
463 
464 
465     /**
466      * Returns
467      * PD1-5: "Student Indicator" - creates it if necessary
468      */
469     public IS getStudentIndicator() { 
470 		IS retVal = this.getTypedField(5, 0);
471 		return retVal;
472     }
473     
474     /**
475      * Returns
476      * PD1-5: "Student Indicator" - creates it if necessary
477      */
478     public IS getPd15_StudentIndicator() { 
479 		IS retVal = this.getTypedField(5, 0);
480 		return retVal;
481     }
482 
483 
484 
485     /**
486      * Returns
487      * PD1-6: "Handicap" - creates it if necessary
488      */
489     public IS getHandicap() { 
490 		IS retVal = this.getTypedField(6, 0);
491 		return retVal;
492     }
493     
494     /**
495      * Returns
496      * PD1-6: "Handicap" - creates it if necessary
497      */
498     public IS getPd16_Handicap() { 
499 		IS retVal = this.getTypedField(6, 0);
500 		return retVal;
501     }
502 
503 
504 
505     /**
506      * Returns
507      * PD1-7: "Living Will Code" - creates it if necessary
508      */
509     public IS getLivingWillCode() { 
510 		IS retVal = this.getTypedField(7, 0);
511 		return retVal;
512     }
513     
514     /**
515      * Returns
516      * PD1-7: "Living Will Code" - creates it if necessary
517      */
518     public IS getPd17_LivingWillCode() { 
519 		IS retVal = this.getTypedField(7, 0);
520 		return retVal;
521     }
522 
523 
524 
525     /**
526      * Returns
527      * PD1-8: "Organ Donor Code" - creates it if necessary
528      */
529     public IS getOrganDonorCode() { 
530 		IS retVal = this.getTypedField(8, 0);
531 		return retVal;
532     }
533     
534     /**
535      * Returns
536      * PD1-8: "Organ Donor Code" - creates it if necessary
537      */
538     public IS getPd18_OrganDonorCode() { 
539 		IS retVal = this.getTypedField(8, 0);
540 		return retVal;
541     }
542 
543 
544 
545     /**
546      * Returns
547      * PD1-9: "Separate Bill" - creates it if necessary
548      */
549     public ID getSeparateBill() { 
550 		ID retVal = this.getTypedField(9, 0);
551 		return retVal;
552     }
553     
554     /**
555      * Returns
556      * PD1-9: "Separate Bill" - creates it if necessary
557      */
558     public ID getPd19_SeparateBill() { 
559 		ID retVal = this.getTypedField(9, 0);
560 		return retVal;
561     }
562 
563 
564     /**
565      * Returns all repetitions of Duplicate Patient (PD1-10).
566      */
567     public CX[] getDuplicatePatient() {
568     	CX[] retVal = this.getTypedField(10, new CX[0]);
569     	return retVal;
570     }
571 
572 
573     /**
574      * Returns all repetitions of Duplicate Patient (PD1-10).
575      */
576     public CX[] getPd110_DuplicatePatient() {
577     	CX[] retVal = this.getTypedField(10, new CX[0]);
578     	return retVal;
579     }
580 
581 
582     /**
583      * Returns a count of the current number of repetitions of Duplicate Patient (PD1-10).
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 getDuplicatePatientReps() {
588     	return this.getReps(10);
589     }
590 
591 
592     /**
593      * Returns a specific repetition of
594      * PD1-10: "Duplicate Patient" - creates it if necessary
595      *
596      * @param rep The repetition index (0-indexed)
597      */
598     public CX getDuplicatePatient(int rep) { 
599 		CX retVal = this.getTypedField(10, rep);
600 		return retVal;
601     }
602 
603     /**
604      * Returns a specific repetition of
605      * PD1-10: "Duplicate Patient" - creates it if necessary
606      *
607      * @param rep The repetition index (0-indexed)
608      */
609     public CX getPd110_DuplicatePatient(int rep) { 
610 		CX retVal = this.getTypedField(10, rep);
611 		return retVal;
612     }
613 
614     /**
615      * Returns a count of the current number of repetitions of Duplicate Patient (PD1-10).
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 getPd110_DuplicatePatientReps() {
620     	return this.getReps(10);
621     }
622 
623 
624     /**
625      * Inserts a repetition of
626      * PD1-10: "Duplicate Patient" 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 CX insertDuplicatePatient(int rep) throws HL7Exception { 
632         return (CX) super.insertRepetition(10, rep);
633     }
634 
635 
636     /**
637      * Inserts a repetition of
638      * PD1-10: "Duplicate Patient" 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 CX insertPd110_DuplicatePatient(int rep) throws HL7Exception { 
644         return (CX) super.insertRepetition(10, rep);
645     }
646 
647 
648     /**
649      * Removes a repetition of
650      * PD1-10: "Duplicate Patient" 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 CX removeDuplicatePatient(int rep) throws HL7Exception { 
656         return (CX) super.removeRepetition(10, rep);
657     }
658 
659 
660     /**
661      * Removes a repetition of
662      * PD1-10: "Duplicate Patient" 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 CX removePd110_DuplicatePatient(int rep) throws HL7Exception { 
668         return (CX) super.removeRepetition(10, rep);
669     }
670 
671 
672 
673 
674     /**
675      * Returns
676      * PD1-11: "Publicity Code" - creates it if necessary
677      */
678     public CWE getPublicityCode() { 
679 		CWE retVal = this.getTypedField(11, 0);
680 		return retVal;
681     }
682     
683     /**
684      * Returns
685      * PD1-11: "Publicity Code" - creates it if necessary
686      */
687     public CWE getPd111_PublicityCode() { 
688 		CWE retVal = this.getTypedField(11, 0);
689 		return retVal;
690     }
691 
692 
693 
694     /**
695      * Returns
696      * PD1-12: "Protection Indicator" - creates it if necessary
697      */
698     public ID getProtectionIndicator() { 
699 		ID retVal = this.getTypedField(12, 0);
700 		return retVal;
701     }
702     
703     /**
704      * Returns
705      * PD1-12: "Protection Indicator" - creates it if necessary
706      */
707     public ID getPd112_ProtectionIndicator() { 
708 		ID retVal = this.getTypedField(12, 0);
709 		return retVal;
710     }
711 
712 
713 
714     /**
715      * Returns
716      * PD1-13: "Protection Indicator Effective Date" - creates it if necessary
717      */
718     public DT getProtectionIndicatorEffectiveDate() { 
719 		DT retVal = this.getTypedField(13, 0);
720 		return retVal;
721     }
722     
723     /**
724      * Returns
725      * PD1-13: "Protection Indicator Effective Date" - creates it if necessary
726      */
727     public DT getPd113_ProtectionIndicatorEffectiveDate() { 
728 		DT retVal = this.getTypedField(13, 0);
729 		return retVal;
730     }
731 
732 
733     /**
734      * Returns all repetitions of Place of Worship (PD1-14).
735      */
736     public XON[] getPlaceOfWorship() {
737     	XON[] retVal = this.getTypedField(14, new XON[0]);
738     	return retVal;
739     }
740 
741 
742     /**
743      * Returns all repetitions of Place of Worship (PD1-14).
744      */
745     public XON[] getPd114_PlaceOfWorship() {
746     	XON[] retVal = this.getTypedField(14, new XON[0]);
747     	return retVal;
748     }
749 
750 
751     /**
752      * Returns a count of the current number of repetitions of Place of Worship (PD1-14).
753      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
754      * it will return zero.
755      */
756     public int getPlaceOfWorshipReps() {
757     	return this.getReps(14);
758     }
759 
760 
761     /**
762      * Returns a specific repetition of
763      * PD1-14: "Place of Worship" - creates it if necessary
764      *
765      * @param rep The repetition index (0-indexed)
766      */
767     public XON getPlaceOfWorship(int rep) { 
768 		XON retVal = this.getTypedField(14, rep);
769 		return retVal;
770     }
771 
772     /**
773      * Returns a specific repetition of
774      * PD1-14: "Place of Worship" - creates it if necessary
775      *
776      * @param rep The repetition index (0-indexed)
777      */
778     public XON getPd114_PlaceOfWorship(int rep) { 
779 		XON retVal = this.getTypedField(14, rep);
780 		return retVal;
781     }
782 
783     /**
784      * Returns a count of the current number of repetitions of Place of Worship (PD1-14).
785      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
786      * it will return zero.
787      */
788     public int getPd114_PlaceOfWorshipReps() {
789     	return this.getReps(14);
790     }
791 
792 
793     /**
794      * Inserts a repetition of
795      * PD1-14: "Place of Worship" at a specific index
796      *
797      * @param rep The repetition index (0-indexed)
798      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
799      */
800     public XON insertPlaceOfWorship(int rep) throws HL7Exception { 
801         return (XON) super.insertRepetition(14, rep);
802     }
803 
804 
805     /**
806      * Inserts a repetition of
807      * PD1-14: "Place of Worship" at a specific index
808      *
809      * @param rep The repetition index (0-indexed)
810      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
811      */
812     public XON insertPd114_PlaceOfWorship(int rep) throws HL7Exception { 
813         return (XON) super.insertRepetition(14, rep);
814     }
815 
816 
817     /**
818      * Removes a repetition of
819      * PD1-14: "Place of Worship" at a specific index
820      *
821      * @param rep The repetition index (0-indexed)
822      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
823      */
824     public XON removePlaceOfWorship(int rep) throws HL7Exception { 
825         return (XON) super.removeRepetition(14, rep);
826     }
827 
828 
829     /**
830      * Removes a repetition of
831      * PD1-14: "Place of Worship" at a specific index
832      *
833      * @param rep The repetition index (0-indexed)
834      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
835      */
836     public XON removePd114_PlaceOfWorship(int rep) throws HL7Exception { 
837         return (XON) super.removeRepetition(14, rep);
838     }
839 
840 
841 
842     /**
843      * Returns all repetitions of Advance Directive Code (PD1-15).
844      */
845     public CWE[] getAdvanceDirectiveCode() {
846     	CWE[] retVal = this.getTypedField(15, new CWE[0]);
847     	return retVal;
848     }
849 
850 
851     /**
852      * Returns all repetitions of Advance Directive Code (PD1-15).
853      */
854     public CWE[] getPd115_AdvanceDirectiveCode() {
855     	CWE[] retVal = this.getTypedField(15, new CWE[0]);
856     	return retVal;
857     }
858 
859 
860     /**
861      * Returns a count of the current number of repetitions of Advance Directive Code (PD1-15).
862      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
863      * it will return zero.
864      */
865     public int getAdvanceDirectiveCodeReps() {
866     	return this.getReps(15);
867     }
868 
869 
870     /**
871      * Returns a specific repetition of
872      * PD1-15: "Advance Directive Code" - creates it if necessary
873      *
874      * @param rep The repetition index (0-indexed)
875      */
876     public CWE getAdvanceDirectiveCode(int rep) { 
877 		CWE retVal = this.getTypedField(15, rep);
878 		return retVal;
879     }
880 
881     /**
882      * Returns a specific repetition of
883      * PD1-15: "Advance Directive Code" - creates it if necessary
884      *
885      * @param rep The repetition index (0-indexed)
886      */
887     public CWE getPd115_AdvanceDirectiveCode(int rep) { 
888 		CWE retVal = this.getTypedField(15, rep);
889 		return retVal;
890     }
891 
892     /**
893      * Returns a count of the current number of repetitions of Advance Directive Code (PD1-15).
894      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
895      * it will return zero.
896      */
897     public int getPd115_AdvanceDirectiveCodeReps() {
898     	return this.getReps(15);
899     }
900 
901 
902     /**
903      * Inserts a repetition of
904      * PD1-15: "Advance Directive Code" at a specific index
905      *
906      * @param rep The repetition index (0-indexed)
907      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
908      */
909     public CWE insertAdvanceDirectiveCode(int rep) throws HL7Exception { 
910         return (CWE) super.insertRepetition(15, rep);
911     }
912 
913 
914     /**
915      * Inserts a repetition of
916      * PD1-15: "Advance Directive Code" at a specific index
917      *
918      * @param rep The repetition index (0-indexed)
919      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
920      */
921     public CWE insertPd115_AdvanceDirectiveCode(int rep) throws HL7Exception { 
922         return (CWE) super.insertRepetition(15, rep);
923     }
924 
925 
926     /**
927      * Removes a repetition of
928      * PD1-15: "Advance Directive Code" at a specific index
929      *
930      * @param rep The repetition index (0-indexed)
931      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
932      */
933     public CWE removeAdvanceDirectiveCode(int rep) throws HL7Exception { 
934         return (CWE) super.removeRepetition(15, rep);
935     }
936 
937 
938     /**
939      * Removes a repetition of
940      * PD1-15: "Advance Directive Code" at a specific index
941      *
942      * @param rep The repetition index (0-indexed)
943      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
944      */
945     public CWE removePd115_AdvanceDirectiveCode(int rep) throws HL7Exception { 
946         return (CWE) super.removeRepetition(15, rep);
947     }
948 
949 
950 
951 
952     /**
953      * Returns
954      * PD1-16: "Immunization Registry Status" - creates it if necessary
955      */
956     public IS getImmunizationRegistryStatus() { 
957 		IS retVal = this.getTypedField(16, 0);
958 		return retVal;
959     }
960     
961     /**
962      * Returns
963      * PD1-16: "Immunization Registry Status" - creates it if necessary
964      */
965     public IS getPd116_ImmunizationRegistryStatus() { 
966 		IS retVal = this.getTypedField(16, 0);
967 		return retVal;
968     }
969 
970 
971 
972     /**
973      * Returns
974      * PD1-17: "Immunization Registry Status Effective Date" - creates it if necessary
975      */
976     public DT getImmunizationRegistryStatusEffectiveDate() { 
977 		DT retVal = this.getTypedField(17, 0);
978 		return retVal;
979     }
980     
981     /**
982      * Returns
983      * PD1-17: "Immunization Registry Status Effective Date" - creates it if necessary
984      */
985     public DT getPd117_ImmunizationRegistryStatusEffectiveDate() { 
986 		DT retVal = this.getTypedField(17, 0);
987 		return retVal;
988     }
989 
990 
991 
992     /**
993      * Returns
994      * PD1-18: "Publicity Code Effective Date" - creates it if necessary
995      */
996     public DT getPublicityCodeEffectiveDate() { 
997 		DT retVal = this.getTypedField(18, 0);
998 		return retVal;
999     }
1000     
1001     /**
1002      * Returns
1003      * PD1-18: "Publicity Code Effective Date" - creates it if necessary
1004      */
1005     public DT getPd118_PublicityCodeEffectiveDate() { 
1006 		DT retVal = this.getTypedField(18, 0);
1007 		return retVal;
1008     }
1009 
1010 
1011 
1012     /**
1013      * Returns
1014      * PD1-19: "Military Branch" - creates it if necessary
1015      */
1016     public IS getMilitaryBranch() { 
1017 		IS retVal = this.getTypedField(19, 0);
1018 		return retVal;
1019     }
1020     
1021     /**
1022      * Returns
1023      * PD1-19: "Military Branch" - creates it if necessary
1024      */
1025     public IS getPd119_MilitaryBranch() { 
1026 		IS retVal = this.getTypedField(19, 0);
1027 		return retVal;
1028     }
1029 
1030 
1031 
1032     /**
1033      * Returns
1034      * PD1-20: "Military Rank/Grade" - creates it if necessary
1035      */
1036     public IS getMilitaryRankGrade() { 
1037 		IS retVal = this.getTypedField(20, 0);
1038 		return retVal;
1039     }
1040     
1041     /**
1042      * Returns
1043      * PD1-20: "Military Rank/Grade" - creates it if necessary
1044      */
1045     public IS getPd120_MilitaryRankGrade() { 
1046 		IS retVal = this.getTypedField(20, 0);
1047 		return retVal;
1048     }
1049 
1050 
1051 
1052     /**
1053      * Returns
1054      * PD1-21: "Military Status" - creates it if necessary
1055      */
1056     public IS getMilitaryStatus() { 
1057 		IS retVal = this.getTypedField(21, 0);
1058 		return retVal;
1059     }
1060     
1061     /**
1062      * Returns
1063      * PD1-21: "Military Status" - creates it if necessary
1064      */
1065     public IS getPd121_MilitaryStatus() { 
1066 		IS retVal = this.getTypedField(21, 0);
1067 		return retVal;
1068     }
1069 
1070 
1071 
1072     /**
1073      * Returns
1074      * PD1-22: "Advance Directive Last Verified Date" - creates it if necessary
1075      */
1076     public DT getAdvanceDirectiveLastVerifiedDate() { 
1077 		DT retVal = this.getTypedField(22, 0);
1078 		return retVal;
1079     }
1080     
1081     /**
1082      * Returns
1083      * PD1-22: "Advance Directive Last Verified Date" - creates it if necessary
1084      */
1085     public DT getPd122_AdvanceDirectiveLastVerifiedDate() { 
1086 		DT retVal = this.getTypedField(22, 0);
1087 		return retVal;
1088     }
1089 
1090 
1091 
1092 
1093 
1094     /** {@inheritDoc} */   
1095     protected Type createNewTypeWithoutReflection(int field) {
1096        switch (field) {
1097           case 0: return new IS(getMessage(), new Integer( 223 ));
1098           case 1: return new IS(getMessage(), new Integer( 220 ));
1099           case 2: return new XON(getMessage());
1100           case 3: return new XCN(getMessage());
1101           case 4: return new IS(getMessage(), new Integer( 231 ));
1102           case 5: return new IS(getMessage(), new Integer( 295 ));
1103           case 6: return new IS(getMessage(), new Integer( 315 ));
1104           case 7: return new IS(getMessage(), new Integer( 316 ));
1105           case 8: return new ID(getMessage(), new Integer( 136 ));
1106           case 9: return new CX(getMessage());
1107           case 10: return new CWE(getMessage());
1108           case 11: return new ID(getMessage(), new Integer( 136 ));
1109           case 12: return new DT(getMessage());
1110           case 13: return new XON(getMessage());
1111           case 14: return new CWE(getMessage());
1112           case 15: return new IS(getMessage(), new Integer( 441 ));
1113           case 16: return new DT(getMessage());
1114           case 17: return new DT(getMessage());
1115           case 18: return new IS(getMessage(), new Integer( 140 ));
1116           case 19: return new IS(getMessage(), new Integer( 141 ));
1117           case 20: return new IS(getMessage(), new Integer( 142 ));
1118           case 21: return new DT(getMessage());
1119           default: return null;
1120        }
1121    }
1122 
1123 
1124 }
1125