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 CSR message segment (Clinical Study Registration). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>CSR-1: Sponsor Study ID (EI) <b> </b>
027         * <li>CSR-2: Alternate Study ID (EI) <b>optional </b>
028         * <li>CSR-3: Institution Registering the Patient (CE) <b>optional </b>
029         * <li>CSR-4: Sponsor Patient ID (CX) <b> </b>
030         * <li>CSR-5: Alternate Patient ID - CSR (CX) <b>optional </b>
031         * <li>CSR-6: Date/Time Of Patient Study Registration (TS) <b> </b>
032         * <li>CSR-7: Person Performing Study Registration (XCN) <b>optional repeating</b>
033         * <li>CSR-8: Study Authorizing Provider (XCN) <b> repeating</b>
034         * <li>CSR-9: Date/time Patient Study Consent Signed (TS) <b>optional </b>
035         * <li>CSR-10: Patient Study Eligibility Status (CE) <b>optional </b>
036         * <li>CSR-11: Study Randomization Date/time (TS) <b>optional repeating</b>
037         * <li>CSR-12: Randomized Study Arm (CE) <b>optional repeating</b>
038         * <li>CSR-13: Stratum for Study Randomization (CE) <b>optional repeating</b>
039         * <li>CSR-14: Patient Evaluability Status (CE) <b>optional </b>
040         * <li>CSR-15: Date/time Ended Study (TS) <b>optional </b>
041         * <li>CSR-16: Reason Ended Study (CE) <b>optional </b>
042     * </ul>
043     */
044    public class CSR extends AbstractSegment {
045    
046        /** 
047         * Creates a new CSR segment
048         */
049        public CSR(Group parent, ModelClassFactory factory) {
050           super(parent, factory);
051           init(factory);
052        }
053    
054        private void init(ModelClassFactory factory) {
055           try {
056                                      this.add(EI.class, true, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Sponsor Study ID");
057                                      this.add(EI.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Alternate Study ID");
058                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Institution Registering the Patient");
059                                      this.add(CX.class, true, 1, 30, new Object[]{ getMessage(), new Integer(0) }, "Sponsor Patient ID");
060                                      this.add(CX.class, false, 1, 30, new Object[]{ getMessage(), new Integer(0) }, "Alternate Patient ID - CSR");
061                                      this.add(TS.class, true, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date/Time Of Patient Study Registration");
062                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Person Performing Study Registration");
063                                      this.add(XCN.class, true, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Study Authorizing Provider");
064                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date/time Patient Study Consent Signed");
065                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Patient Study Eligibility Status");
066                                      this.add(TS.class, false, 3, 26, new Object[]{ getMessage(), new Integer(0) }, "Study Randomization Date/time");
067                                      this.add(CE.class, false, 3, 250, new Object[]{ getMessage(), new Integer(0) }, "Randomized Study Arm");
068                                      this.add(CE.class, false, 3, 250, new Object[]{ getMessage(), new Integer(0) }, "Stratum for Study Randomization");
069                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Patient Evaluability Status");
070                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date/time Ended Study");
071                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Reason Ended Study");
072           } catch(HL7Exception e) {
073              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating CSR - this is probably a bug in the source code generator.", e);
074           }
075        }
076    
077    
078    
079        /**
080         * Returns
081         * CSR-1: "Sponsor Study ID" - creates it if necessary
082         */
083        public EI getSponsorStudyID() { 
084            EI ret = null;
085            try {
086                Type t = this.getField(1, 0);
087                ret = (EI)t;
088            } catch (ClassCastException cce) {
089                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
090                throw new RuntimeException(cce);
091            } catch (HL7Exception he) {
092                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
093                throw new RuntimeException(he);
094            }
095            return ret;
096        }
097    
098    
099        /**
100         * Returns
101         * CSR-1: "Sponsor Study ID" - creates it if necessary
102         */
103        public EI getCsr1_SponsorStudyID() { 
104            EI ret = null;
105            try {
106                Type t = this.getField(1, 0);
107                ret = (EI)t;
108            } catch (ClassCastException cce) {
109                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
110                throw new RuntimeException(cce);
111            } catch (HL7Exception he) {
112                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
113                throw new RuntimeException(he);
114            }
115            return ret;
116        }
117    
118    
119    
120        /**
121         * Returns
122         * CSR-2: "Alternate Study ID" - creates it if necessary
123         */
124        public EI getAlternateStudyID() { 
125            EI ret = null;
126            try {
127                Type t = this.getField(2, 0);
128                ret = (EI)t;
129            } catch (ClassCastException cce) {
130                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
131                throw new RuntimeException(cce);
132            } catch (HL7Exception he) {
133                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
134                throw new RuntimeException(he);
135            }
136            return ret;
137        }
138    
139    
140        /**
141         * Returns
142         * CSR-2: "Alternate Study ID" - creates it if necessary
143         */
144        public EI getCsr2_AlternateStudyID() { 
145            EI ret = null;
146            try {
147                Type t = this.getField(2, 0);
148                ret = (EI)t;
149            } catch (ClassCastException cce) {
150                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
151                throw new RuntimeException(cce);
152            } catch (HL7Exception he) {
153                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
154                throw new RuntimeException(he);
155            }
156            return ret;
157        }
158    
159    
160    
161        /**
162         * Returns
163         * CSR-3: "Institution Registering the Patient" - creates it if necessary
164         */
165        public CE getInstitutionRegisteringThePatient() { 
166            CE ret = null;
167            try {
168                Type t = this.getField(3, 0);
169                ret = (CE)t;
170            } catch (ClassCastException cce) {
171                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
172                throw new RuntimeException(cce);
173            } catch (HL7Exception he) {
174                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
175                throw new RuntimeException(he);
176            }
177            return ret;
178        }
179    
180    
181        /**
182         * Returns
183         * CSR-3: "Institution Registering the Patient" - creates it if necessary
184         */
185        public CE getCsr3_InstitutionRegisteringThePatient() { 
186            CE ret = null;
187            try {
188                Type t = this.getField(3, 0);
189                ret = (CE)t;
190            } catch (ClassCastException cce) {
191                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
192                throw new RuntimeException(cce);
193            } catch (HL7Exception he) {
194                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
195                throw new RuntimeException(he);
196            }
197            return ret;
198        }
199    
200    
201    
202        /**
203         * Returns
204         * CSR-4: "Sponsor Patient ID" - creates it if necessary
205         */
206        public CX getSponsorPatientID() { 
207            CX ret = null;
208            try {
209                Type t = this.getField(4, 0);
210                ret = (CX)t;
211            } catch (ClassCastException cce) {
212                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
213                throw new RuntimeException(cce);
214            } catch (HL7Exception he) {
215                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
216                throw new RuntimeException(he);
217            }
218            return ret;
219        }
220    
221    
222        /**
223         * Returns
224         * CSR-4: "Sponsor Patient ID" - creates it if necessary
225         */
226        public CX getCsr4_SponsorPatientID() { 
227            CX ret = null;
228            try {
229                Type t = this.getField(4, 0);
230                ret = (CX)t;
231            } catch (ClassCastException cce) {
232                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
233                throw new RuntimeException(cce);
234            } catch (HL7Exception he) {
235                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
236                throw new RuntimeException(he);
237            }
238            return ret;
239        }
240    
241    
242    
243        /**
244         * Returns
245         * CSR-5: "Alternate Patient ID - CSR" - creates it if necessary
246         */
247        public CX getAlternatePatientIDCSR() { 
248            CX ret = null;
249            try {
250                Type t = this.getField(5, 0);
251                ret = (CX)t;
252            } catch (ClassCastException cce) {
253                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
254                throw new RuntimeException(cce);
255            } catch (HL7Exception he) {
256                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
257                throw new RuntimeException(he);
258            }
259            return ret;
260        }
261    
262    
263        /**
264         * Returns
265         * CSR-5: "Alternate Patient ID - CSR" - creates it if necessary
266         */
267        public CX getCsr5_AlternatePatientIDCSR() { 
268            CX ret = null;
269            try {
270                Type t = this.getField(5, 0);
271                ret = (CX)t;
272            } catch (ClassCastException cce) {
273                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
274                throw new RuntimeException(cce);
275            } catch (HL7Exception he) {
276                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
277                throw new RuntimeException(he);
278            }
279            return ret;
280        }
281    
282    
283    
284        /**
285         * Returns
286         * CSR-6: "Date/Time Of Patient Study Registration" - creates it if necessary
287         */
288        public TS getDateTimeOfPatientStudyRegistration() { 
289            TS ret = null;
290            try {
291                Type t = this.getField(6, 0);
292                ret = (TS)t;
293            } catch (ClassCastException cce) {
294                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
295                throw new RuntimeException(cce);
296            } catch (HL7Exception he) {
297                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
298                throw new RuntimeException(he);
299            }
300            return ret;
301        }
302    
303    
304        /**
305         * Returns
306         * CSR-6: "Date/Time Of Patient Study Registration" - creates it if necessary
307         */
308        public TS getCsr6_DateTimeOfPatientStudyRegistration() { 
309            TS ret = null;
310            try {
311                Type t = this.getField(6, 0);
312                ret = (TS)t;
313            } catch (ClassCastException cce) {
314                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
315                throw new RuntimeException(cce);
316            } catch (HL7Exception he) {
317                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
318                throw new RuntimeException(he);
319            }
320            return ret;
321        }
322    
323    
324        /**
325         * Returns all repetitions of Person Performing Study Registration (CSR-7).
326         */
327        public XCN[] getPersonPerformingStudyRegistration() {
328            XCN[] ret = null;
329            try {
330                Type[] t = this.getField(7);  
331                ret = new XCN[t.length];
332                for (int i = 0; i < ret.length; i++) {
333                    ret[i] = (XCN)t[i];
334                }
335            } catch (ClassCastException cce) {
336                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
337                throw new RuntimeException(cce);
338            } catch (HL7Exception he) {
339                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
340                throw new RuntimeException(he);
341            }
342            return ret;
343        }
344    
345    
346        /**
347         * Returns a count of the current number of repetitions of Person Performing Study Registration (CSR-7).
348         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
349         * it will return zero.
350         */
351        public int getPersonPerformingStudyRegistrationReps() {
352            XCN[] ret = null;
353            try {
354                Type[] t = this.getField(7);
355                return t.length;  
356            } catch (ClassCastException cce) {
357                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
358                throw new RuntimeException(cce);
359            } catch (HL7Exception he) {
360                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
361                throw new RuntimeException(he);
362            }
363        }
364    
365    
366        /**
367         * Returns a specific repetition of
368         * CSR-7: "Person Performing Study Registration" - creates it if necessary
369         *
370         * @param rep The repetition index (0-indexed)
371         */
372        public XCN getPersonPerformingStudyRegistration(int rep) { 
373            XCN ret = null;
374            try {
375                Type t = this.getField(7, rep);
376                ret = (XCN)t;
377            } catch (ClassCastException cce) {
378                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
379                throw new RuntimeException(cce);
380            } catch (HL7Exception he) {
381                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
382                throw new RuntimeException(he);
383            }
384            return ret;
385        }
386    
387        /**
388         * Returns a specific repetition of
389         * CSR-7: "Person Performing Study Registration" - creates it if necessary
390         *
391         * @param rep The repetition index (0-indexed)
392         */
393        public XCN getCsr7_PersonPerformingStudyRegistration(int rep) { 
394            XCN ret = null;
395            try {
396                Type t = this.getField(7, rep);
397                ret = (XCN)t;
398            } catch (ClassCastException cce) {
399                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
400                throw new RuntimeException(cce);
401            } catch (HL7Exception he) {
402                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
403                throw new RuntimeException(he);
404            }
405            return ret;
406        }
407    
408    
409        /**
410         * Returns a count of the current number of repetitions of Person Performing Study Registration (CSR-7).
411         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
412         * it will return zero.
413         */
414        public int getCsr7_PersonPerformingStudyRegistrationReps() {
415            XCN[] ret = null;
416            try {
417                Type[] t = this.getField(7);
418                return t.length;  
419            } catch (ClassCastException cce) {
420                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
421                throw new RuntimeException(cce);
422            } catch (HL7Exception he) {
423                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
424                throw new RuntimeException(he);
425            }
426        }
427    
428    
429    
430        /**
431         * Inserts a repetition of
432         * CSR-7: "Person Performing Study Registration" at a specific index
433         *
434         * @param rep The repetition index (0-indexed)
435         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
436         */
437        public XCN insertPersonPerformingStudyRegistration(int rep) throws HL7Exception { 
438            return (XCN) super.insertRepetition(7, rep);
439        }
440    
441    
442    
443        /**
444         * Inserts a repetition of
445         * CSR-7: "Person Performing Study Registration" at a specific index
446         *
447         * @param rep The repetition index (0-indexed)
448         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
449         */
450        public XCN insertCsr7_PersonPerformingStudyRegistration(int rep) throws HL7Exception { 
451            return (XCN) super.insertRepetition(7, rep);
452        }
453    
454    
455        /**
456         * Removes a repetition of
457         * CSR-7: "Person Performing Study Registration" at a specific index
458         *
459         * @param rep The repetition index (0-indexed)
460         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
461         */
462        public XCN removePersonPerformingStudyRegistration(int rep) throws HL7Exception { 
463            return (XCN) super.removeRepetition(7, rep);
464        }
465    
466    
467        /**
468         * Removes a repetition of
469         * CSR-7: "Person Performing Study Registration" at a specific index
470         *
471         * @param rep The repetition index (0-indexed)
472         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
473         */
474        public XCN removeCsr7_PersonPerformingStudyRegistration(int rep) throws HL7Exception { 
475            return (XCN) super.removeRepetition(7, rep);
476        }
477    
478    
479    
480        /**
481         * Returns all repetitions of Study Authorizing Provider (CSR-8).
482         */
483        public XCN[] getStudyAuthorizingProvider() {
484            XCN[] ret = null;
485            try {
486                Type[] t = this.getField(8);  
487                ret = new XCN[t.length];
488                for (int i = 0; i < ret.length; i++) {
489                    ret[i] = (XCN)t[i];
490                }
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         * Returns a count of the current number of repetitions of Study Authorizing Provider (CSR-8).
504         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
505         * it will return zero.
506         */
507        public int getStudyAuthorizingProviderReps() {
508            XCN[] ret = null;
509            try {
510                Type[] t = this.getField(8);
511                return t.length;  
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        }
520    
521    
522        /**
523         * Returns a specific repetition of
524         * CSR-8: "Study Authorizing Provider" - creates it if necessary
525         *
526         * @param rep The repetition index (0-indexed)
527         */
528        public XCN getStudyAuthorizingProvider(int rep) { 
529            XCN ret = null;
530            try {
531                Type t = this.getField(8, rep);
532                ret = (XCN)t;
533            } catch (ClassCastException cce) {
534                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
535                throw new RuntimeException(cce);
536            } catch (HL7Exception he) {
537                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
538                throw new RuntimeException(he);
539            }
540            return ret;
541        }
542    
543        /**
544         * Returns a specific repetition of
545         * CSR-8: "Study Authorizing Provider" - creates it if necessary
546         *
547         * @param rep The repetition index (0-indexed)
548         */
549        public XCN getCsr8_StudyAuthorizingProvider(int rep) { 
550            XCN ret = null;
551            try {
552                Type t = this.getField(8, rep);
553                ret = (XCN)t;
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 Study Authorizing Provider (CSR-8).
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 getCsr8_StudyAuthorizingProviderReps() {
571            XCN[] ret = null;
572            try {
573                Type[] t = this.getField(8);
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        /**
587         * Inserts a repetition of
588         * CSR-8: "Study Authorizing Provider" at a specific index
589         *
590         * @param rep The repetition index (0-indexed)
591         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
592         */
593        public XCN insertStudyAuthorizingProvider(int rep) throws HL7Exception { 
594            return (XCN) super.insertRepetition(8, rep);
595        }
596    
597    
598    
599        /**
600         * Inserts a repetition of
601         * CSR-8: "Study Authorizing Provider" at a specific index
602         *
603         * @param rep The repetition index (0-indexed)
604         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
605         */
606        public XCN insertCsr8_StudyAuthorizingProvider(int rep) throws HL7Exception { 
607            return (XCN) super.insertRepetition(8, rep);
608        }
609    
610    
611        /**
612         * Removes a repetition of
613         * CSR-8: "Study Authorizing Provider" at a specific index
614         *
615         * @param rep The repetition index (0-indexed)
616         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
617         */
618        public XCN removeStudyAuthorizingProvider(int rep) throws HL7Exception { 
619            return (XCN) super.removeRepetition(8, rep);
620        }
621    
622    
623        /**
624         * Removes a repetition of
625         * CSR-8: "Study Authorizing Provider" at a specific index
626         *
627         * @param rep The repetition index (0-indexed)
628         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
629         */
630        public XCN removeCsr8_StudyAuthorizingProvider(int rep) throws HL7Exception { 
631            return (XCN) super.removeRepetition(8, rep);
632        }
633    
634    
635    
636    
637        /**
638         * Returns
639         * CSR-9: "Date/time Patient Study Consent Signed" - creates it if necessary
640         */
641        public TS getDateTimePatientStudyConsentSigned() { 
642            TS ret = null;
643            try {
644                Type t = this.getField(9, 0);
645                ret = (TS)t;
646            } catch (ClassCastException cce) {
647                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
648                throw new RuntimeException(cce);
649            } catch (HL7Exception he) {
650                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
651                throw new RuntimeException(he);
652            }
653            return ret;
654        }
655    
656    
657        /**
658         * Returns
659         * CSR-9: "Date/time Patient Study Consent Signed" - creates it if necessary
660         */
661        public TS getCsr9_DateTimePatientStudyConsentSigned() { 
662            TS ret = null;
663            try {
664                Type t = this.getField(9, 0);
665                ret = (TS)t;
666            } catch (ClassCastException cce) {
667                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
668                throw new RuntimeException(cce);
669            } catch (HL7Exception he) {
670                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
671                throw new RuntimeException(he);
672            }
673            return ret;
674        }
675    
676    
677    
678        /**
679         * Returns
680         * CSR-10: "Patient Study Eligibility Status" - creates it if necessary
681         */
682        public CE getPatientStudyEligibilityStatus() { 
683            CE ret = null;
684            try {
685                Type t = this.getField(10, 0);
686                ret = (CE)t;
687            } catch (ClassCastException cce) {
688                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
689                throw new RuntimeException(cce);
690            } catch (HL7Exception he) {
691                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
692                throw new RuntimeException(he);
693            }
694            return ret;
695        }
696    
697    
698        /**
699         * Returns
700         * CSR-10: "Patient Study Eligibility Status" - creates it if necessary
701         */
702        public CE getCsr10_PatientStudyEligibilityStatus() { 
703            CE ret = null;
704            try {
705                Type t = this.getField(10, 0);
706                ret = (CE)t;
707            } catch (ClassCastException cce) {
708                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
709                throw new RuntimeException(cce);
710            } catch (HL7Exception he) {
711                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
712                throw new RuntimeException(he);
713            }
714            return ret;
715        }
716    
717    
718        /**
719         * Returns all repetitions of Study Randomization Date/time (CSR-11).
720         */
721        public TS[] getStudyRandomizationDateTime() {
722            TS[] ret = null;
723            try {
724                Type[] t = this.getField(11);  
725                ret = new TS[t.length];
726                for (int i = 0; i < ret.length; i++) {
727                    ret[i] = (TS)t[i];
728                }
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         * Returns a count of the current number of repetitions of Study Randomization Date/time (CSR-11).
742         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
743         * it will return zero.
744         */
745        public int getStudyRandomizationDateTimeReps() {
746            TS[] ret = null;
747            try {
748                Type[] t = this.getField(11);
749                return t.length;  
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        }
758    
759    
760        /**
761         * Returns a specific repetition of
762         * CSR-11: "Study Randomization Date/time" - creates it if necessary
763         *
764         * @param rep The repetition index (0-indexed)
765         */
766        public TS getStudyRandomizationDateTime(int rep) { 
767            TS ret = null;
768            try {
769                Type t = this.getField(11, rep);
770                ret = (TS)t;
771            } catch (ClassCastException cce) {
772                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
773                throw new RuntimeException(cce);
774            } catch (HL7Exception he) {
775                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
776                throw new RuntimeException(he);
777            }
778            return ret;
779        }
780    
781        /**
782         * Returns a specific repetition of
783         * CSR-11: "Study Randomization Date/time" - creates it if necessary
784         *
785         * @param rep The repetition index (0-indexed)
786         */
787        public TS getCsr11_StudyRandomizationDateTime(int rep) { 
788            TS ret = null;
789            try {
790                Type t = this.getField(11, rep);
791                ret = (TS)t;
792            } catch (ClassCastException cce) {
793                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
794                throw new RuntimeException(cce);
795            } catch (HL7Exception he) {
796                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
797                throw new RuntimeException(he);
798            }
799            return ret;
800        }
801    
802    
803        /**
804         * Returns a count of the current number of repetitions of Study Randomization Date/time (CSR-11).
805         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
806         * it will return zero.
807         */
808        public int getCsr11_StudyRandomizationDateTimeReps() {
809            TS[] ret = null;
810            try {
811                Type[] t = this.getField(11);
812                return t.length;  
813            } catch (ClassCastException cce) {
814                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
815                throw new RuntimeException(cce);
816            } catch (HL7Exception he) {
817                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
818                throw new RuntimeException(he);
819            }
820        }
821    
822    
823    
824        /**
825         * Inserts a repetition of
826         * CSR-11: "Study Randomization Date/time" at a specific index
827         *
828         * @param rep The repetition index (0-indexed)
829         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
830         */
831        public TS insertStudyRandomizationDateTime(int rep) throws HL7Exception { 
832            return (TS) super.insertRepetition(11, rep);
833        }
834    
835    
836    
837        /**
838         * Inserts a repetition of
839         * CSR-11: "Study Randomization Date/time" at a specific index
840         *
841         * @param rep The repetition index (0-indexed)
842         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
843         */
844        public TS insertCsr11_StudyRandomizationDateTime(int rep) throws HL7Exception { 
845            return (TS) super.insertRepetition(11, rep);
846        }
847    
848    
849        /**
850         * Removes a repetition of
851         * CSR-11: "Study Randomization Date/time" at a specific index
852         *
853         * @param rep The repetition index (0-indexed)
854         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
855         */
856        public TS removeStudyRandomizationDateTime(int rep) throws HL7Exception { 
857            return (TS) super.removeRepetition(11, rep);
858        }
859    
860    
861        /**
862         * Removes a repetition of
863         * CSR-11: "Study Randomization Date/time" at a specific index
864         *
865         * @param rep The repetition index (0-indexed)
866         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
867         */
868        public TS removeCsr11_StudyRandomizationDateTime(int rep) throws HL7Exception { 
869            return (TS) super.removeRepetition(11, rep);
870        }
871    
872    
873    
874        /**
875         * Returns all repetitions of Randomized Study Arm (CSR-12).
876         */
877        public CE[] getRandomizedStudyArm() {
878            CE[] ret = null;
879            try {
880                Type[] t = this.getField(12);  
881                ret = new CE[t.length];
882                for (int i = 0; i < ret.length; i++) {
883                    ret[i] = (CE)t[i];
884                }
885            } catch (ClassCastException cce) {
886                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
887                throw new RuntimeException(cce);
888            } catch (HL7Exception he) {
889                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
890                throw new RuntimeException(he);
891            }
892            return ret;
893        }
894    
895    
896        /**
897         * Returns a count of the current number of repetitions of Randomized Study Arm (CSR-12).
898         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
899         * it will return zero.
900         */
901        public int getRandomizedStudyArmReps() {
902            CE[] ret = null;
903            try {
904                Type[] t = this.getField(12);
905                return t.length;  
906            } catch (ClassCastException cce) {
907                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
908                throw new RuntimeException(cce);
909            } catch (HL7Exception he) {
910                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
911                throw new RuntimeException(he);
912            }
913        }
914    
915    
916        /**
917         * Returns a specific repetition of
918         * CSR-12: "Randomized Study Arm" - creates it if necessary
919         *
920         * @param rep The repetition index (0-indexed)
921         */
922        public CE getRandomizedStudyArm(int rep) { 
923            CE ret = null;
924            try {
925                Type t = this.getField(12, rep);
926                ret = (CE)t;
927            } catch (ClassCastException cce) {
928                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
929                throw new RuntimeException(cce);
930            } catch (HL7Exception he) {
931                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
932                throw new RuntimeException(he);
933            }
934            return ret;
935        }
936    
937        /**
938         * Returns a specific repetition of
939         * CSR-12: "Randomized Study Arm" - creates it if necessary
940         *
941         * @param rep The repetition index (0-indexed)
942         */
943        public CE getCsr12_RandomizedStudyArm(int rep) { 
944            CE ret = null;
945            try {
946                Type t = this.getField(12, rep);
947                ret = (CE)t;
948            } catch (ClassCastException cce) {
949                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
950                throw new RuntimeException(cce);
951            } catch (HL7Exception he) {
952                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
953                throw new RuntimeException(he);
954            }
955            return ret;
956        }
957    
958    
959        /**
960         * Returns a count of the current number of repetitions of Randomized Study Arm (CSR-12).
961         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
962         * it will return zero.
963         */
964        public int getCsr12_RandomizedStudyArmReps() {
965            CE[] ret = null;
966            try {
967                Type[] t = this.getField(12);
968                return t.length;  
969            } catch (ClassCastException cce) {
970                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
971                throw new RuntimeException(cce);
972            } catch (HL7Exception he) {
973                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
974                throw new RuntimeException(he);
975            }
976        }
977    
978    
979    
980        /**
981         * Inserts a repetition of
982         * CSR-12: "Randomized Study Arm" at a specific index
983         *
984         * @param rep The repetition index (0-indexed)
985         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
986         */
987        public CE insertRandomizedStudyArm(int rep) throws HL7Exception { 
988            return (CE) super.insertRepetition(12, rep);
989        }
990    
991    
992    
993        /**
994         * Inserts a repetition of
995         * CSR-12: "Randomized Study Arm" at a specific index
996         *
997         * @param rep The repetition index (0-indexed)
998         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
999         */
1000        public CE insertCsr12_RandomizedStudyArm(int rep) throws HL7Exception { 
1001            return (CE) super.insertRepetition(12, rep);
1002        }
1003    
1004    
1005        /**
1006         * Removes a repetition of
1007         * CSR-12: "Randomized Study Arm" at a specific index
1008         *
1009         * @param rep The repetition index (0-indexed)
1010         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1011         */
1012        public CE removeRandomizedStudyArm(int rep) throws HL7Exception { 
1013            return (CE) super.removeRepetition(12, rep);
1014        }
1015    
1016    
1017        /**
1018         * Removes a repetition of
1019         * CSR-12: "Randomized Study Arm" at a specific index
1020         *
1021         * @param rep The repetition index (0-indexed)
1022         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1023         */
1024        public CE removeCsr12_RandomizedStudyArm(int rep) throws HL7Exception { 
1025            return (CE) super.removeRepetition(12, rep);
1026        }
1027    
1028    
1029    
1030        /**
1031         * Returns all repetitions of Stratum for Study Randomization (CSR-13).
1032         */
1033        public CE[] getStratumForStudyRandomization() {
1034            CE[] ret = null;
1035            try {
1036                Type[] t = this.getField(13);  
1037                ret = new CE[t.length];
1038                for (int i = 0; i < ret.length; i++) {
1039                    ret[i] = (CE)t[i];
1040                }
1041            } catch (ClassCastException cce) {
1042                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1043                throw new RuntimeException(cce);
1044            } catch (HL7Exception he) {
1045                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1046                throw new RuntimeException(he);
1047            }
1048            return ret;
1049        }
1050    
1051    
1052        /**
1053         * Returns a count of the current number of repetitions of Stratum for Study Randomization (CSR-13).
1054         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1055         * it will return zero.
1056         */
1057        public int getStratumForStudyRandomizationReps() {
1058            CE[] ret = null;
1059            try {
1060                Type[] t = this.getField(13);
1061                return t.length;  
1062            } catch (ClassCastException cce) {
1063                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1064                throw new RuntimeException(cce);
1065            } catch (HL7Exception he) {
1066                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1067                throw new RuntimeException(he);
1068            }
1069        }
1070    
1071    
1072        /**
1073         * Returns a specific repetition of
1074         * CSR-13: "Stratum for Study Randomization" - creates it if necessary
1075         *
1076         * @param rep The repetition index (0-indexed)
1077         */
1078        public CE getStratumForStudyRandomization(int rep) { 
1079            CE ret = null;
1080            try {
1081                Type t = this.getField(13, rep);
1082                ret = (CE)t;
1083            } catch (ClassCastException cce) {
1084                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1085                throw new RuntimeException(cce);
1086            } catch (HL7Exception he) {
1087                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1088                throw new RuntimeException(he);
1089            }
1090            return ret;
1091        }
1092    
1093        /**
1094         * Returns a specific repetition of
1095         * CSR-13: "Stratum for Study Randomization" - creates it if necessary
1096         *
1097         * @param rep The repetition index (0-indexed)
1098         */
1099        public CE getCsr13_StratumForStudyRandomization(int rep) { 
1100            CE ret = null;
1101            try {
1102                Type t = this.getField(13, rep);
1103                ret = (CE)t;
1104            } catch (ClassCastException cce) {
1105                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1106                throw new RuntimeException(cce);
1107            } catch (HL7Exception he) {
1108                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1109                throw new RuntimeException(he);
1110            }
1111            return ret;
1112        }
1113    
1114    
1115        /**
1116         * Returns a count of the current number of repetitions of Stratum for Study Randomization (CSR-13).
1117         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1118         * it will return zero.
1119         */
1120        public int getCsr13_StratumForStudyRandomizationReps() {
1121            CE[] ret = null;
1122            try {
1123                Type[] t = this.getField(13);
1124                return t.length;  
1125            } catch (ClassCastException cce) {
1126                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1127                throw new RuntimeException(cce);
1128            } catch (HL7Exception he) {
1129                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1130                throw new RuntimeException(he);
1131            }
1132        }
1133    
1134    
1135    
1136        /**
1137         * Inserts a repetition of
1138         * CSR-13: "Stratum for Study Randomization" at a specific index
1139         *
1140         * @param rep The repetition index (0-indexed)
1141         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1142         */
1143        public CE insertStratumForStudyRandomization(int rep) throws HL7Exception { 
1144            return (CE) super.insertRepetition(13, rep);
1145        }
1146    
1147    
1148    
1149        /**
1150         * Inserts a repetition of
1151         * CSR-13: "Stratum for Study Randomization" at a specific index
1152         *
1153         * @param rep The repetition index (0-indexed)
1154         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1155         */
1156        public CE insertCsr13_StratumForStudyRandomization(int rep) throws HL7Exception { 
1157            return (CE) super.insertRepetition(13, rep);
1158        }
1159    
1160    
1161        /**
1162         * Removes a repetition of
1163         * CSR-13: "Stratum for Study Randomization" at a specific index
1164         *
1165         * @param rep The repetition index (0-indexed)
1166         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1167         */
1168        public CE removeStratumForStudyRandomization(int rep) throws HL7Exception { 
1169            return (CE) super.removeRepetition(13, rep);
1170        }
1171    
1172    
1173        /**
1174         * Removes a repetition of
1175         * CSR-13: "Stratum for Study Randomization" at a specific index
1176         *
1177         * @param rep The repetition index (0-indexed)
1178         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1179         */
1180        public CE removeCsr13_StratumForStudyRandomization(int rep) throws HL7Exception { 
1181            return (CE) super.removeRepetition(13, rep);
1182        }
1183    
1184    
1185    
1186    
1187        /**
1188         * Returns
1189         * CSR-14: "Patient Evaluability Status" - creates it if necessary
1190         */
1191        public CE getPatientEvaluabilityStatus() { 
1192            CE ret = null;
1193            try {
1194                Type t = this.getField(14, 0);
1195                ret = (CE)t;
1196            } catch (ClassCastException cce) {
1197                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1198                throw new RuntimeException(cce);
1199            } catch (HL7Exception he) {
1200                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1201                throw new RuntimeException(he);
1202            }
1203            return ret;
1204        }
1205    
1206    
1207        /**
1208         * Returns
1209         * CSR-14: "Patient Evaluability Status" - creates it if necessary
1210         */
1211        public CE getCsr14_PatientEvaluabilityStatus() { 
1212            CE ret = null;
1213            try {
1214                Type t = this.getField(14, 0);
1215                ret = (CE)t;
1216            } catch (ClassCastException cce) {
1217                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1218                throw new RuntimeException(cce);
1219            } catch (HL7Exception he) {
1220                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1221                throw new RuntimeException(he);
1222            }
1223            return ret;
1224        }
1225    
1226    
1227    
1228        /**
1229         * Returns
1230         * CSR-15: "Date/time Ended Study" - creates it if necessary
1231         */
1232        public TS getDateTimeEndedStudy() { 
1233            TS ret = null;
1234            try {
1235                Type t = this.getField(15, 0);
1236                ret = (TS)t;
1237            } catch (ClassCastException cce) {
1238                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1239                throw new RuntimeException(cce);
1240            } catch (HL7Exception he) {
1241                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1242                throw new RuntimeException(he);
1243            }
1244            return ret;
1245        }
1246    
1247    
1248        /**
1249         * Returns
1250         * CSR-15: "Date/time Ended Study" - creates it if necessary
1251         */
1252        public TS getCsr15_DateTimeEndedStudy() { 
1253            TS ret = null;
1254            try {
1255                Type t = this.getField(15, 0);
1256                ret = (TS)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        /**
1270         * Returns
1271         * CSR-16: "Reason Ended Study" - creates it if necessary
1272         */
1273        public CE getReasonEndedStudy() { 
1274            CE ret = null;
1275            try {
1276                Type t = this.getField(16, 0);
1277                ret = (CE)t;
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            return ret;
1286        }
1287    
1288    
1289        /**
1290         * Returns
1291         * CSR-16: "Reason Ended Study" - creates it if necessary
1292         */
1293        public CE getCsr16_ReasonEndedStudy() { 
1294            CE ret = null;
1295            try {
1296                Type t = this.getField(16, 0);
1297                ret = (CE)t;
1298            } catch (ClassCastException cce) {
1299                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1300                throw new RuntimeException(cce);
1301            } catch (HL7Exception he) {
1302                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1303                throw new RuntimeException(he);
1304            }
1305            return ret;
1306        }
1307    
1308    
1309    
1310    
1311    
1312        /** {@inheritDoc} */   
1313        protected Type createNewTypeWithoutReflection(int field) {
1314           switch (field) {
1315              case 0: return new EI(getMessage());
1316              case 1: return new EI(getMessage());
1317              case 2: return new CE(getMessage());
1318              case 3: return new CX(getMessage());
1319              case 4: return new CX(getMessage());
1320              case 5: return new TS(getMessage());
1321              case 6: return new XCN(getMessage());
1322              case 7: return new XCN(getMessage());
1323              case 8: return new TS(getMessage());
1324              case 9: return new CE(getMessage());
1325              case 10: return new TS(getMessage());
1326              case 11: return new CE(getMessage());
1327              case 12: return new CE(getMessage());
1328              case 13: return new CE(getMessage());
1329              case 14: return new TS(getMessage());
1330              case 15: return new CE(getMessage());
1331              default: return null;
1332           }
1333       }
1334    
1335    
1336    }
1337