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