001/*
002 * This class is an auto-generated source file for a HAPI
003 * HL7 v2.x standard structure class.
004 *
005 * For more information, visit: http://hl7api.sourceforge.net/
006 * 
007 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033
034package ca.uhn.hl7v2.model.v25.segment;
035
036// import ca.uhn.hl7v2.model.v25.group.*;
037import ca.uhn.hl7v2.model.v25.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047
048/**
049 *<p>Represents an HL7 RF1 message segment (Referral Information). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>RF1-1: Referral Status (CE) <b>optional </b>
053     * <li>RF1-2: Referral Priority (CE) <b>optional </b>
054     * <li>RF1-3: Referral Type (CE) <b>optional </b>
055     * <li>RF1-4: Referral Disposition (CE) <b>optional repeating</b>
056     * <li>RF1-5: Referral Category (CE) <b>optional </b>
057     * <li>RF1-6: Originating Referral Identifier (EI) <b> </b>
058     * <li>RF1-7: Effective Date (TS) <b>optional </b>
059     * <li>RF1-8: Expiration Date (TS) <b>optional </b>
060     * <li>RF1-9: Process Date (TS) <b>optional </b>
061     * <li>RF1-10: Referral Reason (CE) <b>optional repeating</b>
062     * <li>RF1-11: External Referral Identifier (EI) <b>optional repeating</b>
063 * </ul>
064 */
065@SuppressWarnings("unused")
066public class RF1 extends AbstractSegment {
067
068    /** 
069     * Creates a new RF1 segment
070     */
071    public RF1(Group parent, ModelClassFactory factory) {
072       super(parent, factory);
073       init(factory);
074    }
075
076    private void init(ModelClassFactory factory) {
077       try {
078                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Referral Status");
079                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Referral Priority");
080                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Referral Type");
081                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Referral Disposition");
082                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Referral Category");
083                                  this.add(EI.class, true, 1, 30, new Object[]{ getMessage() }, "Originating Referral Identifier");
084                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Effective Date");
085                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Expiration Date");
086                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Process Date");
087                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Referral Reason");
088                                  this.add(EI.class, false, 0, 30, new Object[]{ getMessage() }, "External Referral Identifier");
089       } catch(HL7Exception e) {
090          log.error("Unexpected error creating RF1 - this is probably a bug in the source code generator.", e);
091       }
092    }
093
094
095
096    /**
097     * Returns
098     * RF1-1: "Referral Status" - creates it if necessary
099     */
100    public CE getReferralStatus() { 
101                CE retVal = this.getTypedField(1, 0);
102                return retVal;
103    }
104    
105    /**
106     * Returns
107     * RF1-1: "Referral Status" - creates it if necessary
108     */
109    public CE getRf11_ReferralStatus() { 
110                CE retVal = this.getTypedField(1, 0);
111                return retVal;
112    }
113
114
115
116    /**
117     * Returns
118     * RF1-2: "Referral Priority" - creates it if necessary
119     */
120    public CE getReferralPriority() { 
121                CE retVal = this.getTypedField(2, 0);
122                return retVal;
123    }
124    
125    /**
126     * Returns
127     * RF1-2: "Referral Priority" - creates it if necessary
128     */
129    public CE getRf12_ReferralPriority() { 
130                CE retVal = this.getTypedField(2, 0);
131                return retVal;
132    }
133
134
135
136    /**
137     * Returns
138     * RF1-3: "Referral Type" - creates it if necessary
139     */
140    public CE getReferralType() { 
141                CE retVal = this.getTypedField(3, 0);
142                return retVal;
143    }
144    
145    /**
146     * Returns
147     * RF1-3: "Referral Type" - creates it if necessary
148     */
149    public CE getRf13_ReferralType() { 
150                CE retVal = this.getTypedField(3, 0);
151                return retVal;
152    }
153
154
155    /**
156     * Returns all repetitions of Referral Disposition (RF1-4).
157     */
158    public CE[] getReferralDisposition() {
159        CE[] retVal = this.getTypedField(4, new CE[0]);
160        return retVal;
161    }
162
163
164    /**
165     * Returns all repetitions of Referral Disposition (RF1-4).
166     */
167    public CE[] getRf14_ReferralDisposition() {
168        CE[] retVal = this.getTypedField(4, new CE[0]);
169        return retVal;
170    }
171
172
173    /**
174     * Returns a count of the current number of repetitions of Referral Disposition (RF1-4).
175     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
176     * it will return zero.
177     */
178    public int getReferralDispositionReps() {
179        return this.getReps(4);
180    }
181
182
183    /**
184     * Returns a specific repetition of
185     * RF1-4: "Referral Disposition" - creates it if necessary
186     *
187     * @param rep The repetition index (0-indexed)
188     */
189    public CE getReferralDisposition(int rep) { 
190                CE retVal = this.getTypedField(4, rep);
191                return retVal;
192    }
193
194    /**
195     * Returns a specific repetition of
196     * RF1-4: "Referral Disposition" - creates it if necessary
197     *
198     * @param rep The repetition index (0-indexed)
199     */
200    public CE getRf14_ReferralDisposition(int rep) { 
201                CE retVal = this.getTypedField(4, rep);
202                return retVal;
203    }
204
205    /**
206     * Returns a count of the current number of repetitions of Referral Disposition (RF1-4).
207     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
208     * it will return zero.
209     */
210    public int getRf14_ReferralDispositionReps() {
211        return this.getReps(4);
212    }
213
214
215    /**
216     * Inserts a repetition of
217     * RF1-4: "Referral Disposition" at a specific index
218     *
219     * @param rep The repetition index (0-indexed)
220     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
221     */
222    public CE insertReferralDisposition(int rep) throws HL7Exception { 
223        return (CE) super.insertRepetition(4, rep);
224    }
225
226
227    /**
228     * Inserts a repetition of
229     * RF1-4: "Referral Disposition" at a specific index
230     *
231     * @param rep The repetition index (0-indexed)
232     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
233     */
234    public CE insertRf14_ReferralDisposition(int rep) throws HL7Exception { 
235        return (CE) super.insertRepetition(4, rep);
236    }
237
238
239    /**
240     * Removes a repetition of
241     * RF1-4: "Referral Disposition" at a specific index
242     *
243     * @param rep The repetition index (0-indexed)
244     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
245     */
246    public CE removeReferralDisposition(int rep) throws HL7Exception { 
247        return (CE) super.removeRepetition(4, rep);
248    }
249
250
251    /**
252     * Removes a repetition of
253     * RF1-4: "Referral Disposition" at a specific index
254     *
255     * @param rep The repetition index (0-indexed)
256     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
257     */
258    public CE removeRf14_ReferralDisposition(int rep) throws HL7Exception { 
259        return (CE) super.removeRepetition(4, rep);
260    }
261
262
263
264
265    /**
266     * Returns
267     * RF1-5: "Referral Category" - creates it if necessary
268     */
269    public CE getReferralCategory() { 
270                CE retVal = this.getTypedField(5, 0);
271                return retVal;
272    }
273    
274    /**
275     * Returns
276     * RF1-5: "Referral Category" - creates it if necessary
277     */
278    public CE getRf15_ReferralCategory() { 
279                CE retVal = this.getTypedField(5, 0);
280                return retVal;
281    }
282
283
284
285    /**
286     * Returns
287     * RF1-6: "Originating Referral Identifier" - creates it if necessary
288     */
289    public EI getOriginatingReferralIdentifier() { 
290                EI retVal = this.getTypedField(6, 0);
291                return retVal;
292    }
293    
294    /**
295     * Returns
296     * RF1-6: "Originating Referral Identifier" - creates it if necessary
297     */
298    public EI getRf16_OriginatingReferralIdentifier() { 
299                EI retVal = this.getTypedField(6, 0);
300                return retVal;
301    }
302
303
304
305    /**
306     * Returns
307     * RF1-7: "Effective Date" - creates it if necessary
308     */
309    public TS getEffectiveDate() { 
310                TS retVal = this.getTypedField(7, 0);
311                return retVal;
312    }
313    
314    /**
315     * Returns
316     * RF1-7: "Effective Date" - creates it if necessary
317     */
318    public TS getRf17_EffectiveDate() { 
319                TS retVal = this.getTypedField(7, 0);
320                return retVal;
321    }
322
323
324
325    /**
326     * Returns
327     * RF1-8: "Expiration Date" - creates it if necessary
328     */
329    public TS getExpirationDate() { 
330                TS retVal = this.getTypedField(8, 0);
331                return retVal;
332    }
333    
334    /**
335     * Returns
336     * RF1-8: "Expiration Date" - creates it if necessary
337     */
338    public TS getRf18_ExpirationDate() { 
339                TS retVal = this.getTypedField(8, 0);
340                return retVal;
341    }
342
343
344
345    /**
346     * Returns
347     * RF1-9: "Process Date" - creates it if necessary
348     */
349    public TS getProcessDate() { 
350                TS retVal = this.getTypedField(9, 0);
351                return retVal;
352    }
353    
354    /**
355     * Returns
356     * RF1-9: "Process Date" - creates it if necessary
357     */
358    public TS getRf19_ProcessDate() { 
359                TS retVal = this.getTypedField(9, 0);
360                return retVal;
361    }
362
363
364    /**
365     * Returns all repetitions of Referral Reason (RF1-10).
366     */
367    public CE[] getReferralReason() {
368        CE[] retVal = this.getTypedField(10, new CE[0]);
369        return retVal;
370    }
371
372
373    /**
374     * Returns all repetitions of Referral Reason (RF1-10).
375     */
376    public CE[] getRf110_ReferralReason() {
377        CE[] retVal = this.getTypedField(10, new CE[0]);
378        return retVal;
379    }
380
381
382    /**
383     * Returns a count of the current number of repetitions of Referral Reason (RF1-10).
384     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
385     * it will return zero.
386     */
387    public int getReferralReasonReps() {
388        return this.getReps(10);
389    }
390
391
392    /**
393     * Returns a specific repetition of
394     * RF1-10: "Referral Reason" - creates it if necessary
395     *
396     * @param rep The repetition index (0-indexed)
397     */
398    public CE getReferralReason(int rep) { 
399                CE retVal = this.getTypedField(10, rep);
400                return retVal;
401    }
402
403    /**
404     * Returns a specific repetition of
405     * RF1-10: "Referral Reason" - creates it if necessary
406     *
407     * @param rep The repetition index (0-indexed)
408     */
409    public CE getRf110_ReferralReason(int rep) { 
410                CE retVal = this.getTypedField(10, rep);
411                return retVal;
412    }
413
414    /**
415     * Returns a count of the current number of repetitions of Referral Reason (RF1-10).
416     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
417     * it will return zero.
418     */
419    public int getRf110_ReferralReasonReps() {
420        return this.getReps(10);
421    }
422
423
424    /**
425     * Inserts a repetition of
426     * RF1-10: "Referral Reason" at a specific index
427     *
428     * @param rep The repetition index (0-indexed)
429     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
430     */
431    public CE insertReferralReason(int rep) throws HL7Exception { 
432        return (CE) super.insertRepetition(10, rep);
433    }
434
435
436    /**
437     * Inserts a repetition of
438     * RF1-10: "Referral Reason" at a specific index
439     *
440     * @param rep The repetition index (0-indexed)
441     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
442     */
443    public CE insertRf110_ReferralReason(int rep) throws HL7Exception { 
444        return (CE) super.insertRepetition(10, rep);
445    }
446
447
448    /**
449     * Removes a repetition of
450     * RF1-10: "Referral Reason" at a specific index
451     *
452     * @param rep The repetition index (0-indexed)
453     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
454     */
455    public CE removeReferralReason(int rep) throws HL7Exception { 
456        return (CE) super.removeRepetition(10, rep);
457    }
458
459
460    /**
461     * Removes a repetition of
462     * RF1-10: "Referral Reason" at a specific index
463     *
464     * @param rep The repetition index (0-indexed)
465     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
466     */
467    public CE removeRf110_ReferralReason(int rep) throws HL7Exception { 
468        return (CE) super.removeRepetition(10, rep);
469    }
470
471
472
473    /**
474     * Returns all repetitions of External Referral Identifier (RF1-11).
475     */
476    public EI[] getExternalReferralIdentifier() {
477        EI[] retVal = this.getTypedField(11, new EI[0]);
478        return retVal;
479    }
480
481
482    /**
483     * Returns all repetitions of External Referral Identifier (RF1-11).
484     */
485    public EI[] getRf111_ExternalReferralIdentifier() {
486        EI[] retVal = this.getTypedField(11, new EI[0]);
487        return retVal;
488    }
489
490
491    /**
492     * Returns a count of the current number of repetitions of External Referral Identifier (RF1-11).
493     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
494     * it will return zero.
495     */
496    public int getExternalReferralIdentifierReps() {
497        return this.getReps(11);
498    }
499
500
501    /**
502     * Returns a specific repetition of
503     * RF1-11: "External Referral Identifier" - creates it if necessary
504     *
505     * @param rep The repetition index (0-indexed)
506     */
507    public EI getExternalReferralIdentifier(int rep) { 
508                EI retVal = this.getTypedField(11, rep);
509                return retVal;
510    }
511
512    /**
513     * Returns a specific repetition of
514     * RF1-11: "External Referral Identifier" - creates it if necessary
515     *
516     * @param rep The repetition index (0-indexed)
517     */
518    public EI getRf111_ExternalReferralIdentifier(int rep) { 
519                EI retVal = this.getTypedField(11, rep);
520                return retVal;
521    }
522
523    /**
524     * Returns a count of the current number of repetitions of External Referral Identifier (RF1-11).
525     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
526     * it will return zero.
527     */
528    public int getRf111_ExternalReferralIdentifierReps() {
529        return this.getReps(11);
530    }
531
532
533    /**
534     * Inserts a repetition of
535     * RF1-11: "External Referral Identifier" at a specific index
536     *
537     * @param rep The repetition index (0-indexed)
538     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
539     */
540    public EI insertExternalReferralIdentifier(int rep) throws HL7Exception { 
541        return (EI) super.insertRepetition(11, rep);
542    }
543
544
545    /**
546     * Inserts a repetition of
547     * RF1-11: "External Referral Identifier" at a specific index
548     *
549     * @param rep The repetition index (0-indexed)
550     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
551     */
552    public EI insertRf111_ExternalReferralIdentifier(int rep) throws HL7Exception { 
553        return (EI) super.insertRepetition(11, rep);
554    }
555
556
557    /**
558     * Removes a repetition of
559     * RF1-11: "External Referral Identifier" at a specific index
560     *
561     * @param rep The repetition index (0-indexed)
562     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
563     */
564    public EI removeExternalReferralIdentifier(int rep) throws HL7Exception { 
565        return (EI) super.removeRepetition(11, rep);
566    }
567
568
569    /**
570     * Removes a repetition of
571     * RF1-11: "External Referral Identifier" at a specific index
572     *
573     * @param rep The repetition index (0-indexed)
574     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
575     */
576    public EI removeRf111_ExternalReferralIdentifier(int rep) throws HL7Exception { 
577        return (EI) super.removeRepetition(11, rep);
578    }
579
580
581
582
583
584
585    /** {@inheritDoc} */   
586    protected Type createNewTypeWithoutReflection(int field) {
587       switch (field) {
588          case 0: return new CE(getMessage());
589          case 1: return new CE(getMessage());
590          case 2: return new CE(getMessage());
591          case 3: return new CE(getMessage());
592          case 4: return new CE(getMessage());
593          case 5: return new EI(getMessage());
594          case 6: return new TS(getMessage());
595          case 7: return new TS(getMessage());
596          case 8: return new TS(getMessage());
597          case 9: return new CE(getMessage());
598          case 10: return new EI(getMessage());
599          default: return null;
600       }
601   }
602
603
604}
605