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