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 AIP message segment (Appointment Information - Personnel Resource). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>AIP-1: Set ID - AIP (SI) <b> </b>
027         * <li>AIP-2: Segment Action Code (ID) <b>optional </b>
028         * <li>AIP-3: Personnel Resource ID (XCN) <b>optional repeating</b>
029         * <li>AIP-4: Resource Role (CE) <b> </b>
030         * <li>AIP-5: Resource Group (CE) <b>optional </b>
031         * <li>AIP-6: Start Date/Time (TS) <b>optional </b>
032         * <li>AIP-7: Start Date/Time Offset (NM) <b>optional </b>
033         * <li>AIP-8: Start Date/Time Offset Units (CE) <b>optional </b>
034         * <li>AIP-9: Duration (NM) <b>optional </b>
035         * <li>AIP-10: Duration Units (CE) <b>optional </b>
036         * <li>AIP-11: Allow Substitution Code (IS) <b>optional </b>
037         * <li>AIP-12: Filler Status Code (CE) <b>optional </b>
038     * </ul>
039     */
040    public class AIP extends AbstractSegment {
041    
042        /** 
043         * Creates a new AIP segment
044         */
045        public AIP(Group parent, ModelClassFactory factory) {
046           super(parent, factory);
047           init(factory);
048        }
049    
050        private void init(ModelClassFactory factory) {
051           try {
052                                      this.add(SI.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - AIP");
053                                      this.add(ID.class, false, 1, 3, new Object[]{ getMessage() }, "Segment Action Code");
054                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Personnel Resource ID");
055                                      this.add(CE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Resource Role");
056                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Resource Group");
057                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Start Date/Time");
058                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Start Date/Time Offset");
059                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Start Date/Time Offset Units");
060                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Duration");
061                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Duration Units");
062                                      this.add(IS.class, false, 1, 10, new Object[]{ getMessage() }, "Allow Substitution Code");
063                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(278) }, "Filler Status Code");
064           } catch(HL7Exception e) {
065              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating AIP - this is probably a bug in the source code generator.", e);
066           }
067        }
068    
069    
070    
071        /**
072         * Returns
073         * AIP-1: "Set ID - AIP" - creates it if necessary
074         */
075        public SI getSetIDAIP() { 
076            SI ret = null;
077            try {
078                Type t = this.getField(1, 0);
079                ret = (SI)t;
080            } catch (ClassCastException cce) {
081                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
082                throw new RuntimeException(cce);
083            } catch (HL7Exception he) {
084                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
085                throw new RuntimeException(he);
086            }
087            return ret;
088        }
089    
090    
091        /**
092         * Returns
093         * AIP-1: "Set ID - AIP" - creates it if necessary
094         */
095        public SI getAip1_SetIDAIP() { 
096            SI ret = null;
097            try {
098                Type t = this.getField(1, 0);
099                ret = (SI)t;
100            } catch (ClassCastException cce) {
101                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
102                throw new RuntimeException(cce);
103            } catch (HL7Exception he) {
104                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
105                throw new RuntimeException(he);
106            }
107            return ret;
108        }
109    
110    
111    
112        /**
113         * Returns
114         * AIP-2: "Segment Action Code" - creates it if necessary
115         */
116        public ID getSegmentActionCode() { 
117            ID ret = null;
118            try {
119                Type t = this.getField(2, 0);
120                ret = (ID)t;
121            } catch (ClassCastException cce) {
122                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
123                throw new RuntimeException(cce);
124            } catch (HL7Exception he) {
125                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
126                throw new RuntimeException(he);
127            }
128            return ret;
129        }
130    
131    
132        /**
133         * Returns
134         * AIP-2: "Segment Action Code" - creates it if necessary
135         */
136        public ID getAip2_SegmentActionCode() { 
137            ID ret = null;
138            try {
139                Type t = this.getField(2, 0);
140                ret = (ID)t;
141            } catch (ClassCastException cce) {
142                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
143                throw new RuntimeException(cce);
144            } catch (HL7Exception he) {
145                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
146                throw new RuntimeException(he);
147            }
148            return ret;
149        }
150    
151    
152        /**
153         * Returns all repetitions of Personnel Resource ID (AIP-3).
154         */
155        public XCN[] getPersonnelResourceID() {
156            XCN[] ret = null;
157            try {
158                Type[] t = this.getField(3);  
159                ret = new XCN[t.length];
160                for (int i = 0; i < ret.length; i++) {
161                    ret[i] = (XCN)t[i];
162                }
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         * Returns a count of the current number of repetitions of Personnel Resource ID (AIP-3).
176         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
177         * it will return zero.
178         */
179        public int getPersonnelResourceIDReps() {
180            XCN[] ret = null;
181            try {
182                Type[] t = this.getField(3);
183                return t.length;  
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        }
192    
193    
194        /**
195         * Returns a specific repetition of
196         * AIP-3: "Personnel Resource ID" - creates it if necessary
197         *
198         * @param rep The repetition index (0-indexed)
199         */
200        public XCN getPersonnelResourceID(int rep) { 
201            XCN ret = null;
202            try {
203                Type t = this.getField(3, rep);
204                ret = (XCN)t;
205            } catch (ClassCastException cce) {
206                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
207                throw new RuntimeException(cce);
208            } catch (HL7Exception he) {
209                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
210                throw new RuntimeException(he);
211            }
212            return ret;
213        }
214    
215        /**
216         * Returns a specific repetition of
217         * AIP-3: "Personnel Resource ID" - creates it if necessary
218         *
219         * @param rep The repetition index (0-indexed)
220         */
221        public XCN getAip3_PersonnelResourceID(int rep) { 
222            XCN ret = null;
223            try {
224                Type t = this.getField(3, rep);
225                ret = (XCN)t;
226            } catch (ClassCastException cce) {
227                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
228                throw new RuntimeException(cce);
229            } catch (HL7Exception he) {
230                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
231                throw new RuntimeException(he);
232            }
233            return ret;
234        }
235    
236    
237        /**
238         * Returns a count of the current number of repetitions of Personnel Resource ID (AIP-3).
239         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
240         * it will return zero.
241         */
242        public int getAip3_PersonnelResourceIDReps() {
243            XCN[] ret = null;
244            try {
245                Type[] t = this.getField(3);
246                return t.length;  
247            } catch (ClassCastException cce) {
248                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
249                throw new RuntimeException(cce);
250            } catch (HL7Exception he) {
251                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
252                throw new RuntimeException(he);
253            }
254        }
255    
256    
257    
258        /**
259         * Inserts a repetition of
260         * AIP-3: "Personnel Resource ID" at a specific index
261         *
262         * @param rep The repetition index (0-indexed)
263         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
264         */
265        public XCN insertPersonnelResourceID(int rep) throws HL7Exception { 
266            return (XCN) super.insertRepetition(3, rep);
267        }
268    
269    
270    
271        /**
272         * Inserts a repetition of
273         * AIP-3: "Personnel Resource ID" at a specific index
274         *
275         * @param rep The repetition index (0-indexed)
276         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
277         */
278        public XCN insertAip3_PersonnelResourceID(int rep) throws HL7Exception { 
279            return (XCN) super.insertRepetition(3, rep);
280        }
281    
282    
283        /**
284         * Removes a repetition of
285         * AIP-3: "Personnel Resource ID" at a specific index
286         *
287         * @param rep The repetition index (0-indexed)
288         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
289         */
290        public XCN removePersonnelResourceID(int rep) throws HL7Exception { 
291            return (XCN) super.removeRepetition(3, rep);
292        }
293    
294    
295        /**
296         * Removes a repetition of
297         * AIP-3: "Personnel Resource ID" at a specific index
298         *
299         * @param rep The repetition index (0-indexed)
300         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
301         */
302        public XCN removeAip3_PersonnelResourceID(int rep) throws HL7Exception { 
303            return (XCN) super.removeRepetition(3, rep);
304        }
305    
306    
307    
308    
309        /**
310         * Returns
311         * AIP-4: "Resource Role" - creates it if necessary
312         */
313        public CE getResourceRole() { 
314            CE ret = null;
315            try {
316                Type t = this.getField(4, 0);
317                ret = (CE)t;
318            } catch (ClassCastException cce) {
319                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
320                throw new RuntimeException(cce);
321            } catch (HL7Exception he) {
322                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
323                throw new RuntimeException(he);
324            }
325            return ret;
326        }
327    
328    
329        /**
330         * Returns
331         * AIP-4: "Resource Role" - creates it if necessary
332         */
333        public CE getAip4_ResourceRole() { 
334            CE ret = null;
335            try {
336                Type t = this.getField(4, 0);
337                ret = (CE)t;
338            } catch (ClassCastException cce) {
339                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
340                throw new RuntimeException(cce);
341            } catch (HL7Exception he) {
342                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
343                throw new RuntimeException(he);
344            }
345            return ret;
346        }
347    
348    
349    
350        /**
351         * Returns
352         * AIP-5: "Resource Group" - creates it if necessary
353         */
354        public CE getResourceGroup() { 
355            CE ret = null;
356            try {
357                Type t = this.getField(5, 0);
358                ret = (CE)t;
359            } catch (ClassCastException cce) {
360                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
361                throw new RuntimeException(cce);
362            } catch (HL7Exception he) {
363                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
364                throw new RuntimeException(he);
365            }
366            return ret;
367        }
368    
369    
370        /**
371         * Returns
372         * AIP-5: "Resource Group" - creates it if necessary
373         */
374        public CE getAip5_ResourceGroup() { 
375            CE ret = null;
376            try {
377                Type t = this.getField(5, 0);
378                ret = (CE)t;
379            } catch (ClassCastException cce) {
380                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
381                throw new RuntimeException(cce);
382            } catch (HL7Exception he) {
383                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
384                throw new RuntimeException(he);
385            }
386            return ret;
387        }
388    
389    
390    
391        /**
392         * Returns
393         * AIP-6: "Start Date/Time" - creates it if necessary
394         */
395        public TS getStartDateTime() { 
396            TS ret = null;
397            try {
398                Type t = this.getField(6, 0);
399                ret = (TS)t;
400            } catch (ClassCastException cce) {
401                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
402                throw new RuntimeException(cce);
403            } catch (HL7Exception he) {
404                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
405                throw new RuntimeException(he);
406            }
407            return ret;
408        }
409    
410    
411        /**
412         * Returns
413         * AIP-6: "Start Date/Time" - creates it if necessary
414         */
415        public TS getAip6_StartDateTime() { 
416            TS ret = null;
417            try {
418                Type t = this.getField(6, 0);
419                ret = (TS)t;
420            } catch (ClassCastException cce) {
421                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
422                throw new RuntimeException(cce);
423            } catch (HL7Exception he) {
424                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
425                throw new RuntimeException(he);
426            }
427            return ret;
428        }
429    
430    
431    
432        /**
433         * Returns
434         * AIP-7: "Start Date/Time Offset" - creates it if necessary
435         */
436        public NM getStartDateTimeOffset() { 
437            NM ret = null;
438            try {
439                Type t = this.getField(7, 0);
440                ret = (NM)t;
441            } catch (ClassCastException cce) {
442                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
443                throw new RuntimeException(cce);
444            } catch (HL7Exception he) {
445                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
446                throw new RuntimeException(he);
447            }
448            return ret;
449        }
450    
451    
452        /**
453         * Returns
454         * AIP-7: "Start Date/Time Offset" - creates it if necessary
455         */
456        public NM getAip7_StartDateTimeOffset() { 
457            NM ret = null;
458            try {
459                Type t = this.getField(7, 0);
460                ret = (NM)t;
461            } catch (ClassCastException cce) {
462                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
463                throw new RuntimeException(cce);
464            } catch (HL7Exception he) {
465                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
466                throw new RuntimeException(he);
467            }
468            return ret;
469        }
470    
471    
472    
473        /**
474         * Returns
475         * AIP-8: "Start Date/Time Offset Units" - creates it if necessary
476         */
477        public CE getStartDateTimeOffsetUnits() { 
478            CE ret = null;
479            try {
480                Type t = this.getField(8, 0);
481                ret = (CE)t;
482            } catch (ClassCastException cce) {
483                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
484                throw new RuntimeException(cce);
485            } catch (HL7Exception he) {
486                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
487                throw new RuntimeException(he);
488            }
489            return ret;
490        }
491    
492    
493        /**
494         * Returns
495         * AIP-8: "Start Date/Time Offset Units" - creates it if necessary
496         */
497        public CE getAip8_StartDateTimeOffsetUnits() { 
498            CE ret = null;
499            try {
500                Type t = this.getField(8, 0);
501                ret = (CE)t;
502            } catch (ClassCastException cce) {
503                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
504                throw new RuntimeException(cce);
505            } catch (HL7Exception he) {
506                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
507                throw new RuntimeException(he);
508            }
509            return ret;
510        }
511    
512    
513    
514        /**
515         * Returns
516         * AIP-9: "Duration" - creates it if necessary
517         */
518        public NM getDuration() { 
519            NM ret = null;
520            try {
521                Type t = this.getField(9, 0);
522                ret = (NM)t;
523            } catch (ClassCastException cce) {
524                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
525                throw new RuntimeException(cce);
526            } catch (HL7Exception he) {
527                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
528                throw new RuntimeException(he);
529            }
530            return ret;
531        }
532    
533    
534        /**
535         * Returns
536         * AIP-9: "Duration" - creates it if necessary
537         */
538        public NM getAip9_Duration() { 
539            NM ret = null;
540            try {
541                Type t = this.getField(9, 0);
542                ret = (NM)t;
543            } catch (ClassCastException cce) {
544                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
545                throw new RuntimeException(cce);
546            } catch (HL7Exception he) {
547                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
548                throw new RuntimeException(he);
549            }
550            return ret;
551        }
552    
553    
554    
555        /**
556         * Returns
557         * AIP-10: "Duration Units" - creates it if necessary
558         */
559        public CE getDurationUnits() { 
560            CE ret = null;
561            try {
562                Type t = this.getField(10, 0);
563                ret = (CE)t;
564            } catch (ClassCastException cce) {
565                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
566                throw new RuntimeException(cce);
567            } catch (HL7Exception he) {
568                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
569                throw new RuntimeException(he);
570            }
571            return ret;
572        }
573    
574    
575        /**
576         * Returns
577         * AIP-10: "Duration Units" - creates it if necessary
578         */
579        public CE getAip10_DurationUnits() { 
580            CE ret = null;
581            try {
582                Type t = this.getField(10, 0);
583                ret = (CE)t;
584            } catch (ClassCastException cce) {
585                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
586                throw new RuntimeException(cce);
587            } catch (HL7Exception he) {
588                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
589                throw new RuntimeException(he);
590            }
591            return ret;
592        }
593    
594    
595    
596        /**
597         * Returns
598         * AIP-11: "Allow Substitution Code" - creates it if necessary
599         */
600        public IS getAllowSubstitutionCode() { 
601            IS ret = null;
602            try {
603                Type t = this.getField(11, 0);
604                ret = (IS)t;
605            } catch (ClassCastException cce) {
606                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
607                throw new RuntimeException(cce);
608            } catch (HL7Exception he) {
609                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
610                throw new RuntimeException(he);
611            }
612            return ret;
613        }
614    
615    
616        /**
617         * Returns
618         * AIP-11: "Allow Substitution Code" - creates it if necessary
619         */
620        public IS getAip11_AllowSubstitutionCode() { 
621            IS ret = null;
622            try {
623                Type t = this.getField(11, 0);
624                ret = (IS)t;
625            } catch (ClassCastException cce) {
626                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
627                throw new RuntimeException(cce);
628            } catch (HL7Exception he) {
629                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
630                throw new RuntimeException(he);
631            }
632            return ret;
633        }
634    
635    
636    
637        /**
638         * Returns
639         * AIP-12: "Filler Status Code" - creates it if necessary
640         */
641        public CE getFillerStatusCode() { 
642            CE ret = null;
643            try {
644                Type t = this.getField(12, 0);
645                ret = (CE)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         * AIP-12: "Filler Status Code" - creates it if necessary
660         */
661        public CE getAip12_FillerStatusCode() { 
662            CE ret = null;
663            try {
664                Type t = this.getField(12, 0);
665                ret = (CE)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    
680        /** {@inheritDoc} */   
681        protected Type createNewTypeWithoutReflection(int field) {
682           switch (field) {
683              case 0: return new SI(getMessage());
684              case 1: return new ID(getMessage(), new Integer( 206 ));
685              case 2: return new XCN(getMessage());
686              case 3: return new CE(getMessage());
687              case 4: return new CE(getMessage());
688              case 5: return new TS(getMessage());
689              case 6: return new NM(getMessage());
690              case 7: return new CE(getMessage());
691              case 8: return new NM(getMessage());
692              case 9: return new CE(getMessage());
693              case 10: return new IS(getMessage(), new Integer( 279 ));
694              case 11: return new CE(getMessage());
695              default: return null;
696           }
697       }
698    
699    
700    }
701