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.v26.segment;
035
036// import ca.uhn.hl7v2.model.v26.group.*;
037import ca.uhn.hl7v2.model.v26.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047/**
048 *<p>Represents an HL7 RF1 message segment (Referral Information). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>RF1-1: Referral Status (CWE) <b>optional </b>
052     * <li>RF1-2: Referral Priority (CWE) <b>optional </b>
053     * <li>RF1-3: Referral Type (CWE) <b>optional </b>
054     * <li>RF1-4: Referral Disposition (CWE) <b>optional repeating</b>
055     * <li>RF1-5: Referral Category (CWE) <b>optional </b>
056     * <li>RF1-6: Originating Referral Identifier (EI) <b> </b>
057     * <li>RF1-7: Effective Date (DTM) <b>optional </b>
058     * <li>RF1-8: Expiration Date (DTM) <b>optional </b>
059     * <li>RF1-9: Process Date (DTM) <b>optional </b>
060     * <li>RF1-10: Referral Reason (CWE) <b>optional repeating</b>
061     * <li>RF1-11: External Referral Identifier (EI) <b>optional repeating</b>
062     * <li>RF1-12: Referral Documentation Completion Status (CWE) <b>optional </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(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Referral Status");
079                                  this.add(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Referral Priority");
080                                  this.add(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Referral Type");
081                                  this.add(CWE.class, false, 0, 705, new Object[]{ getMessage() }, "Referral Disposition");
082                                  this.add(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Referral Category");
083                                  this.add(EI.class, true, 1, 30, new Object[]{ getMessage() }, "Originating Referral Identifier");
084                                  this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Effective Date");
085                                  this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Expiration Date");
086                                  this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Process Date");
087                                  this.add(CWE.class, false, 0, 705, new Object[]{ getMessage() }, "Referral Reason");
088                                  this.add(EI.class, false, 0, 30, new Object[]{ getMessage() }, "External Referral Identifier");
089                                  this.add(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Referral Documentation Completion Status");
090       } catch(HL7Exception e) {
091          log.error("Unexpected error creating RF1 - this is probably a bug in the source code generator.", e);
092       }
093    }
094
095
096
097    /**
098     * Returns
099     * RF1-1: "Referral Status" - creates it if necessary
100     */
101    public CWE getReferralStatus() { 
102                CWE retVal = this.getTypedField(1, 0);
103                return retVal;
104    }
105    
106    /**
107     * Returns
108     * RF1-1: "Referral Status" - creates it if necessary
109     */
110    public CWE getRf11_ReferralStatus() { 
111                CWE retVal = this.getTypedField(1, 0);
112                return retVal;
113    }
114
115
116
117    /**
118     * Returns
119     * RF1-2: "Referral Priority" - creates it if necessary
120     */
121    public CWE getReferralPriority() { 
122                CWE retVal = this.getTypedField(2, 0);
123                return retVal;
124    }
125    
126    /**
127     * Returns
128     * RF1-2: "Referral Priority" - creates it if necessary
129     */
130    public CWE getRf12_ReferralPriority() { 
131                CWE retVal = this.getTypedField(2, 0);
132                return retVal;
133    }
134
135
136
137    /**
138     * Returns
139     * RF1-3: "Referral Type" - creates it if necessary
140     */
141    public CWE getReferralType() { 
142                CWE retVal = this.getTypedField(3, 0);
143                return retVal;
144    }
145    
146    /**
147     * Returns
148     * RF1-3: "Referral Type" - creates it if necessary
149     */
150    public CWE getRf13_ReferralType() { 
151                CWE retVal = this.getTypedField(3, 0);
152                return retVal;
153    }
154
155
156    /**
157     * Returns all repetitions of Referral Disposition (RF1-4).
158     */
159    public CWE[] getReferralDisposition() {
160        CWE[] retVal = this.getTypedField(4, new CWE[0]);
161        return retVal;
162    }
163
164
165    /**
166     * Returns all repetitions of Referral Disposition (RF1-4).
167     */
168    public CWE[] getRf14_ReferralDisposition() {
169        CWE[] retVal = this.getTypedField(4, new CWE[0]);
170        return retVal;
171    }
172
173
174    /**
175     * Returns a count of the current number of repetitions of Referral Disposition (RF1-4).
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 getReferralDispositionReps() {
180        return this.getReps(4);
181    }
182
183
184    /**
185     * Returns a specific repetition of
186     * RF1-4: "Referral Disposition" - creates it if necessary
187     *
188     * @param rep The repetition index (0-indexed)
189     */
190    public CWE getReferralDisposition(int rep) { 
191                CWE retVal = this.getTypedField(4, rep);
192                return retVal;
193    }
194
195    /**
196     * Returns a specific repetition of
197     * RF1-4: "Referral Disposition" - creates it if necessary
198     *
199     * @param rep The repetition index (0-indexed)
200     */
201    public CWE getRf14_ReferralDisposition(int rep) { 
202                CWE retVal = this.getTypedField(4, rep);
203                return retVal;
204    }
205
206    /**
207     * Returns a count of the current number of repetitions of Referral Disposition (RF1-4).
208     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
209     * it will return zero.
210     */
211    public int getRf14_ReferralDispositionReps() {
212        return this.getReps(4);
213    }
214
215
216    /**
217     * Inserts a repetition of
218     * RF1-4: "Referral Disposition" at a specific index
219     *
220     * @param rep The repetition index (0-indexed)
221     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
222     */
223    public CWE insertReferralDisposition(int rep) throws HL7Exception { 
224        return (CWE) super.insertRepetition(4, rep);
225    }
226
227
228    /**
229     * Inserts a repetition of
230     * RF1-4: "Referral Disposition" at a specific index
231     *
232     * @param rep The repetition index (0-indexed)
233     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
234     */
235    public CWE insertRf14_ReferralDisposition(int rep) throws HL7Exception { 
236        return (CWE) super.insertRepetition(4, rep);
237    }
238
239
240    /**
241     * Removes a repetition of
242     * RF1-4: "Referral Disposition" at a specific index
243     *
244     * @param rep The repetition index (0-indexed)
245     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
246     */
247    public CWE removeReferralDisposition(int rep) throws HL7Exception { 
248        return (CWE) super.removeRepetition(4, rep);
249    }
250
251
252    /**
253     * Removes a repetition of
254     * RF1-4: "Referral Disposition" at a specific index
255     *
256     * @param rep The repetition index (0-indexed)
257     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
258     */
259    public CWE removeRf14_ReferralDisposition(int rep) throws HL7Exception { 
260        return (CWE) super.removeRepetition(4, rep);
261    }
262
263
264
265
266    /**
267     * Returns
268     * RF1-5: "Referral Category" - creates it if necessary
269     */
270    public CWE getReferralCategory() { 
271                CWE retVal = this.getTypedField(5, 0);
272                return retVal;
273    }
274    
275    /**
276     * Returns
277     * RF1-5: "Referral Category" - creates it if necessary
278     */
279    public CWE getRf15_ReferralCategory() { 
280                CWE retVal = this.getTypedField(5, 0);
281                return retVal;
282    }
283
284
285
286    /**
287     * Returns
288     * RF1-6: "Originating Referral Identifier" - creates it if necessary
289     */
290    public EI getOriginatingReferralIdentifier() { 
291                EI retVal = this.getTypedField(6, 0);
292                return retVal;
293    }
294    
295    /**
296     * Returns
297     * RF1-6: "Originating Referral Identifier" - creates it if necessary
298     */
299    public EI getRf16_OriginatingReferralIdentifier() { 
300                EI retVal = this.getTypedField(6, 0);
301                return retVal;
302    }
303
304
305
306    /**
307     * Returns
308     * RF1-7: "Effective Date" - creates it if necessary
309     */
310    public DTM getEffectiveDate() { 
311                DTM retVal = this.getTypedField(7, 0);
312                return retVal;
313    }
314    
315    /**
316     * Returns
317     * RF1-7: "Effective Date" - creates it if necessary
318     */
319    public DTM getRf17_EffectiveDate() { 
320                DTM retVal = this.getTypedField(7, 0);
321                return retVal;
322    }
323
324
325
326    /**
327     * Returns
328     * RF1-8: "Expiration Date" - creates it if necessary
329     */
330    public DTM getExpirationDate() { 
331                DTM retVal = this.getTypedField(8, 0);
332                return retVal;
333    }
334    
335    /**
336     * Returns
337     * RF1-8: "Expiration Date" - creates it if necessary
338     */
339    public DTM getRf18_ExpirationDate() { 
340                DTM retVal = this.getTypedField(8, 0);
341                return retVal;
342    }
343
344
345
346    /**
347     * Returns
348     * RF1-9: "Process Date" - creates it if necessary
349     */
350    public DTM getProcessDate() { 
351                DTM retVal = this.getTypedField(9, 0);
352                return retVal;
353    }
354    
355    /**
356     * Returns
357     * RF1-9: "Process Date" - creates it if necessary
358     */
359    public DTM getRf19_ProcessDate() { 
360                DTM retVal = this.getTypedField(9, 0);
361                return retVal;
362    }
363
364
365    /**
366     * Returns all repetitions of Referral Reason (RF1-10).
367     */
368    public CWE[] getReferralReason() {
369        CWE[] retVal = this.getTypedField(10, new CWE[0]);
370        return retVal;
371    }
372
373
374    /**
375     * Returns all repetitions of Referral Reason (RF1-10).
376     */
377    public CWE[] getRf110_ReferralReason() {
378        CWE[] retVal = this.getTypedField(10, new CWE[0]);
379        return retVal;
380    }
381
382
383    /**
384     * Returns a count of the current number of repetitions of Referral Reason (RF1-10).
385     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
386     * it will return zero.
387     */
388    public int getReferralReasonReps() {
389        return this.getReps(10);
390    }
391
392
393    /**
394     * Returns a specific repetition of
395     * RF1-10: "Referral Reason" - creates it if necessary
396     *
397     * @param rep The repetition index (0-indexed)
398     */
399    public CWE getReferralReason(int rep) { 
400                CWE retVal = this.getTypedField(10, rep);
401                return retVal;
402    }
403
404    /**
405     * Returns a specific repetition of
406     * RF1-10: "Referral Reason" - creates it if necessary
407     *
408     * @param rep The repetition index (0-indexed)
409     */
410    public CWE getRf110_ReferralReason(int rep) { 
411                CWE retVal = this.getTypedField(10, rep);
412                return retVal;
413    }
414
415    /**
416     * Returns a count of the current number of repetitions of Referral Reason (RF1-10).
417     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
418     * it will return zero.
419     */
420    public int getRf110_ReferralReasonReps() {
421        return this.getReps(10);
422    }
423
424
425    /**
426     * Inserts a repetition of
427     * RF1-10: "Referral Reason" at a specific index
428     *
429     * @param rep The repetition index (0-indexed)
430     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
431     */
432    public CWE insertReferralReason(int rep) throws HL7Exception { 
433        return (CWE) super.insertRepetition(10, rep);
434    }
435
436
437    /**
438     * Inserts a repetition of
439     * RF1-10: "Referral Reason" at a specific index
440     *
441     * @param rep The repetition index (0-indexed)
442     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
443     */
444    public CWE insertRf110_ReferralReason(int rep) throws HL7Exception { 
445        return (CWE) super.insertRepetition(10, rep);
446    }
447
448
449    /**
450     * Removes a repetition of
451     * RF1-10: "Referral Reason" at a specific index
452     *
453     * @param rep The repetition index (0-indexed)
454     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
455     */
456    public CWE removeReferralReason(int rep) throws HL7Exception { 
457        return (CWE) super.removeRepetition(10, rep);
458    }
459
460
461    /**
462     * Removes a repetition of
463     * RF1-10: "Referral Reason" at a specific index
464     *
465     * @param rep The repetition index (0-indexed)
466     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
467     */
468    public CWE removeRf110_ReferralReason(int rep) throws HL7Exception { 
469        return (CWE) super.removeRepetition(10, rep);
470    }
471
472
473
474    /**
475     * Returns all repetitions of External Referral Identifier (RF1-11).
476     */
477    public EI[] getExternalReferralIdentifier() {
478        EI[] retVal = this.getTypedField(11, new EI[0]);
479        return retVal;
480    }
481
482
483    /**
484     * Returns all repetitions of External Referral Identifier (RF1-11).
485     */
486    public EI[] getRf111_ExternalReferralIdentifier() {
487        EI[] retVal = this.getTypedField(11, new EI[0]);
488        return retVal;
489    }
490
491
492    /**
493     * Returns a count of the current number of repetitions of External Referral Identifier (RF1-11).
494     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
495     * it will return zero.
496     */
497    public int getExternalReferralIdentifierReps() {
498        return this.getReps(11);
499    }
500
501
502    /**
503     * Returns a specific repetition of
504     * RF1-11: "External Referral Identifier" - creates it if necessary
505     *
506     * @param rep The repetition index (0-indexed)
507     */
508    public EI getExternalReferralIdentifier(int rep) { 
509                EI retVal = this.getTypedField(11, rep);
510                return retVal;
511    }
512
513    /**
514     * Returns a specific repetition of
515     * RF1-11: "External Referral Identifier" - creates it if necessary
516     *
517     * @param rep The repetition index (0-indexed)
518     */
519    public EI getRf111_ExternalReferralIdentifier(int rep) { 
520                EI retVal = this.getTypedField(11, rep);
521                return retVal;
522    }
523
524    /**
525     * Returns a count of the current number of repetitions of External Referral Identifier (RF1-11).
526     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
527     * it will return zero.
528     */
529    public int getRf111_ExternalReferralIdentifierReps() {
530        return this.getReps(11);
531    }
532
533
534    /**
535     * Inserts a repetition of
536     * RF1-11: "External Referral Identifier" at a specific index
537     *
538     * @param rep The repetition index (0-indexed)
539     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
540     */
541    public EI insertExternalReferralIdentifier(int rep) throws HL7Exception { 
542        return (EI) super.insertRepetition(11, rep);
543    }
544
545
546    /**
547     * Inserts a repetition of
548     * RF1-11: "External Referral Identifier" at a specific index
549     *
550     * @param rep The repetition index (0-indexed)
551     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
552     */
553    public EI insertRf111_ExternalReferralIdentifier(int rep) throws HL7Exception { 
554        return (EI) super.insertRepetition(11, rep);
555    }
556
557
558    /**
559     * Removes a repetition of
560     * RF1-11: "External Referral Identifier" at a specific index
561     *
562     * @param rep The repetition index (0-indexed)
563     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
564     */
565    public EI removeExternalReferralIdentifier(int rep) throws HL7Exception { 
566        return (EI) super.removeRepetition(11, rep);
567    }
568
569
570    /**
571     * Removes a repetition of
572     * RF1-11: "External Referral Identifier" at a specific index
573     *
574     * @param rep The repetition index (0-indexed)
575     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
576     */
577    public EI removeRf111_ExternalReferralIdentifier(int rep) throws HL7Exception { 
578        return (EI) super.removeRepetition(11, rep);
579    }
580
581
582
583
584    /**
585     * Returns
586     * RF1-12: "Referral Documentation Completion Status" - creates it if necessary
587     */
588    public CWE getReferralDocumentationCompletionStatus() { 
589                CWE retVal = this.getTypedField(12, 0);
590                return retVal;
591    }
592    
593    /**
594     * Returns
595     * RF1-12: "Referral Documentation Completion Status" - creates it if necessary
596     */
597    public CWE getRf112_ReferralDocumentationCompletionStatus() { 
598                CWE retVal = this.getTypedField(12, 0);
599                return retVal;
600    }
601
602
603
604
605
606    /** {@inheritDoc} */   
607    protected Type createNewTypeWithoutReflection(int field) {
608       switch (field) {
609          case 0: return new CWE(getMessage());
610          case 1: return new CWE(getMessage());
611          case 2: return new CWE(getMessage());
612          case 3: return new CWE(getMessage());
613          case 4: return new CWE(getMessage());
614          case 5: return new EI(getMessage());
615          case 6: return new DTM(getMessage());
616          case 7: return new DTM(getMessage());
617          case 8: return new DTM(getMessage());
618          case 9: return new CWE(getMessage());
619          case 10: return new EI(getMessage());
620          case 11: return new CWE(getMessage());
621          default: return null;
622       }
623   }
624
625
626}
627