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    
008    package ca.uhn.hl7v2.model.v24.segment;
009    
010    // import ca.uhn.hl7v2.model.v24.group.*;
011    import ca.uhn.hl7v2.model.v24.datatype.*;
012    import ca.uhn.log.HapiLogFactory;
013    import ca.uhn.hl7v2.HL7Exception;
014    import ca.uhn.hl7v2.parser.ModelClassFactory;
015    import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016    import ca.uhn.hl7v2.model.AbstractMessage;
017    import ca.uhn.hl7v2.model.Group;
018    import ca.uhn.hl7v2.model.Type;
019    import ca.uhn.hl7v2.model.AbstractSegment;
020    import ca.uhn.hl7v2.model.Varies;
021    
022    /**
023     *<p>Represents an HL7 PCR message segment (Possible Causal Relationship). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>PCR-1: Implicated Product (CE) <b> </b>
027         * <li>PCR-2: Generic Product (IS) <b>optional </b>
028         * <li>PCR-3: Product Class (CE) <b>optional </b>
029         * <li>PCR-4: Total Duration Of Therapy (CQ) <b>optional </b>
030         * <li>PCR-5: Product Manufacture Date (TS) <b>optional </b>
031         * <li>PCR-6: Product Expiration Date (TS) <b>optional </b>
032         * <li>PCR-7: Product Implantation Date (TS) <b>optional </b>
033         * <li>PCR-8: Product Explantation Date (TS) <b>optional </b>
034         * <li>PCR-9: Single Use Device (IS) <b>optional </b>
035         * <li>PCR-10: Indication For Product Use (CE) <b>optional </b>
036         * <li>PCR-11: Product Problem (IS) <b>optional </b>
037         * <li>PCR-12: Product Serial/Lot Number (ST) <b>optional repeating</b>
038         * <li>PCR-13: Product Available For Inspection (IS) <b>optional </b>
039         * <li>PCR-14: Product Evaluation Performed (CE) <b>optional </b>
040         * <li>PCR-15: Product Evaluation Status (CE) <b>optional </b>
041         * <li>PCR-16: Product Evaluation Results (CE) <b>optional </b>
042         * <li>PCR-17: Evaluated Product Source (ID) <b>optional </b>
043         * <li>PCR-18: Date Product Returned To Manufacturer (TS) <b>optional </b>
044         * <li>PCR-19: Device Operator Qualifications (ID) <b>optional </b>
045         * <li>PCR-20: Relatedness Assessment (ID) <b>optional </b>
046         * <li>PCR-21: Action Taken In Response To The Event (ID) <b>optional repeating</b>
047         * <li>PCR-22: Event Causality Observations (ID) <b>optional repeating</b>
048         * <li>PCR-23: Indirect Exposure Mechanism (ID) <b>optional repeating</b>
049     * </ul>
050     */
051    public class PCR extends AbstractSegment {
052    
053        /** 
054         * Creates a new PCR segment
055         */
056        public PCR(Group parent, ModelClassFactory factory) {
057           super(parent, factory);
058           init(factory);
059        }
060    
061        private void init(ModelClassFactory factory) {
062           try {
063                                      this.add(CE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Implicated Product");
064                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Generic Product");
065                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Product Class");
066                                      this.add(CQ.class, false, 1, 8, new Object[]{ getMessage(), new Integer(0) }, "Total Duration Of Therapy");
067                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Product Manufacture Date");
068                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Product Expiration Date");
069                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Product Implantation Date");
070                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Product Explantation Date");
071                                      this.add(IS.class, false, 1, 8, new Object[]{ getMessage() }, "Single Use Device");
072                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Indication For Product Use");
073                                      this.add(IS.class, false, 1, 8, new Object[]{ getMessage() }, "Product Problem");
074                                      this.add(ST.class, false, 3, 30, new Object[]{ getMessage(), new Integer(0) }, "Product Serial/Lot Number");
075                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Product Available For Inspection");
076                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Product Evaluation Performed");
077                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(247) }, "Product Evaluation Status");
078                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Product Evaluation Results");
079                                      this.add(ID.class, false, 1, 8, new Object[]{ getMessage() }, "Evaluated Product Source");
080                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date Product Returned To Manufacturer");
081                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Device Operator Qualifications");
082                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Relatedness Assessment");
083                                      this.add(ID.class, false, 6, 2, new Object[]{ getMessage() }, "Action Taken In Response To The Event");
084                                      this.add(ID.class, false, 6, 2, new Object[]{ getMessage() }, "Event Causality Observations");
085                                      this.add(ID.class, false, 3, 1, new Object[]{ getMessage() }, "Indirect Exposure Mechanism");
086           } catch(HL7Exception e) {
087              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PCR - this is probably a bug in the source code generator.", e);
088           }
089        }
090    
091    
092    
093        /**
094         * Returns
095         * PCR-1: "Implicated Product" - creates it if necessary
096         */
097        public CE getImplicatedProduct() { 
098            CE ret = null;
099            try {
100                Type t = this.getField(1, 0);
101                ret = (CE)t;
102            } catch (ClassCastException cce) {
103                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
104                throw new RuntimeException(cce);
105            } catch (HL7Exception he) {
106                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
107                throw new RuntimeException(he);
108            }
109            return ret;
110        }
111    
112    
113        /**
114         * Returns
115         * PCR-1: "Implicated Product" - creates it if necessary
116         */
117        public CE getPcr1_ImplicatedProduct() { 
118            CE ret = null;
119            try {
120                Type t = this.getField(1, 0);
121                ret = (CE)t;
122            } catch (ClassCastException cce) {
123                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
124                throw new RuntimeException(cce);
125            } catch (HL7Exception he) {
126                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
127                throw new RuntimeException(he);
128            }
129            return ret;
130        }
131    
132    
133    
134        /**
135         * Returns
136         * PCR-2: "Generic Product" - creates it if necessary
137         */
138        public IS getGenericProduct() { 
139            IS ret = null;
140            try {
141                Type t = this.getField(2, 0);
142                ret = (IS)t;
143            } catch (ClassCastException cce) {
144                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
145                throw new RuntimeException(cce);
146            } catch (HL7Exception he) {
147                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
148                throw new RuntimeException(he);
149            }
150            return ret;
151        }
152    
153    
154        /**
155         * Returns
156         * PCR-2: "Generic Product" - creates it if necessary
157         */
158        public IS getPcr2_GenericProduct() { 
159            IS ret = null;
160            try {
161                Type t = this.getField(2, 0);
162                ret = (IS)t;
163            } catch (ClassCastException cce) {
164                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
165                throw new RuntimeException(cce);
166            } catch (HL7Exception he) {
167                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
168                throw new RuntimeException(he);
169            }
170            return ret;
171        }
172    
173    
174    
175        /**
176         * Returns
177         * PCR-3: "Product Class" - creates it if necessary
178         */
179        public CE getProductClass() { 
180            CE ret = null;
181            try {
182                Type t = this.getField(3, 0);
183                ret = (CE)t;
184            } catch (ClassCastException cce) {
185                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
186                throw new RuntimeException(cce);
187            } catch (HL7Exception he) {
188                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
189                throw new RuntimeException(he);
190            }
191            return ret;
192        }
193    
194    
195        /**
196         * Returns
197         * PCR-3: "Product Class" - creates it if necessary
198         */
199        public CE getPcr3_ProductClass() { 
200            CE ret = null;
201            try {
202                Type t = this.getField(3, 0);
203                ret = (CE)t;
204            } catch (ClassCastException cce) {
205                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
206                throw new RuntimeException(cce);
207            } catch (HL7Exception he) {
208                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
209                throw new RuntimeException(he);
210            }
211            return ret;
212        }
213    
214    
215    
216        /**
217         * Returns
218         * PCR-4: "Total Duration Of Therapy" - creates it if necessary
219         */
220        public CQ getTotalDurationOfTherapy() { 
221            CQ ret = null;
222            try {
223                Type t = this.getField(4, 0);
224                ret = (CQ)t;
225            } catch (ClassCastException cce) {
226                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
227                throw new RuntimeException(cce);
228            } catch (HL7Exception he) {
229                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
230                throw new RuntimeException(he);
231            }
232            return ret;
233        }
234    
235    
236        /**
237         * Returns
238         * PCR-4: "Total Duration Of Therapy" - creates it if necessary
239         */
240        public CQ getPcr4_TotalDurationOfTherapy() { 
241            CQ ret = null;
242            try {
243                Type t = this.getField(4, 0);
244                ret = (CQ)t;
245            } catch (ClassCastException cce) {
246                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
247                throw new RuntimeException(cce);
248            } catch (HL7Exception he) {
249                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
250                throw new RuntimeException(he);
251            }
252            return ret;
253        }
254    
255    
256    
257        /**
258         * Returns
259         * PCR-5: "Product Manufacture Date" - creates it if necessary
260         */
261        public TS getProductManufactureDate() { 
262            TS ret = null;
263            try {
264                Type t = this.getField(5, 0);
265                ret = (TS)t;
266            } catch (ClassCastException cce) {
267                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
268                throw new RuntimeException(cce);
269            } catch (HL7Exception he) {
270                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
271                throw new RuntimeException(he);
272            }
273            return ret;
274        }
275    
276    
277        /**
278         * Returns
279         * PCR-5: "Product Manufacture Date" - creates it if necessary
280         */
281        public TS getPcr5_ProductManufactureDate() { 
282            TS ret = null;
283            try {
284                Type t = this.getField(5, 0);
285                ret = (TS)t;
286            } catch (ClassCastException cce) {
287                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
288                throw new RuntimeException(cce);
289            } catch (HL7Exception he) {
290                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
291                throw new RuntimeException(he);
292            }
293            return ret;
294        }
295    
296    
297    
298        /**
299         * Returns
300         * PCR-6: "Product Expiration Date" - creates it if necessary
301         */
302        public TS getProductExpirationDate() { 
303            TS ret = null;
304            try {
305                Type t = this.getField(6, 0);
306                ret = (TS)t;
307            } catch (ClassCastException cce) {
308                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
309                throw new RuntimeException(cce);
310            } catch (HL7Exception he) {
311                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
312                throw new RuntimeException(he);
313            }
314            return ret;
315        }
316    
317    
318        /**
319         * Returns
320         * PCR-6: "Product Expiration Date" - creates it if necessary
321         */
322        public TS getPcr6_ProductExpirationDate() { 
323            TS ret = null;
324            try {
325                Type t = this.getField(6, 0);
326                ret = (TS)t;
327            } catch (ClassCastException cce) {
328                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
329                throw new RuntimeException(cce);
330            } catch (HL7Exception he) {
331                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
332                throw new RuntimeException(he);
333            }
334            return ret;
335        }
336    
337    
338    
339        /**
340         * Returns
341         * PCR-7: "Product Implantation Date" - creates it if necessary
342         */
343        public TS getProductImplantationDate() { 
344            TS ret = null;
345            try {
346                Type t = this.getField(7, 0);
347                ret = (TS)t;
348            } catch (ClassCastException cce) {
349                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
350                throw new RuntimeException(cce);
351            } catch (HL7Exception he) {
352                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
353                throw new RuntimeException(he);
354            }
355            return ret;
356        }
357    
358    
359        /**
360         * Returns
361         * PCR-7: "Product Implantation Date" - creates it if necessary
362         */
363        public TS getPcr7_ProductImplantationDate() { 
364            TS ret = null;
365            try {
366                Type t = this.getField(7, 0);
367                ret = (TS)t;
368            } catch (ClassCastException cce) {
369                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
370                throw new RuntimeException(cce);
371            } catch (HL7Exception he) {
372                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
373                throw new RuntimeException(he);
374            }
375            return ret;
376        }
377    
378    
379    
380        /**
381         * Returns
382         * PCR-8: "Product Explantation Date" - creates it if necessary
383         */
384        public TS getProductExplantationDate() { 
385            TS ret = null;
386            try {
387                Type t = this.getField(8, 0);
388                ret = (TS)t;
389            } catch (ClassCastException cce) {
390                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
391                throw new RuntimeException(cce);
392            } catch (HL7Exception he) {
393                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
394                throw new RuntimeException(he);
395            }
396            return ret;
397        }
398    
399    
400        /**
401         * Returns
402         * PCR-8: "Product Explantation Date" - creates it if necessary
403         */
404        public TS getPcr8_ProductExplantationDate() { 
405            TS ret = null;
406            try {
407                Type t = this.getField(8, 0);
408                ret = (TS)t;
409            } catch (ClassCastException cce) {
410                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
411                throw new RuntimeException(cce);
412            } catch (HL7Exception he) {
413                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
414                throw new RuntimeException(he);
415            }
416            return ret;
417        }
418    
419    
420    
421        /**
422         * Returns
423         * PCR-9: "Single Use Device" - creates it if necessary
424         */
425        public IS getSingleUseDevice() { 
426            IS ret = null;
427            try {
428                Type t = this.getField(9, 0);
429                ret = (IS)t;
430            } catch (ClassCastException cce) {
431                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
432                throw new RuntimeException(cce);
433            } catch (HL7Exception he) {
434                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
435                throw new RuntimeException(he);
436            }
437            return ret;
438        }
439    
440    
441        /**
442         * Returns
443         * PCR-9: "Single Use Device" - creates it if necessary
444         */
445        public IS getPcr9_SingleUseDevice() { 
446            IS ret = null;
447            try {
448                Type t = this.getField(9, 0);
449                ret = (IS)t;
450            } catch (ClassCastException cce) {
451                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
452                throw new RuntimeException(cce);
453            } catch (HL7Exception he) {
454                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
455                throw new RuntimeException(he);
456            }
457            return ret;
458        }
459    
460    
461    
462        /**
463         * Returns
464         * PCR-10: "Indication For Product Use" - creates it if necessary
465         */
466        public CE getIndicationForProductUse() { 
467            CE ret = null;
468            try {
469                Type t = this.getField(10, 0);
470                ret = (CE)t;
471            } catch (ClassCastException cce) {
472                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
473                throw new RuntimeException(cce);
474            } catch (HL7Exception he) {
475                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
476                throw new RuntimeException(he);
477            }
478            return ret;
479        }
480    
481    
482        /**
483         * Returns
484         * PCR-10: "Indication For Product Use" - creates it if necessary
485         */
486        public CE getPcr10_IndicationForProductUse() { 
487            CE ret = null;
488            try {
489                Type t = this.getField(10, 0);
490                ret = (CE)t;
491            } catch (ClassCastException cce) {
492                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
493                throw new RuntimeException(cce);
494            } catch (HL7Exception he) {
495                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
496                throw new RuntimeException(he);
497            }
498            return ret;
499        }
500    
501    
502    
503        /**
504         * Returns
505         * PCR-11: "Product Problem" - creates it if necessary
506         */
507        public IS getProductProblem() { 
508            IS ret = null;
509            try {
510                Type t = this.getField(11, 0);
511                ret = (IS)t;
512            } catch (ClassCastException cce) {
513                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
514                throw new RuntimeException(cce);
515            } catch (HL7Exception he) {
516                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
517                throw new RuntimeException(he);
518            }
519            return ret;
520        }
521    
522    
523        /**
524         * Returns
525         * PCR-11: "Product Problem" - creates it if necessary
526         */
527        public IS getPcr11_ProductProblem() { 
528            IS ret = null;
529            try {
530                Type t = this.getField(11, 0);
531                ret = (IS)t;
532            } catch (ClassCastException cce) {
533                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
534                throw new RuntimeException(cce);
535            } catch (HL7Exception he) {
536                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
537                throw new RuntimeException(he);
538            }
539            return ret;
540        }
541    
542    
543        /**
544         * Returns all repetitions of Product Serial/Lot Number (PCR-12).
545         */
546        public ST[] getProductSerialLotNumber() {
547            ST[] ret = null;
548            try {
549                Type[] t = this.getField(12);  
550                ret = new ST[t.length];
551                for (int i = 0; i < ret.length; i++) {
552                    ret[i] = (ST)t[i];
553                }
554            } catch (ClassCastException cce) {
555                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
556                throw new RuntimeException(cce);
557            } catch (HL7Exception he) {
558                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
559                throw new RuntimeException(he);
560            }
561            return ret;
562        }
563    
564    
565        /**
566         * Returns a count of the current number of repetitions of Product Serial/Lot Number (PCR-12).
567         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
568         * it will return zero.
569         */
570        public int getProductSerialLotNumberReps() {
571            ST[] ret = null;
572            try {
573                Type[] t = this.getField(12);
574                return t.length;  
575            } catch (ClassCastException cce) {
576                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
577                throw new RuntimeException(cce);
578            } catch (HL7Exception he) {
579                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
580                throw new RuntimeException(he);
581            }
582        }
583    
584    
585        /**
586         * Returns a specific repetition of
587         * PCR-12: "Product Serial/Lot Number" - creates it if necessary
588         *
589         * @param rep The repetition index (0-indexed)
590         */
591        public ST getProductSerialLotNumber(int rep) { 
592            ST ret = null;
593            try {
594                Type t = this.getField(12, rep);
595                ret = (ST)t;
596            } catch (ClassCastException cce) {
597                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
598                throw new RuntimeException(cce);
599            } catch (HL7Exception he) {
600                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
601                throw new RuntimeException(he);
602            }
603            return ret;
604        }
605    
606        /**
607         * Returns a specific repetition of
608         * PCR-12: "Product Serial/Lot Number" - creates it if necessary
609         *
610         * @param rep The repetition index (0-indexed)
611         */
612        public ST getPcr12_ProductSerialLotNumber(int rep) { 
613            ST ret = null;
614            try {
615                Type t = this.getField(12, rep);
616                ret = (ST)t;
617            } catch (ClassCastException cce) {
618                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
619                throw new RuntimeException(cce);
620            } catch (HL7Exception he) {
621                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
622                throw new RuntimeException(he);
623            }
624            return ret;
625        }
626    
627    
628        /**
629         * Returns a count of the current number of repetitions of Product Serial/Lot Number (PCR-12).
630         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
631         * it will return zero.
632         */
633        public int getPcr12_ProductSerialLotNumberReps() {
634            ST[] ret = null;
635            try {
636                Type[] t = this.getField(12);
637                return t.length;  
638            } catch (ClassCastException cce) {
639                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
640                throw new RuntimeException(cce);
641            } catch (HL7Exception he) {
642                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
643                throw new RuntimeException(he);
644            }
645        }
646    
647    
648    
649        /**
650         * Inserts a repetition of
651         * PCR-12: "Product Serial/Lot Number" at a specific index
652         *
653         * @param rep The repetition index (0-indexed)
654         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
655         */
656        public ST insertProductSerialLotNumber(int rep) throws HL7Exception { 
657            return (ST) super.insertRepetition(12, rep);
658        }
659    
660    
661    
662        /**
663         * Inserts a repetition of
664         * PCR-12: "Product Serial/Lot Number" at a specific index
665         *
666         * @param rep The repetition index (0-indexed)
667         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
668         */
669        public ST insertPcr12_ProductSerialLotNumber(int rep) throws HL7Exception { 
670            return (ST) super.insertRepetition(12, rep);
671        }
672    
673    
674        /**
675         * Removes a repetition of
676         * PCR-12: "Product Serial/Lot Number" at a specific index
677         *
678         * @param rep The repetition index (0-indexed)
679         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
680         */
681        public ST removeProductSerialLotNumber(int rep) throws HL7Exception { 
682            return (ST) super.removeRepetition(12, rep);
683        }
684    
685    
686        /**
687         * Removes a repetition of
688         * PCR-12: "Product Serial/Lot Number" at a specific index
689         *
690         * @param rep The repetition index (0-indexed)
691         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
692         */
693        public ST removePcr12_ProductSerialLotNumber(int rep) throws HL7Exception { 
694            return (ST) super.removeRepetition(12, rep);
695        }
696    
697    
698    
699    
700        /**
701         * Returns
702         * PCR-13: "Product Available For Inspection" - creates it if necessary
703         */
704        public IS getProductAvailableForInspection() { 
705            IS ret = null;
706            try {
707                Type t = this.getField(13, 0);
708                ret = (IS)t;
709            } catch (ClassCastException cce) {
710                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
711                throw new RuntimeException(cce);
712            } catch (HL7Exception he) {
713                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
714                throw new RuntimeException(he);
715            }
716            return ret;
717        }
718    
719    
720        /**
721         * Returns
722         * PCR-13: "Product Available For Inspection" - creates it if necessary
723         */
724        public IS getPcr13_ProductAvailableForInspection() { 
725            IS ret = null;
726            try {
727                Type t = this.getField(13, 0);
728                ret = (IS)t;
729            } catch (ClassCastException cce) {
730                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
731                throw new RuntimeException(cce);
732            } catch (HL7Exception he) {
733                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
734                throw new RuntimeException(he);
735            }
736            return ret;
737        }
738    
739    
740    
741        /**
742         * Returns
743         * PCR-14: "Product Evaluation Performed" - creates it if necessary
744         */
745        public CE getProductEvaluationPerformed() { 
746            CE ret = null;
747            try {
748                Type t = this.getField(14, 0);
749                ret = (CE)t;
750            } catch (ClassCastException cce) {
751                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
752                throw new RuntimeException(cce);
753            } catch (HL7Exception he) {
754                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
755                throw new RuntimeException(he);
756            }
757            return ret;
758        }
759    
760    
761        /**
762         * Returns
763         * PCR-14: "Product Evaluation Performed" - creates it if necessary
764         */
765        public CE getPcr14_ProductEvaluationPerformed() { 
766            CE ret = null;
767            try {
768                Type t = this.getField(14, 0);
769                ret = (CE)t;
770            } catch (ClassCastException cce) {
771                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
772                throw new RuntimeException(cce);
773            } catch (HL7Exception he) {
774                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
775                throw new RuntimeException(he);
776            }
777            return ret;
778        }
779    
780    
781    
782        /**
783         * Returns
784         * PCR-15: "Product Evaluation Status" - creates it if necessary
785         */
786        public CE getProductEvaluationStatus() { 
787            CE ret = null;
788            try {
789                Type t = this.getField(15, 0);
790                ret = (CE)t;
791            } catch (ClassCastException cce) {
792                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
793                throw new RuntimeException(cce);
794            } catch (HL7Exception he) {
795                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
796                throw new RuntimeException(he);
797            }
798            return ret;
799        }
800    
801    
802        /**
803         * Returns
804         * PCR-15: "Product Evaluation Status" - creates it if necessary
805         */
806        public CE getPcr15_ProductEvaluationStatus() { 
807            CE ret = null;
808            try {
809                Type t = this.getField(15, 0);
810                ret = (CE)t;
811            } catch (ClassCastException cce) {
812                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
813                throw new RuntimeException(cce);
814            } catch (HL7Exception he) {
815                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
816                throw new RuntimeException(he);
817            }
818            return ret;
819        }
820    
821    
822    
823        /**
824         * Returns
825         * PCR-16: "Product Evaluation Results" - creates it if necessary
826         */
827        public CE getProductEvaluationResults() { 
828            CE ret = null;
829            try {
830                Type t = this.getField(16, 0);
831                ret = (CE)t;
832            } catch (ClassCastException cce) {
833                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
834                throw new RuntimeException(cce);
835            } catch (HL7Exception he) {
836                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
837                throw new RuntimeException(he);
838            }
839            return ret;
840        }
841    
842    
843        /**
844         * Returns
845         * PCR-16: "Product Evaluation Results" - creates it if necessary
846         */
847        public CE getPcr16_ProductEvaluationResults() { 
848            CE ret = null;
849            try {
850                Type t = this.getField(16, 0);
851                ret = (CE)t;
852            } catch (ClassCastException cce) {
853                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
854                throw new RuntimeException(cce);
855            } catch (HL7Exception he) {
856                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
857                throw new RuntimeException(he);
858            }
859            return ret;
860        }
861    
862    
863    
864        /**
865         * Returns
866         * PCR-17: "Evaluated Product Source" - creates it if necessary
867         */
868        public ID getEvaluatedProductSource() { 
869            ID ret = null;
870            try {
871                Type t = this.getField(17, 0);
872                ret = (ID)t;
873            } catch (ClassCastException cce) {
874                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
875                throw new RuntimeException(cce);
876            } catch (HL7Exception he) {
877                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
878                throw new RuntimeException(he);
879            }
880            return ret;
881        }
882    
883    
884        /**
885         * Returns
886         * PCR-17: "Evaluated Product Source" - creates it if necessary
887         */
888        public ID getPcr17_EvaluatedProductSource() { 
889            ID ret = null;
890            try {
891                Type t = this.getField(17, 0);
892                ret = (ID)t;
893            } catch (ClassCastException cce) {
894                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
895                throw new RuntimeException(cce);
896            } catch (HL7Exception he) {
897                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
898                throw new RuntimeException(he);
899            }
900            return ret;
901        }
902    
903    
904    
905        /**
906         * Returns
907         * PCR-18: "Date Product Returned To Manufacturer" - creates it if necessary
908         */
909        public TS getDateProductReturnedToManufacturer() { 
910            TS ret = null;
911            try {
912                Type t = this.getField(18, 0);
913                ret = (TS)t;
914            } catch (ClassCastException cce) {
915                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
916                throw new RuntimeException(cce);
917            } catch (HL7Exception he) {
918                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
919                throw new RuntimeException(he);
920            }
921            return ret;
922        }
923    
924    
925        /**
926         * Returns
927         * PCR-18: "Date Product Returned To Manufacturer" - creates it if necessary
928         */
929        public TS getPcr18_DateProductReturnedToManufacturer() { 
930            TS ret = null;
931            try {
932                Type t = this.getField(18, 0);
933                ret = (TS)t;
934            } catch (ClassCastException cce) {
935                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
936                throw new RuntimeException(cce);
937            } catch (HL7Exception he) {
938                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
939                throw new RuntimeException(he);
940            }
941            return ret;
942        }
943    
944    
945    
946        /**
947         * Returns
948         * PCR-19: "Device Operator Qualifications" - creates it if necessary
949         */
950        public ID getDeviceOperatorQualifications() { 
951            ID ret = null;
952            try {
953                Type t = this.getField(19, 0);
954                ret = (ID)t;
955            } catch (ClassCastException cce) {
956                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
957                throw new RuntimeException(cce);
958            } catch (HL7Exception he) {
959                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
960                throw new RuntimeException(he);
961            }
962            return ret;
963        }
964    
965    
966        /**
967         * Returns
968         * PCR-19: "Device Operator Qualifications" - creates it if necessary
969         */
970        public ID getPcr19_DeviceOperatorQualifications() { 
971            ID ret = null;
972            try {
973                Type t = this.getField(19, 0);
974                ret = (ID)t;
975            } catch (ClassCastException cce) {
976                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
977                throw new RuntimeException(cce);
978            } catch (HL7Exception he) {
979                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
980                throw new RuntimeException(he);
981            }
982            return ret;
983        }
984    
985    
986    
987        /**
988         * Returns
989         * PCR-20: "Relatedness Assessment" - creates it if necessary
990         */
991        public ID getRelatednessAssessment() { 
992            ID ret = null;
993            try {
994                Type t = this.getField(20, 0);
995                ret = (ID)t;
996            } catch (ClassCastException cce) {
997                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
998                throw new RuntimeException(cce);
999            } catch (HL7Exception he) {
1000                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1001                throw new RuntimeException(he);
1002            }
1003            return ret;
1004        }
1005    
1006    
1007        /**
1008         * Returns
1009         * PCR-20: "Relatedness Assessment" - creates it if necessary
1010         */
1011        public ID getPcr20_RelatednessAssessment() { 
1012            ID ret = null;
1013            try {
1014                Type t = this.getField(20, 0);
1015                ret = (ID)t;
1016            } catch (ClassCastException cce) {
1017                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1018                throw new RuntimeException(cce);
1019            } catch (HL7Exception he) {
1020                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1021                throw new RuntimeException(he);
1022            }
1023            return ret;
1024        }
1025    
1026    
1027        /**
1028         * Returns all repetitions of Action Taken In Response To The Event (PCR-21).
1029         */
1030        public ID[] getActionTakenInResponseToTheEvent() {
1031            ID[] ret = null;
1032            try {
1033                Type[] t = this.getField(21);  
1034                ret = new ID[t.length];
1035                for (int i = 0; i < ret.length; i++) {
1036                    ret[i] = (ID)t[i];
1037                }
1038            } catch (ClassCastException cce) {
1039                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1040                throw new RuntimeException(cce);
1041            } catch (HL7Exception he) {
1042                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1043                throw new RuntimeException(he);
1044            }
1045            return ret;
1046        }
1047    
1048    
1049        /**
1050         * Returns a count of the current number of repetitions of Action Taken In Response To The Event (PCR-21).
1051         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1052         * it will return zero.
1053         */
1054        public int getActionTakenInResponseToTheEventReps() {
1055            ID[] ret = null;
1056            try {
1057                Type[] t = this.getField(21);
1058                return t.length;  
1059            } catch (ClassCastException cce) {
1060                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1061                throw new RuntimeException(cce);
1062            } catch (HL7Exception he) {
1063                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1064                throw new RuntimeException(he);
1065            }
1066        }
1067    
1068    
1069        /**
1070         * Returns a specific repetition of
1071         * PCR-21: "Action Taken In Response To The Event" - creates it if necessary
1072         *
1073         * @param rep The repetition index (0-indexed)
1074         */
1075        public ID getActionTakenInResponseToTheEvent(int rep) { 
1076            ID ret = null;
1077            try {
1078                Type t = this.getField(21, rep);
1079                ret = (ID)t;
1080            } catch (ClassCastException cce) {
1081                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1082                throw new RuntimeException(cce);
1083            } catch (HL7Exception he) {
1084                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1085                throw new RuntimeException(he);
1086            }
1087            return ret;
1088        }
1089    
1090        /**
1091         * Returns a specific repetition of
1092         * PCR-21: "Action Taken In Response To The Event" - creates it if necessary
1093         *
1094         * @param rep The repetition index (0-indexed)
1095         */
1096        public ID getPcr21_ActionTakenInResponseToTheEvent(int rep) { 
1097            ID ret = null;
1098            try {
1099                Type t = this.getField(21, rep);
1100                ret = (ID)t;
1101            } catch (ClassCastException cce) {
1102                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1103                throw new RuntimeException(cce);
1104            } catch (HL7Exception he) {
1105                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1106                throw new RuntimeException(he);
1107            }
1108            return ret;
1109        }
1110    
1111    
1112        /**
1113         * Returns a count of the current number of repetitions of Action Taken In Response To The Event (PCR-21).
1114         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1115         * it will return zero.
1116         */
1117        public int getPcr21_ActionTakenInResponseToTheEventReps() {
1118            ID[] ret = null;
1119            try {
1120                Type[] t = this.getField(21);
1121                return t.length;  
1122            } catch (ClassCastException cce) {
1123                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1124                throw new RuntimeException(cce);
1125            } catch (HL7Exception he) {
1126                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1127                throw new RuntimeException(he);
1128            }
1129        }
1130    
1131    
1132    
1133        /**
1134         * Inserts a repetition of
1135         * PCR-21: "Action Taken In Response To The Event" at a specific index
1136         *
1137         * @param rep The repetition index (0-indexed)
1138         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1139         */
1140        public ID insertActionTakenInResponseToTheEvent(int rep) throws HL7Exception { 
1141            return (ID) super.insertRepetition(21, rep);
1142        }
1143    
1144    
1145    
1146        /**
1147         * Inserts a repetition of
1148         * PCR-21: "Action Taken In Response To The Event" at a specific index
1149         *
1150         * @param rep The repetition index (0-indexed)
1151         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1152         */
1153        public ID insertPcr21_ActionTakenInResponseToTheEvent(int rep) throws HL7Exception { 
1154            return (ID) super.insertRepetition(21, rep);
1155        }
1156    
1157    
1158        /**
1159         * Removes a repetition of
1160         * PCR-21: "Action Taken In Response To The Event" at a specific index
1161         *
1162         * @param rep The repetition index (0-indexed)
1163         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1164         */
1165        public ID removeActionTakenInResponseToTheEvent(int rep) throws HL7Exception { 
1166            return (ID) super.removeRepetition(21, rep);
1167        }
1168    
1169    
1170        /**
1171         * Removes a repetition of
1172         * PCR-21: "Action Taken In Response To The Event" at a specific index
1173         *
1174         * @param rep The repetition index (0-indexed)
1175         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1176         */
1177        public ID removePcr21_ActionTakenInResponseToTheEvent(int rep) throws HL7Exception { 
1178            return (ID) super.removeRepetition(21, rep);
1179        }
1180    
1181    
1182    
1183        /**
1184         * Returns all repetitions of Event Causality Observations (PCR-22).
1185         */
1186        public ID[] getEventCausalityObservations() {
1187            ID[] ret = null;
1188            try {
1189                Type[] t = this.getField(22);  
1190                ret = new ID[t.length];
1191                for (int i = 0; i < ret.length; i++) {
1192                    ret[i] = (ID)t[i];
1193                }
1194            } catch (ClassCastException cce) {
1195                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1196                throw new RuntimeException(cce);
1197            } catch (HL7Exception he) {
1198                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1199                throw new RuntimeException(he);
1200            }
1201            return ret;
1202        }
1203    
1204    
1205        /**
1206         * Returns a count of the current number of repetitions of Event Causality Observations (PCR-22).
1207         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1208         * it will return zero.
1209         */
1210        public int getEventCausalityObservationsReps() {
1211            ID[] ret = null;
1212            try {
1213                Type[] t = this.getField(22);
1214                return t.length;  
1215            } catch (ClassCastException cce) {
1216                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1217                throw new RuntimeException(cce);
1218            } catch (HL7Exception he) {
1219                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1220                throw new RuntimeException(he);
1221            }
1222        }
1223    
1224    
1225        /**
1226         * Returns a specific repetition of
1227         * PCR-22: "Event Causality Observations" - creates it if necessary
1228         *
1229         * @param rep The repetition index (0-indexed)
1230         */
1231        public ID getEventCausalityObservations(int rep) { 
1232            ID ret = null;
1233            try {
1234                Type t = this.getField(22, rep);
1235                ret = (ID)t;
1236            } catch (ClassCastException cce) {
1237                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1238                throw new RuntimeException(cce);
1239            } catch (HL7Exception he) {
1240                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1241                throw new RuntimeException(he);
1242            }
1243            return ret;
1244        }
1245    
1246        /**
1247         * Returns a specific repetition of
1248         * PCR-22: "Event Causality Observations" - creates it if necessary
1249         *
1250         * @param rep The repetition index (0-indexed)
1251         */
1252        public ID getPcr22_EventCausalityObservations(int rep) { 
1253            ID ret = null;
1254            try {
1255                Type t = this.getField(22, rep);
1256                ret = (ID)t;
1257            } catch (ClassCastException cce) {
1258                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1259                throw new RuntimeException(cce);
1260            } catch (HL7Exception he) {
1261                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1262                throw new RuntimeException(he);
1263            }
1264            return ret;
1265        }
1266    
1267    
1268        /**
1269         * Returns a count of the current number of repetitions of Event Causality Observations (PCR-22).
1270         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1271         * it will return zero.
1272         */
1273        public int getPcr22_EventCausalityObservationsReps() {
1274            ID[] ret = null;
1275            try {
1276                Type[] t = this.getField(22);
1277                return t.length;  
1278            } catch (ClassCastException cce) {
1279                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1280                throw new RuntimeException(cce);
1281            } catch (HL7Exception he) {
1282                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1283                throw new RuntimeException(he);
1284            }
1285        }
1286    
1287    
1288    
1289        /**
1290         * Inserts a repetition of
1291         * PCR-22: "Event Causality Observations" at a specific index
1292         *
1293         * @param rep The repetition index (0-indexed)
1294         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1295         */
1296        public ID insertEventCausalityObservations(int rep) throws HL7Exception { 
1297            return (ID) super.insertRepetition(22, rep);
1298        }
1299    
1300    
1301    
1302        /**
1303         * Inserts a repetition of
1304         * PCR-22: "Event Causality Observations" at a specific index
1305         *
1306         * @param rep The repetition index (0-indexed)
1307         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1308         */
1309        public ID insertPcr22_EventCausalityObservations(int rep) throws HL7Exception { 
1310            return (ID) super.insertRepetition(22, rep);
1311        }
1312    
1313    
1314        /**
1315         * Removes a repetition of
1316         * PCR-22: "Event Causality Observations" at a specific index
1317         *
1318         * @param rep The repetition index (0-indexed)
1319         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1320         */
1321        public ID removeEventCausalityObservations(int rep) throws HL7Exception { 
1322            return (ID) super.removeRepetition(22, rep);
1323        }
1324    
1325    
1326        /**
1327         * Removes a repetition of
1328         * PCR-22: "Event Causality Observations" at a specific index
1329         *
1330         * @param rep The repetition index (0-indexed)
1331         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1332         */
1333        public ID removePcr22_EventCausalityObservations(int rep) throws HL7Exception { 
1334            return (ID) super.removeRepetition(22, rep);
1335        }
1336    
1337    
1338    
1339        /**
1340         * Returns all repetitions of Indirect Exposure Mechanism (PCR-23).
1341         */
1342        public ID[] getIndirectExposureMechanism() {
1343            ID[] ret = null;
1344            try {
1345                Type[] t = this.getField(23);  
1346                ret = new ID[t.length];
1347                for (int i = 0; i < ret.length; i++) {
1348                    ret[i] = (ID)t[i];
1349                }
1350            } catch (ClassCastException cce) {
1351                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1352                throw new RuntimeException(cce);
1353            } catch (HL7Exception he) {
1354                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1355                throw new RuntimeException(he);
1356            }
1357            return ret;
1358        }
1359    
1360    
1361        /**
1362         * Returns a count of the current number of repetitions of Indirect Exposure Mechanism (PCR-23).
1363         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1364         * it will return zero.
1365         */
1366        public int getIndirectExposureMechanismReps() {
1367            ID[] ret = null;
1368            try {
1369                Type[] t = this.getField(23);
1370                return t.length;  
1371            } catch (ClassCastException cce) {
1372                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1373                throw new RuntimeException(cce);
1374            } catch (HL7Exception he) {
1375                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1376                throw new RuntimeException(he);
1377            }
1378        }
1379    
1380    
1381        /**
1382         * Returns a specific repetition of
1383         * PCR-23: "Indirect Exposure Mechanism" - creates it if necessary
1384         *
1385         * @param rep The repetition index (0-indexed)
1386         */
1387        public ID getIndirectExposureMechanism(int rep) { 
1388            ID ret = null;
1389            try {
1390                Type t = this.getField(23, rep);
1391                ret = (ID)t;
1392            } catch (ClassCastException cce) {
1393                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1394                throw new RuntimeException(cce);
1395            } catch (HL7Exception he) {
1396                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1397                throw new RuntimeException(he);
1398            }
1399            return ret;
1400        }
1401    
1402        /**
1403         * Returns a specific repetition of
1404         * PCR-23: "Indirect Exposure Mechanism" - creates it if necessary
1405         *
1406         * @param rep The repetition index (0-indexed)
1407         */
1408        public ID getPcr23_IndirectExposureMechanism(int rep) { 
1409            ID ret = null;
1410            try {
1411                Type t = this.getField(23, rep);
1412                ret = (ID)t;
1413            } catch (ClassCastException cce) {
1414                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1415                throw new RuntimeException(cce);
1416            } catch (HL7Exception he) {
1417                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1418                throw new RuntimeException(he);
1419            }
1420            return ret;
1421        }
1422    
1423    
1424        /**
1425         * Returns a count of the current number of repetitions of Indirect Exposure Mechanism (PCR-23).
1426         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1427         * it will return zero.
1428         */
1429        public int getPcr23_IndirectExposureMechanismReps() {
1430            ID[] ret = null;
1431            try {
1432                Type[] t = this.getField(23);
1433                return t.length;  
1434            } catch (ClassCastException cce) {
1435                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1436                throw new RuntimeException(cce);
1437            } catch (HL7Exception he) {
1438                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1439                throw new RuntimeException(he);
1440            }
1441        }
1442    
1443    
1444    
1445        /**
1446         * Inserts a repetition of
1447         * PCR-23: "Indirect Exposure Mechanism" at a specific index
1448         *
1449         * @param rep The repetition index (0-indexed)
1450         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1451         */
1452        public ID insertIndirectExposureMechanism(int rep) throws HL7Exception { 
1453            return (ID) super.insertRepetition(23, rep);
1454        }
1455    
1456    
1457    
1458        /**
1459         * Inserts a repetition of
1460         * PCR-23: "Indirect Exposure Mechanism" at a specific index
1461         *
1462         * @param rep The repetition index (0-indexed)
1463         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1464         */
1465        public ID insertPcr23_IndirectExposureMechanism(int rep) throws HL7Exception { 
1466            return (ID) super.insertRepetition(23, rep);
1467        }
1468    
1469    
1470        /**
1471         * Removes a repetition of
1472         * PCR-23: "Indirect Exposure Mechanism" at a specific index
1473         *
1474         * @param rep The repetition index (0-indexed)
1475         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1476         */
1477        public ID removeIndirectExposureMechanism(int rep) throws HL7Exception { 
1478            return (ID) super.removeRepetition(23, rep);
1479        }
1480    
1481    
1482        /**
1483         * Removes a repetition of
1484         * PCR-23: "Indirect Exposure Mechanism" at a specific index
1485         *
1486         * @param rep The repetition index (0-indexed)
1487         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1488         */
1489        public ID removePcr23_IndirectExposureMechanism(int rep) throws HL7Exception { 
1490            return (ID) super.removeRepetition(23, rep);
1491        }
1492    
1493    
1494    
1495    
1496    
1497    
1498        /** {@inheritDoc} */   
1499        protected Type createNewTypeWithoutReflection(int field) {
1500           switch (field) {
1501              case 0: return new CE(getMessage());
1502              case 1: return new IS(getMessage(), new Integer( 249 ));
1503              case 2: return new CE(getMessage());
1504              case 3: return new CQ(getMessage());
1505              case 4: return new TS(getMessage());
1506              case 5: return new TS(getMessage());
1507              case 6: return new TS(getMessage());
1508              case 7: return new TS(getMessage());
1509              case 8: return new IS(getMessage(), new Integer( 244 ));
1510              case 9: return new CE(getMessage());
1511              case 10: return new IS(getMessage(), new Integer( 245 ));
1512              case 11: return new ST(getMessage());
1513              case 12: return new IS(getMessage(), new Integer( 246 ));
1514              case 13: return new CE(getMessage());
1515              case 14: return new CE(getMessage());
1516              case 15: return new CE(getMessage());
1517              case 16: return new ID(getMessage(), new Integer( 248 ));
1518              case 17: return new TS(getMessage());
1519              case 18: return new ID(getMessage(), new Integer( 242 ));
1520              case 19: return new ID(getMessage(), new Integer( 250 ));
1521              case 20: return new ID(getMessage(), new Integer( 251 ));
1522              case 21: return new ID(getMessage(), new Integer( 252 ));
1523              case 22: return new ID(getMessage(), new Integer( 253 ));
1524              default: return null;
1525           }
1526       }
1527    
1528    
1529    }
1530