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.v251.segment;
035
036// import ca.uhn.hl7v2.model.v251.group.*;
037import ca.uhn.hl7v2.model.v251.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 PV2 message segment (Patient Visit - Additional Information). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>PV2-1: Prior Pending Location (PL) <b>optional </b>
052     * <li>PV2-2: Accommodation Code (CE) <b>optional </b>
053     * <li>PV2-3: Admit Reason (CE) <b>optional </b>
054     * <li>PV2-4: Transfer Reason (CE) <b>optional </b>
055     * <li>PV2-5: Patient Valuables (ST) <b>optional repeating</b>
056     * <li>PV2-6: Patient Valuables Location (ST) <b>optional </b>
057     * <li>PV2-7: Visit User Code (IS) <b>optional repeating</b>
058     * <li>PV2-8: Expected Admit Date/Time (TS) <b>optional </b>
059     * <li>PV2-9: Expected Discharge Date/Time (TS) <b>optional </b>
060     * <li>PV2-10: Estimated Length of Inpatient Stay (NM) <b>optional </b>
061     * <li>PV2-11: Actual Length of Inpatient Stay (NM) <b>optional </b>
062     * <li>PV2-12: Visit Description (ST) <b>optional </b>
063     * <li>PV2-13: Referral Source Code (XCN) <b>optional repeating</b>
064     * <li>PV2-14: Previous Service Date (DT) <b>optional </b>
065     * <li>PV2-15: Employment Illness Related Indicator (ID) <b>optional </b>
066     * <li>PV2-16: Purge Status Code (IS) <b>optional </b>
067     * <li>PV2-17: Purge Status Date (DT) <b>optional </b>
068     * <li>PV2-18: Special Program Code (IS) <b>optional </b>
069     * <li>PV2-19: Retention Indicator (ID) <b>optional </b>
070     * <li>PV2-20: Expected Number of Insurance Plans (NM) <b>optional </b>
071     * <li>PV2-21: Visit Publicity Code (IS) <b>optional </b>
072     * <li>PV2-22: Visit Protection Indicator (ID) <b>optional </b>
073     * <li>PV2-23: Clinic Organization Name (XON) <b>optional repeating</b>
074     * <li>PV2-24: Patient Status Code (IS) <b>optional </b>
075     * <li>PV2-25: Visit Priority Code (IS) <b>optional </b>
076     * <li>PV2-26: Previous Treatment Date (DT) <b>optional </b>
077     * <li>PV2-27: Expected Discharge Disposition (IS) <b>optional </b>
078     * <li>PV2-28: Signature on File Date (DT) <b>optional </b>
079     * <li>PV2-29: First Similar Illness Date (DT) <b>optional </b>
080     * <li>PV2-30: Patient Charge Adjustment Code (CE) <b>optional </b>
081     * <li>PV2-31: Recurring Service Code (IS) <b>optional </b>
082     * <li>PV2-32: Billing Media Code (ID) <b>optional </b>
083     * <li>PV2-33: Expected Surgery Date and Time (TS) <b>optional </b>
084     * <li>PV2-34: Military Partnership Code (ID) <b>optional </b>
085     * <li>PV2-35: Military Non-Availability Code (ID) <b>optional </b>
086     * <li>PV2-36: Newborn Baby Indicator (ID) <b>optional </b>
087     * <li>PV2-37: Baby Detained Indicator (ID) <b>optional </b>
088     * <li>PV2-38: Mode of Arrival Code (CE) <b>optional </b>
089     * <li>PV2-39: Recreational Drug Use Code (CE) <b>optional repeating</b>
090     * <li>PV2-40: Admission Level of Care Code (CE) <b>optional </b>
091     * <li>PV2-41: Precaution Code (CE) <b>optional repeating</b>
092     * <li>PV2-42: Patient Condition Code (CE) <b>optional </b>
093     * <li>PV2-43: Living Will Code (IS) <b>optional </b>
094     * <li>PV2-44: Organ Donor Code (IS) <b>optional </b>
095     * <li>PV2-45: Advance Directive Code (CE) <b>optional repeating</b>
096     * <li>PV2-46: Patient Status Effective Date (DT) <b>optional </b>
097     * <li>PV2-47: Expected LOA Return Date/Time (TS) <b>optional </b>
098     * <li>PV2-48: Expected Pre-admission Testing Date/Time (TS) <b>optional </b>
099     * <li>PV2-49: Notify Clergy Code (IS) <b>optional repeating</b>
100 * </ul>
101 */
102@SuppressWarnings("unused")
103public class PV2 extends AbstractSegment {
104
105    /** 
106     * Creates a new PV2 segment
107     */
108    public PV2(Group parent, ModelClassFactory factory) {
109       super(parent, factory);
110       init(factory);
111    }
112
113    private void init(ModelClassFactory factory) {
114       try {
115                                  this.add(PL.class, false, 1, 80, new Object[]{ getMessage() }, "Prior Pending Location");
116                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Accommodation Code");
117                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Admit Reason");
118                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Transfer Reason");
119                                  this.add(ST.class, false, 0, 25, new Object[]{ getMessage() }, "Patient Valuables");
120                                  this.add(ST.class, false, 1, 25, new Object[]{ getMessage() }, "Patient Valuables Location");
121                                              this.add(IS.class, false, 0, 2, new Object[]{ getMessage(), new Integer(130) }, "Visit User Code");
122                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expected Admit Date/Time");
123                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expected Discharge Date/Time");
124                                  this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "Estimated Length of Inpatient Stay");
125                                  this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "Actual Length of Inpatient Stay");
126                                  this.add(ST.class, false, 1, 50, new Object[]{ getMessage() }, "Visit Description");
127                                  this.add(XCN.class, false, 0, 250, new Object[]{ getMessage() }, "Referral Source Code");
128                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Previous Service Date");
129                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Employment Illness Related Indicator");
130                                              this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(213) }, "Purge Status Code");
131                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Purge Status Date");
132                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(214) }, "Special Program Code");
133                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Retention Indicator");
134                                  this.add(NM.class, false, 1, 1, new Object[]{ getMessage() }, "Expected Number of Insurance Plans");
135                                              this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(215) }, "Visit Publicity Code");
136                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Visit Protection Indicator");
137                                  this.add(XON.class, false, 0, 250, new Object[]{ getMessage() }, "Clinic Organization Name");
138                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(216) }, "Patient Status Code");
139                                              this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(217) }, "Visit Priority Code");
140                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Previous Treatment Date");
141                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(112) }, "Expected Discharge Disposition");
142                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Signature on File Date");
143                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "First Similar Illness Date");
144                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Patient Charge Adjustment Code");
145                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(219) }, "Recurring Service Code");
146                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Billing Media Code");
147                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expected Surgery Date and Time");
148                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Military Partnership Code");
149                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Military Non-Availability Code");
150                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Newborn Baby Indicator");
151                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Baby Detained Indicator");
152                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Mode of Arrival Code");
153                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Recreational Drug Use Code");
154                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Admission Level of Care Code");
155                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Precaution Code");
156                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Patient Condition Code");
157                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(315) }, "Living Will Code");
158                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(316) }, "Organ Donor Code");
159                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Advance Directive Code");
160                                  this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Patient Status Effective Date");
161                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expected LOA Return Date/Time");
162                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expected Pre-admission Testing Date/Time");
163                                              this.add(IS.class, false, 0, 20, new Object[]{ getMessage(), new Integer(534) }, "Notify Clergy Code");
164       } catch(HL7Exception e) {
165          log.error("Unexpected error creating PV2 - this is probably a bug in the source code generator.", e);
166       }
167    }
168
169
170
171    /**
172     * Returns
173     * PV2-1: "Prior Pending Location" - creates it if necessary
174     */
175    public PL getPriorPendingLocation() { 
176                PL retVal = this.getTypedField(1, 0);
177                return retVal;
178    }
179    
180    /**
181     * Returns
182     * PV2-1: "Prior Pending Location" - creates it if necessary
183     */
184    public PL getPv21_PriorPendingLocation() { 
185                PL retVal = this.getTypedField(1, 0);
186                return retVal;
187    }
188
189
190
191    /**
192     * Returns
193     * PV2-2: "Accommodation Code" - creates it if necessary
194     */
195    public CE getAccommodationCode() { 
196                CE retVal = this.getTypedField(2, 0);
197                return retVal;
198    }
199    
200    /**
201     * Returns
202     * PV2-2: "Accommodation Code" - creates it if necessary
203     */
204    public CE getPv22_AccommodationCode() { 
205                CE retVal = this.getTypedField(2, 0);
206                return retVal;
207    }
208
209
210
211    /**
212     * Returns
213     * PV2-3: "Admit Reason" - creates it if necessary
214     */
215    public CE getAdmitReason() { 
216                CE retVal = this.getTypedField(3, 0);
217                return retVal;
218    }
219    
220    /**
221     * Returns
222     * PV2-3: "Admit Reason" - creates it if necessary
223     */
224    public CE getPv23_AdmitReason() { 
225                CE retVal = this.getTypedField(3, 0);
226                return retVal;
227    }
228
229
230
231    /**
232     * Returns
233     * PV2-4: "Transfer Reason" - creates it if necessary
234     */
235    public CE getTransferReason() { 
236                CE retVal = this.getTypedField(4, 0);
237                return retVal;
238    }
239    
240    /**
241     * Returns
242     * PV2-4: "Transfer Reason" - creates it if necessary
243     */
244    public CE getPv24_TransferReason() { 
245                CE retVal = this.getTypedField(4, 0);
246                return retVal;
247    }
248
249
250    /**
251     * Returns all repetitions of Patient Valuables (PV2-5).
252     */
253    public ST[] getPatientValuables() {
254        ST[] retVal = this.getTypedField(5, new ST[0]);
255        return retVal;
256    }
257
258
259    /**
260     * Returns all repetitions of Patient Valuables (PV2-5).
261     */
262    public ST[] getPv25_PatientValuables() {
263        ST[] retVal = this.getTypedField(5, new ST[0]);
264        return retVal;
265    }
266
267
268    /**
269     * Returns a count of the current number of repetitions of Patient Valuables (PV2-5).
270     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
271     * it will return zero.
272     */
273    public int getPatientValuablesReps() {
274        return this.getReps(5);
275    }
276
277
278    /**
279     * Returns a specific repetition of
280     * PV2-5: "Patient Valuables" - creates it if necessary
281     *
282     * @param rep The repetition index (0-indexed)
283     */
284    public ST getPatientValuables(int rep) { 
285                ST retVal = this.getTypedField(5, rep);
286                return retVal;
287    }
288
289    /**
290     * Returns a specific repetition of
291     * PV2-5: "Patient Valuables" - creates it if necessary
292     *
293     * @param rep The repetition index (0-indexed)
294     */
295    public ST getPv25_PatientValuables(int rep) { 
296                ST retVal = this.getTypedField(5, rep);
297                return retVal;
298    }
299
300    /**
301     * Returns a count of the current number of repetitions of Patient Valuables (PV2-5).
302     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
303     * it will return zero.
304     */
305    public int getPv25_PatientValuablesReps() {
306        return this.getReps(5);
307    }
308
309
310    /**
311     * Inserts a repetition of
312     * PV2-5: "Patient Valuables" at a specific index
313     *
314     * @param rep The repetition index (0-indexed)
315     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
316     */
317    public ST insertPatientValuables(int rep) throws HL7Exception { 
318        return (ST) super.insertRepetition(5, rep);
319    }
320
321
322    /**
323     * Inserts a repetition of
324     * PV2-5: "Patient Valuables" at a specific index
325     *
326     * @param rep The repetition index (0-indexed)
327     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
328     */
329    public ST insertPv25_PatientValuables(int rep) throws HL7Exception { 
330        return (ST) super.insertRepetition(5, rep);
331    }
332
333
334    /**
335     * Removes a repetition of
336     * PV2-5: "Patient Valuables" at a specific index
337     *
338     * @param rep The repetition index (0-indexed)
339     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
340     */
341    public ST removePatientValuables(int rep) throws HL7Exception { 
342        return (ST) super.removeRepetition(5, rep);
343    }
344
345
346    /**
347     * Removes a repetition of
348     * PV2-5: "Patient Valuables" at a specific index
349     *
350     * @param rep The repetition index (0-indexed)
351     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
352     */
353    public ST removePv25_PatientValuables(int rep) throws HL7Exception { 
354        return (ST) super.removeRepetition(5, rep);
355    }
356
357
358
359
360    /**
361     * Returns
362     * PV2-6: "Patient Valuables Location" - creates it if necessary
363     */
364    public ST getPatientValuablesLocation() { 
365                ST retVal = this.getTypedField(6, 0);
366                return retVal;
367    }
368    
369    /**
370     * Returns
371     * PV2-6: "Patient Valuables Location" - creates it if necessary
372     */
373    public ST getPv26_PatientValuablesLocation() { 
374                ST retVal = this.getTypedField(6, 0);
375                return retVal;
376    }
377
378
379    /**
380     * Returns all repetitions of Visit User Code (PV2-7).
381     */
382    public IS[] getVisitUserCode() {
383        IS[] retVal = this.getTypedField(7, new IS[0]);
384        return retVal;
385    }
386
387
388    /**
389     * Returns all repetitions of Visit User Code (PV2-7).
390     */
391    public IS[] getPv27_VisitUserCode() {
392        IS[] retVal = this.getTypedField(7, new IS[0]);
393        return retVal;
394    }
395
396
397    /**
398     * Returns a count of the current number of repetitions of Visit User Code (PV2-7).
399     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
400     * it will return zero.
401     */
402    public int getVisitUserCodeReps() {
403        return this.getReps(7);
404    }
405
406
407    /**
408     * Returns a specific repetition of
409     * PV2-7: "Visit User Code" - creates it if necessary
410     *
411     * @param rep The repetition index (0-indexed)
412     */
413    public IS getVisitUserCode(int rep) { 
414                IS retVal = this.getTypedField(7, rep);
415                return retVal;
416    }
417
418    /**
419     * Returns a specific repetition of
420     * PV2-7: "Visit User Code" - creates it if necessary
421     *
422     * @param rep The repetition index (0-indexed)
423     */
424    public IS getPv27_VisitUserCode(int rep) { 
425                IS retVal = this.getTypedField(7, rep);
426                return retVal;
427    }
428
429    /**
430     * Returns a count of the current number of repetitions of Visit User Code (PV2-7).
431     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
432     * it will return zero.
433     */
434    public int getPv27_VisitUserCodeReps() {
435        return this.getReps(7);
436    }
437
438
439    /**
440     * Inserts a repetition of
441     * PV2-7: "Visit User Code" 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 IS insertVisitUserCode(int rep) throws HL7Exception { 
447        return (IS) super.insertRepetition(7, rep);
448    }
449
450
451    /**
452     * Inserts a repetition of
453     * PV2-7: "Visit User Code" 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 IS insertPv27_VisitUserCode(int rep) throws HL7Exception { 
459        return (IS) super.insertRepetition(7, rep);
460    }
461
462
463    /**
464     * Removes a repetition of
465     * PV2-7: "Visit User Code" at a specific index
466     *
467     * @param rep The repetition index (0-indexed)
468     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
469     */
470    public IS removeVisitUserCode(int rep) throws HL7Exception { 
471        return (IS) super.removeRepetition(7, rep);
472    }
473
474
475    /**
476     * Removes a repetition of
477     * PV2-7: "Visit User Code" at a specific index
478     *
479     * @param rep The repetition index (0-indexed)
480     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
481     */
482    public IS removePv27_VisitUserCode(int rep) throws HL7Exception { 
483        return (IS) super.removeRepetition(7, rep);
484    }
485
486
487
488
489    /**
490     * Returns
491     * PV2-8: "Expected Admit Date/Time" - creates it if necessary
492     */
493    public TS getExpectedAdmitDateTime() { 
494                TS retVal = this.getTypedField(8, 0);
495                return retVal;
496    }
497    
498    /**
499     * Returns
500     * PV2-8: "Expected Admit Date/Time" - creates it if necessary
501     */
502    public TS getPv28_ExpectedAdmitDateTime() { 
503                TS retVal = this.getTypedField(8, 0);
504                return retVal;
505    }
506
507
508
509    /**
510     * Returns
511     * PV2-9: "Expected Discharge Date/Time" - creates it if necessary
512     */
513    public TS getExpectedDischargeDateTime() { 
514                TS retVal = this.getTypedField(9, 0);
515                return retVal;
516    }
517    
518    /**
519     * Returns
520     * PV2-9: "Expected Discharge Date/Time" - creates it if necessary
521     */
522    public TS getPv29_ExpectedDischargeDateTime() { 
523                TS retVal = this.getTypedField(9, 0);
524                return retVal;
525    }
526
527
528
529    /**
530     * Returns
531     * PV2-10: "Estimated Length of Inpatient Stay" - creates it if necessary
532     */
533    public NM getEstimatedLengthOfInpatientStay() { 
534                NM retVal = this.getTypedField(10, 0);
535                return retVal;
536    }
537    
538    /**
539     * Returns
540     * PV2-10: "Estimated Length of Inpatient Stay" - creates it if necessary
541     */
542    public NM getPv210_EstimatedLengthOfInpatientStay() { 
543                NM retVal = this.getTypedField(10, 0);
544                return retVal;
545    }
546
547
548
549    /**
550     * Returns
551     * PV2-11: "Actual Length of Inpatient Stay" - creates it if necessary
552     */
553    public NM getActualLengthOfInpatientStay() { 
554                NM retVal = this.getTypedField(11, 0);
555                return retVal;
556    }
557    
558    /**
559     * Returns
560     * PV2-11: "Actual Length of Inpatient Stay" - creates it if necessary
561     */
562    public NM getPv211_ActualLengthOfInpatientStay() { 
563                NM retVal = this.getTypedField(11, 0);
564                return retVal;
565    }
566
567
568
569    /**
570     * Returns
571     * PV2-12: "Visit Description" - creates it if necessary
572     */
573    public ST getVisitDescription() { 
574                ST retVal = this.getTypedField(12, 0);
575                return retVal;
576    }
577    
578    /**
579     * Returns
580     * PV2-12: "Visit Description" - creates it if necessary
581     */
582    public ST getPv212_VisitDescription() { 
583                ST retVal = this.getTypedField(12, 0);
584                return retVal;
585    }
586
587
588    /**
589     * Returns all repetitions of Referral Source Code (PV2-13).
590     */
591    public XCN[] getReferralSourceCode() {
592        XCN[] retVal = this.getTypedField(13, new XCN[0]);
593        return retVal;
594    }
595
596
597    /**
598     * Returns all repetitions of Referral Source Code (PV2-13).
599     */
600    public XCN[] getPv213_ReferralSourceCode() {
601        XCN[] retVal = this.getTypedField(13, new XCN[0]);
602        return retVal;
603    }
604
605
606    /**
607     * Returns a count of the current number of repetitions of Referral Source Code (PV2-13).
608     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
609     * it will return zero.
610     */
611    public int getReferralSourceCodeReps() {
612        return this.getReps(13);
613    }
614
615
616    /**
617     * Returns a specific repetition of
618     * PV2-13: "Referral Source Code" - creates it if necessary
619     *
620     * @param rep The repetition index (0-indexed)
621     */
622    public XCN getReferralSourceCode(int rep) { 
623                XCN retVal = this.getTypedField(13, rep);
624                return retVal;
625    }
626
627    /**
628     * Returns a specific repetition of
629     * PV2-13: "Referral Source Code" - creates it if necessary
630     *
631     * @param rep The repetition index (0-indexed)
632     */
633    public XCN getPv213_ReferralSourceCode(int rep) { 
634                XCN retVal = this.getTypedField(13, rep);
635                return retVal;
636    }
637
638    /**
639     * Returns a count of the current number of repetitions of Referral Source Code (PV2-13).
640     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
641     * it will return zero.
642     */
643    public int getPv213_ReferralSourceCodeReps() {
644        return this.getReps(13);
645    }
646
647
648    /**
649     * Inserts a repetition of
650     * PV2-13: "Referral Source Code" 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 XCN insertReferralSourceCode(int rep) throws HL7Exception { 
656        return (XCN) super.insertRepetition(13, rep);
657    }
658
659
660    /**
661     * Inserts a repetition of
662     * PV2-13: "Referral Source Code" 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 XCN insertPv213_ReferralSourceCode(int rep) throws HL7Exception { 
668        return (XCN) super.insertRepetition(13, rep);
669    }
670
671
672    /**
673     * Removes a repetition of
674     * PV2-13: "Referral Source Code" at a specific index
675     *
676     * @param rep The repetition index (0-indexed)
677     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
678     */
679    public XCN removeReferralSourceCode(int rep) throws HL7Exception { 
680        return (XCN) super.removeRepetition(13, rep);
681    }
682
683
684    /**
685     * Removes a repetition of
686     * PV2-13: "Referral Source Code" at a specific index
687     *
688     * @param rep The repetition index (0-indexed)
689     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
690     */
691    public XCN removePv213_ReferralSourceCode(int rep) throws HL7Exception { 
692        return (XCN) super.removeRepetition(13, rep);
693    }
694
695
696
697
698    /**
699     * Returns
700     * PV2-14: "Previous Service Date" - creates it if necessary
701     */
702    public DT getPreviousServiceDate() { 
703                DT retVal = this.getTypedField(14, 0);
704                return retVal;
705    }
706    
707    /**
708     * Returns
709     * PV2-14: "Previous Service Date" - creates it if necessary
710     */
711    public DT getPv214_PreviousServiceDate() { 
712                DT retVal = this.getTypedField(14, 0);
713                return retVal;
714    }
715
716
717
718    /**
719     * Returns
720     * PV2-15: "Employment Illness Related Indicator" - creates it if necessary
721     */
722    public ID getEmploymentIllnessRelatedIndicator() { 
723                ID retVal = this.getTypedField(15, 0);
724                return retVal;
725    }
726    
727    /**
728     * Returns
729     * PV2-15: "Employment Illness Related Indicator" - creates it if necessary
730     */
731    public ID getPv215_EmploymentIllnessRelatedIndicator() { 
732                ID retVal = this.getTypedField(15, 0);
733                return retVal;
734    }
735
736
737
738    /**
739     * Returns
740     * PV2-16: "Purge Status Code" - creates it if necessary
741     */
742    public IS getPurgeStatusCode() { 
743                IS retVal = this.getTypedField(16, 0);
744                return retVal;
745    }
746    
747    /**
748     * Returns
749     * PV2-16: "Purge Status Code" - creates it if necessary
750     */
751    public IS getPv216_PurgeStatusCode() { 
752                IS retVal = this.getTypedField(16, 0);
753                return retVal;
754    }
755
756
757
758    /**
759     * Returns
760     * PV2-17: "Purge Status Date" - creates it if necessary
761     */
762    public DT getPurgeStatusDate() { 
763                DT retVal = this.getTypedField(17, 0);
764                return retVal;
765    }
766    
767    /**
768     * Returns
769     * PV2-17: "Purge Status Date" - creates it if necessary
770     */
771    public DT getPv217_PurgeStatusDate() { 
772                DT retVal = this.getTypedField(17, 0);
773                return retVal;
774    }
775
776
777
778    /**
779     * Returns
780     * PV2-18: "Special Program Code" - creates it if necessary
781     */
782    public IS getSpecialProgramCode() { 
783                IS retVal = this.getTypedField(18, 0);
784                return retVal;
785    }
786    
787    /**
788     * Returns
789     * PV2-18: "Special Program Code" - creates it if necessary
790     */
791    public IS getPv218_SpecialProgramCode() { 
792                IS retVal = this.getTypedField(18, 0);
793                return retVal;
794    }
795
796
797
798    /**
799     * Returns
800     * PV2-19: "Retention Indicator" - creates it if necessary
801     */
802    public ID getRetentionIndicator() { 
803                ID retVal = this.getTypedField(19, 0);
804                return retVal;
805    }
806    
807    /**
808     * Returns
809     * PV2-19: "Retention Indicator" - creates it if necessary
810     */
811    public ID getPv219_RetentionIndicator() { 
812                ID retVal = this.getTypedField(19, 0);
813                return retVal;
814    }
815
816
817
818    /**
819     * Returns
820     * PV2-20: "Expected Number of Insurance Plans" - creates it if necessary
821     */
822    public NM getExpectedNumberOfInsurancePlans() { 
823                NM retVal = this.getTypedField(20, 0);
824                return retVal;
825    }
826    
827    /**
828     * Returns
829     * PV2-20: "Expected Number of Insurance Plans" - creates it if necessary
830     */
831    public NM getPv220_ExpectedNumberOfInsurancePlans() { 
832                NM retVal = this.getTypedField(20, 0);
833                return retVal;
834    }
835
836
837
838    /**
839     * Returns
840     * PV2-21: "Visit Publicity Code" - creates it if necessary
841     */
842    public IS getVisitPublicityCode() { 
843                IS retVal = this.getTypedField(21, 0);
844                return retVal;
845    }
846    
847    /**
848     * Returns
849     * PV2-21: "Visit Publicity Code" - creates it if necessary
850     */
851    public IS getPv221_VisitPublicityCode() { 
852                IS retVal = this.getTypedField(21, 0);
853                return retVal;
854    }
855
856
857
858    /**
859     * Returns
860     * PV2-22: "Visit Protection Indicator" - creates it if necessary
861     */
862    public ID getVisitProtectionIndicator() { 
863                ID retVal = this.getTypedField(22, 0);
864                return retVal;
865    }
866    
867    /**
868     * Returns
869     * PV2-22: "Visit Protection Indicator" - creates it if necessary
870     */
871    public ID getPv222_VisitProtectionIndicator() { 
872                ID retVal = this.getTypedField(22, 0);
873                return retVal;
874    }
875
876
877    /**
878     * Returns all repetitions of Clinic Organization Name (PV2-23).
879     */
880    public XON[] getClinicOrganizationName() {
881        XON[] retVal = this.getTypedField(23, new XON[0]);
882        return retVal;
883    }
884
885
886    /**
887     * Returns all repetitions of Clinic Organization Name (PV2-23).
888     */
889    public XON[] getPv223_ClinicOrganizationName() {
890        XON[] retVal = this.getTypedField(23, new XON[0]);
891        return retVal;
892    }
893
894
895    /**
896     * Returns a count of the current number of repetitions of Clinic Organization Name (PV2-23).
897     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
898     * it will return zero.
899     */
900    public int getClinicOrganizationNameReps() {
901        return this.getReps(23);
902    }
903
904
905    /**
906     * Returns a specific repetition of
907     * PV2-23: "Clinic Organization Name" - creates it if necessary
908     *
909     * @param rep The repetition index (0-indexed)
910     */
911    public XON getClinicOrganizationName(int rep) { 
912                XON retVal = this.getTypedField(23, rep);
913                return retVal;
914    }
915
916    /**
917     * Returns a specific repetition of
918     * PV2-23: "Clinic Organization Name" - creates it if necessary
919     *
920     * @param rep The repetition index (0-indexed)
921     */
922    public XON getPv223_ClinicOrganizationName(int rep) { 
923                XON retVal = this.getTypedField(23, rep);
924                return retVal;
925    }
926
927    /**
928     * Returns a count of the current number of repetitions of Clinic Organization Name (PV2-23).
929     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
930     * it will return zero.
931     */
932    public int getPv223_ClinicOrganizationNameReps() {
933        return this.getReps(23);
934    }
935
936
937    /**
938     * Inserts a repetition of
939     * PV2-23: "Clinic Organization Name" 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 XON insertClinicOrganizationName(int rep) throws HL7Exception { 
945        return (XON) super.insertRepetition(23, rep);
946    }
947
948
949    /**
950     * Inserts a repetition of
951     * PV2-23: "Clinic Organization Name" at a specific index
952     *
953     * @param rep The repetition index (0-indexed)
954     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
955     */
956    public XON insertPv223_ClinicOrganizationName(int rep) throws HL7Exception { 
957        return (XON) super.insertRepetition(23, rep);
958    }
959
960
961    /**
962     * Removes a repetition of
963     * PV2-23: "Clinic Organization Name" at a specific index
964     *
965     * @param rep The repetition index (0-indexed)
966     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
967     */
968    public XON removeClinicOrganizationName(int rep) throws HL7Exception { 
969        return (XON) super.removeRepetition(23, rep);
970    }
971
972
973    /**
974     * Removes a repetition of
975     * PV2-23: "Clinic Organization Name" at a specific index
976     *
977     * @param rep The repetition index (0-indexed)
978     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
979     */
980    public XON removePv223_ClinicOrganizationName(int rep) throws HL7Exception { 
981        return (XON) super.removeRepetition(23, rep);
982    }
983
984
985
986
987    /**
988     * Returns
989     * PV2-24: "Patient Status Code" - creates it if necessary
990     */
991    public IS getPatientStatusCode() { 
992                IS retVal = this.getTypedField(24, 0);
993                return retVal;
994    }
995    
996    /**
997     * Returns
998     * PV2-24: "Patient Status Code" - creates it if necessary
999     */
1000    public IS getPv224_PatientStatusCode() { 
1001                IS retVal = this.getTypedField(24, 0);
1002                return retVal;
1003    }
1004
1005
1006
1007    /**
1008     * Returns
1009     * PV2-25: "Visit Priority Code" - creates it if necessary
1010     */
1011    public IS getVisitPriorityCode() { 
1012                IS retVal = this.getTypedField(25, 0);
1013                return retVal;
1014    }
1015    
1016    /**
1017     * Returns
1018     * PV2-25: "Visit Priority Code" - creates it if necessary
1019     */
1020    public IS getPv225_VisitPriorityCode() { 
1021                IS retVal = this.getTypedField(25, 0);
1022                return retVal;
1023    }
1024
1025
1026
1027    /**
1028     * Returns
1029     * PV2-26: "Previous Treatment Date" - creates it if necessary
1030     */
1031    public DT getPreviousTreatmentDate() { 
1032                DT retVal = this.getTypedField(26, 0);
1033                return retVal;
1034    }
1035    
1036    /**
1037     * Returns
1038     * PV2-26: "Previous Treatment Date" - creates it if necessary
1039     */
1040    public DT getPv226_PreviousTreatmentDate() { 
1041                DT retVal = this.getTypedField(26, 0);
1042                return retVal;
1043    }
1044
1045
1046
1047    /**
1048     * Returns
1049     * PV2-27: "Expected Discharge Disposition" - creates it if necessary
1050     */
1051    public IS getExpectedDischargeDisposition() { 
1052                IS retVal = this.getTypedField(27, 0);
1053                return retVal;
1054    }
1055    
1056    /**
1057     * Returns
1058     * PV2-27: "Expected Discharge Disposition" - creates it if necessary
1059     */
1060    public IS getPv227_ExpectedDischargeDisposition() { 
1061                IS retVal = this.getTypedField(27, 0);
1062                return retVal;
1063    }
1064
1065
1066
1067    /**
1068     * Returns
1069     * PV2-28: "Signature on File Date" - creates it if necessary
1070     */
1071    public DT getSignatureOnFileDate() { 
1072                DT retVal = this.getTypedField(28, 0);
1073                return retVal;
1074    }
1075    
1076    /**
1077     * Returns
1078     * PV2-28: "Signature on File Date" - creates it if necessary
1079     */
1080    public DT getPv228_SignatureOnFileDate() { 
1081                DT retVal = this.getTypedField(28, 0);
1082                return retVal;
1083    }
1084
1085
1086
1087    /**
1088     * Returns
1089     * PV2-29: "First Similar Illness Date" - creates it if necessary
1090     */
1091    public DT getFirstSimilarIllnessDate() { 
1092                DT retVal = this.getTypedField(29, 0);
1093                return retVal;
1094    }
1095    
1096    /**
1097     * Returns
1098     * PV2-29: "First Similar Illness Date" - creates it if necessary
1099     */
1100    public DT getPv229_FirstSimilarIllnessDate() { 
1101                DT retVal = this.getTypedField(29, 0);
1102                return retVal;
1103    }
1104
1105
1106
1107    /**
1108     * Returns
1109     * PV2-30: "Patient Charge Adjustment Code" - creates it if necessary
1110     */
1111    public CE getPatientChargeAdjustmentCode() { 
1112                CE retVal = this.getTypedField(30, 0);
1113                return retVal;
1114    }
1115    
1116    /**
1117     * Returns
1118     * PV2-30: "Patient Charge Adjustment Code" - creates it if necessary
1119     */
1120    public CE getPv230_PatientChargeAdjustmentCode() { 
1121                CE retVal = this.getTypedField(30, 0);
1122                return retVal;
1123    }
1124
1125
1126
1127    /**
1128     * Returns
1129     * PV2-31: "Recurring Service Code" - creates it if necessary
1130     */
1131    public IS getRecurringServiceCode() { 
1132                IS retVal = this.getTypedField(31, 0);
1133                return retVal;
1134    }
1135    
1136    /**
1137     * Returns
1138     * PV2-31: "Recurring Service Code" - creates it if necessary
1139     */
1140    public IS getPv231_RecurringServiceCode() { 
1141                IS retVal = this.getTypedField(31, 0);
1142                return retVal;
1143    }
1144
1145
1146
1147    /**
1148     * Returns
1149     * PV2-32: "Billing Media Code" - creates it if necessary
1150     */
1151    public ID getBillingMediaCode() { 
1152                ID retVal = this.getTypedField(32, 0);
1153                return retVal;
1154    }
1155    
1156    /**
1157     * Returns
1158     * PV2-32: "Billing Media Code" - creates it if necessary
1159     */
1160    public ID getPv232_BillingMediaCode() { 
1161                ID retVal = this.getTypedField(32, 0);
1162                return retVal;
1163    }
1164
1165
1166
1167    /**
1168     * Returns
1169     * PV2-33: "Expected Surgery Date and Time" - creates it if necessary
1170     */
1171    public TS getExpectedSurgeryDateAndTime() { 
1172                TS retVal = this.getTypedField(33, 0);
1173                return retVal;
1174    }
1175    
1176    /**
1177     * Returns
1178     * PV2-33: "Expected Surgery Date and Time" - creates it if necessary
1179     */
1180    public TS getPv233_ExpectedSurgeryDateAndTime() { 
1181                TS retVal = this.getTypedField(33, 0);
1182                return retVal;
1183    }
1184
1185
1186
1187    /**
1188     * Returns
1189     * PV2-34: "Military Partnership Code" - creates it if necessary
1190     */
1191    public ID getMilitaryPartnershipCode() { 
1192                ID retVal = this.getTypedField(34, 0);
1193                return retVal;
1194    }
1195    
1196    /**
1197     * Returns
1198     * PV2-34: "Military Partnership Code" - creates it if necessary
1199     */
1200    public ID getPv234_MilitaryPartnershipCode() { 
1201                ID retVal = this.getTypedField(34, 0);
1202                return retVal;
1203    }
1204
1205
1206
1207    /**
1208     * Returns
1209     * PV2-35: "Military Non-Availability Code" - creates it if necessary
1210     */
1211    public ID getMilitaryNonAvailabilityCode() { 
1212                ID retVal = this.getTypedField(35, 0);
1213                return retVal;
1214    }
1215    
1216    /**
1217     * Returns
1218     * PV2-35: "Military Non-Availability Code" - creates it if necessary
1219     */
1220    public ID getPv235_MilitaryNonAvailabilityCode() { 
1221                ID retVal = this.getTypedField(35, 0);
1222                return retVal;
1223    }
1224
1225
1226
1227    /**
1228     * Returns
1229     * PV2-36: "Newborn Baby Indicator" - creates it if necessary
1230     */
1231    public ID getNewbornBabyIndicator() { 
1232                ID retVal = this.getTypedField(36, 0);
1233                return retVal;
1234    }
1235    
1236    /**
1237     * Returns
1238     * PV2-36: "Newborn Baby Indicator" - creates it if necessary
1239     */
1240    public ID getPv236_NewbornBabyIndicator() { 
1241                ID retVal = this.getTypedField(36, 0);
1242                return retVal;
1243    }
1244
1245
1246
1247    /**
1248     * Returns
1249     * PV2-37: "Baby Detained Indicator" - creates it if necessary
1250     */
1251    public ID getBabyDetainedIndicator() { 
1252                ID retVal = this.getTypedField(37, 0);
1253                return retVal;
1254    }
1255    
1256    /**
1257     * Returns
1258     * PV2-37: "Baby Detained Indicator" - creates it if necessary
1259     */
1260    public ID getPv237_BabyDetainedIndicator() { 
1261                ID retVal = this.getTypedField(37, 0);
1262                return retVal;
1263    }
1264
1265
1266
1267    /**
1268     * Returns
1269     * PV2-38: "Mode of Arrival Code" - creates it if necessary
1270     */
1271    public CE getModeOfArrivalCode() { 
1272                CE retVal = this.getTypedField(38, 0);
1273                return retVal;
1274    }
1275    
1276    /**
1277     * Returns
1278     * PV2-38: "Mode of Arrival Code" - creates it if necessary
1279     */
1280    public CE getPv238_ModeOfArrivalCode() { 
1281                CE retVal = this.getTypedField(38, 0);
1282                return retVal;
1283    }
1284
1285
1286    /**
1287     * Returns all repetitions of Recreational Drug Use Code (PV2-39).
1288     */
1289    public CE[] getRecreationalDrugUseCode() {
1290        CE[] retVal = this.getTypedField(39, new CE[0]);
1291        return retVal;
1292    }
1293
1294
1295    /**
1296     * Returns all repetitions of Recreational Drug Use Code (PV2-39).
1297     */
1298    public CE[] getPv239_RecreationalDrugUseCode() {
1299        CE[] retVal = this.getTypedField(39, new CE[0]);
1300        return retVal;
1301    }
1302
1303
1304    /**
1305     * Returns a count of the current number of repetitions of Recreational Drug Use Code (PV2-39).
1306     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1307     * it will return zero.
1308     */
1309    public int getRecreationalDrugUseCodeReps() {
1310        return this.getReps(39);
1311    }
1312
1313
1314    /**
1315     * Returns a specific repetition of
1316     * PV2-39: "Recreational Drug Use Code" - creates it if necessary
1317     *
1318     * @param rep The repetition index (0-indexed)
1319     */
1320    public CE getRecreationalDrugUseCode(int rep) { 
1321                CE retVal = this.getTypedField(39, rep);
1322                return retVal;
1323    }
1324
1325    /**
1326     * Returns a specific repetition of
1327     * PV2-39: "Recreational Drug Use Code" - creates it if necessary
1328     *
1329     * @param rep The repetition index (0-indexed)
1330     */
1331    public CE getPv239_RecreationalDrugUseCode(int rep) { 
1332                CE retVal = this.getTypedField(39, rep);
1333                return retVal;
1334    }
1335
1336    /**
1337     * Returns a count of the current number of repetitions of Recreational Drug Use Code (PV2-39).
1338     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1339     * it will return zero.
1340     */
1341    public int getPv239_RecreationalDrugUseCodeReps() {
1342        return this.getReps(39);
1343    }
1344
1345
1346    /**
1347     * Inserts a repetition of
1348     * PV2-39: "Recreational Drug Use Code" at a specific index
1349     *
1350     * @param rep The repetition index (0-indexed)
1351     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1352     */
1353    public CE insertRecreationalDrugUseCode(int rep) throws HL7Exception { 
1354        return (CE) super.insertRepetition(39, rep);
1355    }
1356
1357
1358    /**
1359     * Inserts a repetition of
1360     * PV2-39: "Recreational Drug Use Code" at a specific index
1361     *
1362     * @param rep The repetition index (0-indexed)
1363     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1364     */
1365    public CE insertPv239_RecreationalDrugUseCode(int rep) throws HL7Exception { 
1366        return (CE) super.insertRepetition(39, rep);
1367    }
1368
1369
1370    /**
1371     * Removes a repetition of
1372     * PV2-39: "Recreational Drug Use Code" at a specific index
1373     *
1374     * @param rep The repetition index (0-indexed)
1375     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1376     */
1377    public CE removeRecreationalDrugUseCode(int rep) throws HL7Exception { 
1378        return (CE) super.removeRepetition(39, rep);
1379    }
1380
1381
1382    /**
1383     * Removes a repetition of
1384     * PV2-39: "Recreational Drug Use Code" at a specific index
1385     *
1386     * @param rep The repetition index (0-indexed)
1387     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1388     */
1389    public CE removePv239_RecreationalDrugUseCode(int rep) throws HL7Exception { 
1390        return (CE) super.removeRepetition(39, rep);
1391    }
1392
1393
1394
1395
1396    /**
1397     * Returns
1398     * PV2-40: "Admission Level of Care Code" - creates it if necessary
1399     */
1400    public CE getAdmissionLevelOfCareCode() { 
1401                CE retVal = this.getTypedField(40, 0);
1402                return retVal;
1403    }
1404    
1405    /**
1406     * Returns
1407     * PV2-40: "Admission Level of Care Code" - creates it if necessary
1408     */
1409    public CE getPv240_AdmissionLevelOfCareCode() { 
1410                CE retVal = this.getTypedField(40, 0);
1411                return retVal;
1412    }
1413
1414
1415    /**
1416     * Returns all repetitions of Precaution Code (PV2-41).
1417     */
1418    public CE[] getPrecautionCode() {
1419        CE[] retVal = this.getTypedField(41, new CE[0]);
1420        return retVal;
1421    }
1422
1423
1424    /**
1425     * Returns all repetitions of Precaution Code (PV2-41).
1426     */
1427    public CE[] getPv241_PrecautionCode() {
1428        CE[] retVal = this.getTypedField(41, new CE[0]);
1429        return retVal;
1430    }
1431
1432
1433    /**
1434     * Returns a count of the current number of repetitions of Precaution Code (PV2-41).
1435     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1436     * it will return zero.
1437     */
1438    public int getPrecautionCodeReps() {
1439        return this.getReps(41);
1440    }
1441
1442
1443    /**
1444     * Returns a specific repetition of
1445     * PV2-41: "Precaution Code" - creates it if necessary
1446     *
1447     * @param rep The repetition index (0-indexed)
1448     */
1449    public CE getPrecautionCode(int rep) { 
1450                CE retVal = this.getTypedField(41, rep);
1451                return retVal;
1452    }
1453
1454    /**
1455     * Returns a specific repetition of
1456     * PV2-41: "Precaution Code" - creates it if necessary
1457     *
1458     * @param rep The repetition index (0-indexed)
1459     */
1460    public CE getPv241_PrecautionCode(int rep) { 
1461                CE retVal = this.getTypedField(41, rep);
1462                return retVal;
1463    }
1464
1465    /**
1466     * Returns a count of the current number of repetitions of Precaution Code (PV2-41).
1467     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1468     * it will return zero.
1469     */
1470    public int getPv241_PrecautionCodeReps() {
1471        return this.getReps(41);
1472    }
1473
1474
1475    /**
1476     * Inserts a repetition of
1477     * PV2-41: "Precaution Code" at a specific index
1478     *
1479     * @param rep The repetition index (0-indexed)
1480     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1481     */
1482    public CE insertPrecautionCode(int rep) throws HL7Exception { 
1483        return (CE) super.insertRepetition(41, rep);
1484    }
1485
1486
1487    /**
1488     * Inserts a repetition of
1489     * PV2-41: "Precaution Code" at a specific index
1490     *
1491     * @param rep The repetition index (0-indexed)
1492     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1493     */
1494    public CE insertPv241_PrecautionCode(int rep) throws HL7Exception { 
1495        return (CE) super.insertRepetition(41, rep);
1496    }
1497
1498
1499    /**
1500     * Removes a repetition of
1501     * PV2-41: "Precaution Code" at a specific index
1502     *
1503     * @param rep The repetition index (0-indexed)
1504     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1505     */
1506    public CE removePrecautionCode(int rep) throws HL7Exception { 
1507        return (CE) super.removeRepetition(41, rep);
1508    }
1509
1510
1511    /**
1512     * Removes a repetition of
1513     * PV2-41: "Precaution Code" at a specific index
1514     *
1515     * @param rep The repetition index (0-indexed)
1516     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1517     */
1518    public CE removePv241_PrecautionCode(int rep) throws HL7Exception { 
1519        return (CE) super.removeRepetition(41, rep);
1520    }
1521
1522
1523
1524
1525    /**
1526     * Returns
1527     * PV2-42: "Patient Condition Code" - creates it if necessary
1528     */
1529    public CE getPatientConditionCode() { 
1530                CE retVal = this.getTypedField(42, 0);
1531                return retVal;
1532    }
1533    
1534    /**
1535     * Returns
1536     * PV2-42: "Patient Condition Code" - creates it if necessary
1537     */
1538    public CE getPv242_PatientConditionCode() { 
1539                CE retVal = this.getTypedField(42, 0);
1540                return retVal;
1541    }
1542
1543
1544
1545    /**
1546     * Returns
1547     * PV2-43: "Living Will Code" - creates it if necessary
1548     */
1549    public IS getLivingWillCode() { 
1550                IS retVal = this.getTypedField(43, 0);
1551                return retVal;
1552    }
1553    
1554    /**
1555     * Returns
1556     * PV2-43: "Living Will Code" - creates it if necessary
1557     */
1558    public IS getPv243_LivingWillCode() { 
1559                IS retVal = this.getTypedField(43, 0);
1560                return retVal;
1561    }
1562
1563
1564
1565    /**
1566     * Returns
1567     * PV2-44: "Organ Donor Code" - creates it if necessary
1568     */
1569    public IS getOrganDonorCode() { 
1570                IS retVal = this.getTypedField(44, 0);
1571                return retVal;
1572    }
1573    
1574    /**
1575     * Returns
1576     * PV2-44: "Organ Donor Code" - creates it if necessary
1577     */
1578    public IS getPv244_OrganDonorCode() { 
1579                IS retVal = this.getTypedField(44, 0);
1580                return retVal;
1581    }
1582
1583
1584    /**
1585     * Returns all repetitions of Advance Directive Code (PV2-45).
1586     */
1587    public CE[] getAdvanceDirectiveCode() {
1588        CE[] retVal = this.getTypedField(45, new CE[0]);
1589        return retVal;
1590    }
1591
1592
1593    /**
1594     * Returns all repetitions of Advance Directive Code (PV2-45).
1595     */
1596    public CE[] getPv245_AdvanceDirectiveCode() {
1597        CE[] retVal = this.getTypedField(45, new CE[0]);
1598        return retVal;
1599    }
1600
1601
1602    /**
1603     * Returns a count of the current number of repetitions of Advance Directive Code (PV2-45).
1604     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1605     * it will return zero.
1606     */
1607    public int getAdvanceDirectiveCodeReps() {
1608        return this.getReps(45);
1609    }
1610
1611
1612    /**
1613     * Returns a specific repetition of
1614     * PV2-45: "Advance Directive Code" - creates it if necessary
1615     *
1616     * @param rep The repetition index (0-indexed)
1617     */
1618    public CE getAdvanceDirectiveCode(int rep) { 
1619                CE retVal = this.getTypedField(45, rep);
1620                return retVal;
1621    }
1622
1623    /**
1624     * Returns a specific repetition of
1625     * PV2-45: "Advance Directive Code" - creates it if necessary
1626     *
1627     * @param rep The repetition index (0-indexed)
1628     */
1629    public CE getPv245_AdvanceDirectiveCode(int rep) { 
1630                CE retVal = this.getTypedField(45, rep);
1631                return retVal;
1632    }
1633
1634    /**
1635     * Returns a count of the current number of repetitions of Advance Directive Code (PV2-45).
1636     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1637     * it will return zero.
1638     */
1639    public int getPv245_AdvanceDirectiveCodeReps() {
1640        return this.getReps(45);
1641    }
1642
1643
1644    /**
1645     * Inserts a repetition of
1646     * PV2-45: "Advance Directive Code" at a specific index
1647     *
1648     * @param rep The repetition index (0-indexed)
1649     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1650     */
1651    public CE insertAdvanceDirectiveCode(int rep) throws HL7Exception { 
1652        return (CE) super.insertRepetition(45, rep);
1653    }
1654
1655
1656    /**
1657     * Inserts a repetition of
1658     * PV2-45: "Advance Directive Code" at a specific index
1659     *
1660     * @param rep The repetition index (0-indexed)
1661     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1662     */
1663    public CE insertPv245_AdvanceDirectiveCode(int rep) throws HL7Exception { 
1664        return (CE) super.insertRepetition(45, rep);
1665    }
1666
1667
1668    /**
1669     * Removes a repetition of
1670     * PV2-45: "Advance Directive Code" at a specific index
1671     *
1672     * @param rep The repetition index (0-indexed)
1673     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1674     */
1675    public CE removeAdvanceDirectiveCode(int rep) throws HL7Exception { 
1676        return (CE) super.removeRepetition(45, rep);
1677    }
1678
1679
1680    /**
1681     * Removes a repetition of
1682     * PV2-45: "Advance Directive Code" at a specific index
1683     *
1684     * @param rep The repetition index (0-indexed)
1685     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1686     */
1687    public CE removePv245_AdvanceDirectiveCode(int rep) throws HL7Exception { 
1688        return (CE) super.removeRepetition(45, rep);
1689    }
1690
1691
1692
1693
1694    /**
1695     * Returns
1696     * PV2-46: "Patient Status Effective Date" - creates it if necessary
1697     */
1698    public DT getPatientStatusEffectiveDate() { 
1699                DT retVal = this.getTypedField(46, 0);
1700                return retVal;
1701    }
1702    
1703    /**
1704     * Returns
1705     * PV2-46: "Patient Status Effective Date" - creates it if necessary
1706     */
1707    public DT getPv246_PatientStatusEffectiveDate() { 
1708                DT retVal = this.getTypedField(46, 0);
1709                return retVal;
1710    }
1711
1712
1713
1714    /**
1715     * Returns
1716     * PV2-47: "Expected LOA Return Date/Time" - creates it if necessary
1717     */
1718    public TS getExpectedLOAReturnDateTime() { 
1719                TS retVal = this.getTypedField(47, 0);
1720                return retVal;
1721    }
1722    
1723    /**
1724     * Returns
1725     * PV2-47: "Expected LOA Return Date/Time" - creates it if necessary
1726     */
1727    public TS getPv247_ExpectedLOAReturnDateTime() { 
1728                TS retVal = this.getTypedField(47, 0);
1729                return retVal;
1730    }
1731
1732
1733
1734    /**
1735     * Returns
1736     * PV2-48: "Expected Pre-admission Testing Date/Time" - creates it if necessary
1737     */
1738    public TS getExpectedPreAdmissionTestingDateTime() { 
1739                TS retVal = this.getTypedField(48, 0);
1740                return retVal;
1741    }
1742    
1743    /**
1744     * Returns
1745     * PV2-48: "Expected Pre-admission Testing Date/Time" - creates it if necessary
1746     */
1747    public TS getPv248_ExpectedPreAdmissionTestingDateTime() { 
1748                TS retVal = this.getTypedField(48, 0);
1749                return retVal;
1750    }
1751
1752
1753    /**
1754     * Returns all repetitions of Notify Clergy Code (PV2-49).
1755     */
1756    public IS[] getNotifyClergyCode() {
1757        IS[] retVal = this.getTypedField(49, new IS[0]);
1758        return retVal;
1759    }
1760
1761
1762    /**
1763     * Returns all repetitions of Notify Clergy Code (PV2-49).
1764     */
1765    public IS[] getPv249_NotifyClergyCode() {
1766        IS[] retVal = this.getTypedField(49, new IS[0]);
1767        return retVal;
1768    }
1769
1770
1771    /**
1772     * Returns a count of the current number of repetitions of Notify Clergy Code (PV2-49).
1773     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1774     * it will return zero.
1775     */
1776    public int getNotifyClergyCodeReps() {
1777        return this.getReps(49);
1778    }
1779
1780
1781    /**
1782     * Returns a specific repetition of
1783     * PV2-49: "Notify Clergy Code" - creates it if necessary
1784     *
1785     * @param rep The repetition index (0-indexed)
1786     */
1787    public IS getNotifyClergyCode(int rep) { 
1788                IS retVal = this.getTypedField(49, rep);
1789                return retVal;
1790    }
1791
1792    /**
1793     * Returns a specific repetition of
1794     * PV2-49: "Notify Clergy Code" - creates it if necessary
1795     *
1796     * @param rep The repetition index (0-indexed)
1797     */
1798    public IS getPv249_NotifyClergyCode(int rep) { 
1799                IS retVal = this.getTypedField(49, rep);
1800                return retVal;
1801    }
1802
1803    /**
1804     * Returns a count of the current number of repetitions of Notify Clergy Code (PV2-49).
1805     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1806     * it will return zero.
1807     */
1808    public int getPv249_NotifyClergyCodeReps() {
1809        return this.getReps(49);
1810    }
1811
1812
1813    /**
1814     * Inserts a repetition of
1815     * PV2-49: "Notify Clergy Code" at a specific index
1816     *
1817     * @param rep The repetition index (0-indexed)
1818     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1819     */
1820    public IS insertNotifyClergyCode(int rep) throws HL7Exception { 
1821        return (IS) super.insertRepetition(49, rep);
1822    }
1823
1824
1825    /**
1826     * Inserts a repetition of
1827     * PV2-49: "Notify Clergy Code" at a specific index
1828     *
1829     * @param rep The repetition index (0-indexed)
1830     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1831     */
1832    public IS insertPv249_NotifyClergyCode(int rep) throws HL7Exception { 
1833        return (IS) super.insertRepetition(49, rep);
1834    }
1835
1836
1837    /**
1838     * Removes a repetition of
1839     * PV2-49: "Notify Clergy Code" at a specific index
1840     *
1841     * @param rep The repetition index (0-indexed)
1842     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1843     */
1844    public IS removeNotifyClergyCode(int rep) throws HL7Exception { 
1845        return (IS) super.removeRepetition(49, rep);
1846    }
1847
1848
1849    /**
1850     * Removes a repetition of
1851     * PV2-49: "Notify Clergy Code" at a specific index
1852     *
1853     * @param rep The repetition index (0-indexed)
1854     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1855     */
1856    public IS removePv249_NotifyClergyCode(int rep) throws HL7Exception { 
1857        return (IS) super.removeRepetition(49, rep);
1858    }
1859
1860
1861
1862
1863
1864
1865    /** {@inheritDoc} */   
1866    protected Type createNewTypeWithoutReflection(int field) {
1867       switch (field) {
1868          case 0: return new PL(getMessage());
1869          case 1: return new CE(getMessage());
1870          case 2: return new CE(getMessage());
1871          case 3: return new CE(getMessage());
1872          case 4: return new ST(getMessage());
1873          case 5: return new ST(getMessage());
1874          case 6: return new IS(getMessage(), new Integer( 130 ));
1875          case 7: return new TS(getMessage());
1876          case 8: return new TS(getMessage());
1877          case 9: return new NM(getMessage());
1878          case 10: return new NM(getMessage());
1879          case 11: return new ST(getMessage());
1880          case 12: return new XCN(getMessage());
1881          case 13: return new DT(getMessage());
1882          case 14: return new ID(getMessage(), new Integer( 136 ));
1883          case 15: return new IS(getMessage(), new Integer( 213 ));
1884          case 16: return new DT(getMessage());
1885          case 17: return new IS(getMessage(), new Integer( 214 ));
1886          case 18: return new ID(getMessage(), new Integer( 136 ));
1887          case 19: return new NM(getMessage());
1888          case 20: return new IS(getMessage(), new Integer( 215 ));
1889          case 21: return new ID(getMessage(), new Integer( 136 ));
1890          case 22: return new XON(getMessage());
1891          case 23: return new IS(getMessage(), new Integer( 216 ));
1892          case 24: return new IS(getMessage(), new Integer( 217 ));
1893          case 25: return new DT(getMessage());
1894          case 26: return new IS(getMessage(), new Integer( 112 ));
1895          case 27: return new DT(getMessage());
1896          case 28: return new DT(getMessage());
1897          case 29: return new CE(getMessage());
1898          case 30: return new IS(getMessage(), new Integer( 219 ));
1899          case 31: return new ID(getMessage(), new Integer( 136 ));
1900          case 32: return new TS(getMessage());
1901          case 33: return new ID(getMessage(), new Integer( 136 ));
1902          case 34: return new ID(getMessage(), new Integer( 136 ));
1903          case 35: return new ID(getMessage(), new Integer( 136 ));
1904          case 36: return new ID(getMessage(), new Integer( 136 ));
1905          case 37: return new CE(getMessage());
1906          case 38: return new CE(getMessage());
1907          case 39: return new CE(getMessage());
1908          case 40: return new CE(getMessage());
1909          case 41: return new CE(getMessage());
1910          case 42: return new IS(getMessage(), new Integer( 315 ));
1911          case 43: return new IS(getMessage(), new Integer( 316 ));
1912          case 44: return new CE(getMessage());
1913          case 45: return new DT(getMessage());
1914          case 46: return new TS(getMessage());
1915          case 47: return new TS(getMessage());
1916          case 48: return new IS(getMessage(), new Integer( 534 ));
1917          default: return null;
1918       }
1919   }
1920
1921
1922}
1923