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.v27.segment;
035
036// import ca.uhn.hl7v2.model.v27.group.*;
037import ca.uhn.hl7v2.model.v27.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 AUT message segment (Authorization Information). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>AUT-1: Authorizing Payor, Plan ID (CWE) <b>optional </b>
053     * <li>AUT-2: Authorizing Payor, Company ID (CWE) <b> </b>
054     * <li>AUT-3: Authorizing Payor, Company Name (ST) <b>optional </b>
055     * <li>AUT-4: Authorization Effective Date (DTM) <b>optional </b>
056     * <li>AUT-5: Authorization Expiration Date (DTM) <b>optional </b>
057     * <li>AUT-6: Authorization Identifier (EI) <b>optional </b>
058     * <li>AUT-7: Reimbursement Limit (CP) <b>optional </b>
059     * <li>AUT-8: Requested Number of Treatments (CQ) <b>optional </b>
060     * <li>AUT-9: Authorized Number of Treatments (CQ) <b>optional </b>
061     * <li>AUT-10: Process Date (DTM) <b>optional </b>
062     * <li>AUT-11: Requested Discipline(s) (CWE) <b>optional repeating</b>
063     * <li>AUT-12: Authorized Discipline(s) (CWE) <b>optional repeating</b>
064 * </ul>
065 */
066@SuppressWarnings("unused")
067public class AUT extends AbstractSegment {
068
069    /** 
070     * Creates a new AUT segment
071     */
072    public AUT(Group parent, ModelClassFactory factory) {
073       super(parent, factory);
074       init(factory);
075    }
076
077    private void init(ModelClassFactory factory) {
078       try {
079                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Authorizing Payor, Plan ID");
080                                  this.add(CWE.class, true, 1, 0, new Object[]{ getMessage() }, "Authorizing Payor, Company ID");
081                                  this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Authorizing Payor, Company Name");
082                                  this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Authorization Effective Date");
083                                  this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Authorization Expiration Date");
084                                  this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "Authorization Identifier");
085                                  this.add(CP.class, false, 1, 0, new Object[]{ getMessage() }, "Reimbursement Limit");
086                                  this.add(CQ.class, false, 1, 0, new Object[]{ getMessage() }, "Requested Number of Treatments");
087                                  this.add(CQ.class, false, 1, 0, new Object[]{ getMessage() }, "Authorized Number of Treatments");
088                                  this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Process Date");
089                                  this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "Requested Discipline(s)");
090                                  this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "Authorized Discipline(s)");
091       } catch(HL7Exception e) {
092          log.error("Unexpected error creating AUT - this is probably a bug in the source code generator.", e);
093       }
094    }
095
096
097
098    /**
099     * Returns
100     * AUT-1: "Authorizing Payor, Plan ID" - creates it if necessary
101     */
102    public CWE getAuthorizingPayorPlanID() { 
103                CWE retVal = this.getTypedField(1, 0);
104                return retVal;
105    }
106    
107    /**
108     * Returns
109     * AUT-1: "Authorizing Payor, Plan ID" - creates it if necessary
110     */
111    public CWE getAut1_AuthorizingPayorPlanID() { 
112                CWE retVal = this.getTypedField(1, 0);
113                return retVal;
114    }
115
116
117
118    /**
119     * Returns
120     * AUT-2: "Authorizing Payor, Company ID" - creates it if necessary
121     */
122    public CWE getAuthorizingPayorCompanyID() { 
123                CWE retVal = this.getTypedField(2, 0);
124                return retVal;
125    }
126    
127    /**
128     * Returns
129     * AUT-2: "Authorizing Payor, Company ID" - creates it if necessary
130     */
131    public CWE getAut2_AuthorizingPayorCompanyID() { 
132                CWE retVal = this.getTypedField(2, 0);
133                return retVal;
134    }
135
136
137
138    /**
139     * Returns
140     * AUT-3: "Authorizing Payor, Company Name" - creates it if necessary
141     */
142    public ST getAuthorizingPayorCompanyName() { 
143                ST retVal = this.getTypedField(3, 0);
144                return retVal;
145    }
146    
147    /**
148     * Returns
149     * AUT-3: "Authorizing Payor, Company Name" - creates it if necessary
150     */
151    public ST getAut3_AuthorizingPayorCompanyName() { 
152                ST retVal = this.getTypedField(3, 0);
153                return retVal;
154    }
155
156
157
158    /**
159     * Returns
160     * AUT-4: "Authorization Effective Date" - creates it if necessary
161     */
162    public DTM getAuthorizationEffectiveDate() { 
163                DTM retVal = this.getTypedField(4, 0);
164                return retVal;
165    }
166    
167    /**
168     * Returns
169     * AUT-4: "Authorization Effective Date" - creates it if necessary
170     */
171    public DTM getAut4_AuthorizationEffectiveDate() { 
172                DTM retVal = this.getTypedField(4, 0);
173                return retVal;
174    }
175
176
177
178    /**
179     * Returns
180     * AUT-5: "Authorization Expiration Date" - creates it if necessary
181     */
182    public DTM getAuthorizationExpirationDate() { 
183                DTM retVal = this.getTypedField(5, 0);
184                return retVal;
185    }
186    
187    /**
188     * Returns
189     * AUT-5: "Authorization Expiration Date" - creates it if necessary
190     */
191    public DTM getAut5_AuthorizationExpirationDate() { 
192                DTM retVal = this.getTypedField(5, 0);
193                return retVal;
194    }
195
196
197
198    /**
199     * Returns
200     * AUT-6: "Authorization Identifier" - creates it if necessary
201     */
202    public EI getAuthorizationIdentifier() { 
203                EI retVal = this.getTypedField(6, 0);
204                return retVal;
205    }
206    
207    /**
208     * Returns
209     * AUT-6: "Authorization Identifier" - creates it if necessary
210     */
211    public EI getAut6_AuthorizationIdentifier() { 
212                EI retVal = this.getTypedField(6, 0);
213                return retVal;
214    }
215
216
217
218    /**
219     * Returns
220     * AUT-7: "Reimbursement Limit" - creates it if necessary
221     */
222    public CP getReimbursementLimit() { 
223                CP retVal = this.getTypedField(7, 0);
224                return retVal;
225    }
226    
227    /**
228     * Returns
229     * AUT-7: "Reimbursement Limit" - creates it if necessary
230     */
231    public CP getAut7_ReimbursementLimit() { 
232                CP retVal = this.getTypedField(7, 0);
233                return retVal;
234    }
235
236
237
238    /**
239     * Returns
240     * AUT-8: "Requested Number of Treatments" - creates it if necessary
241     */
242    public CQ getRequestedNumberOfTreatments() { 
243                CQ retVal = this.getTypedField(8, 0);
244                return retVal;
245    }
246    
247    /**
248     * Returns
249     * AUT-8: "Requested Number of Treatments" - creates it if necessary
250     */
251    public CQ getAut8_RequestedNumberOfTreatments() { 
252                CQ retVal = this.getTypedField(8, 0);
253                return retVal;
254    }
255
256
257
258    /**
259     * Returns
260     * AUT-9: "Authorized Number of Treatments" - creates it if necessary
261     */
262    public CQ getAuthorizedNumberOfTreatments() { 
263                CQ retVal = this.getTypedField(9, 0);
264                return retVal;
265    }
266    
267    /**
268     * Returns
269     * AUT-9: "Authorized Number of Treatments" - creates it if necessary
270     */
271    public CQ getAut9_AuthorizedNumberOfTreatments() { 
272                CQ retVal = this.getTypedField(9, 0);
273                return retVal;
274    }
275
276
277
278    /**
279     * Returns
280     * AUT-10: "Process Date" - creates it if necessary
281     */
282    public DTM getProcessDate() { 
283                DTM retVal = this.getTypedField(10, 0);
284                return retVal;
285    }
286    
287    /**
288     * Returns
289     * AUT-10: "Process Date" - creates it if necessary
290     */
291    public DTM getAut10_ProcessDate() { 
292                DTM retVal = this.getTypedField(10, 0);
293                return retVal;
294    }
295
296
297    /**
298     * Returns all repetitions of Requested Discipline(s) (AUT-11).
299     */
300    public CWE[] getRequestedDisciplineS() {
301        CWE[] retVal = this.getTypedField(11, new CWE[0]);
302        return retVal;
303    }
304
305
306    /**
307     * Returns all repetitions of Requested Discipline(s) (AUT-11).
308     */
309    public CWE[] getAut11_RequestedDisciplineS() {
310        CWE[] retVal = this.getTypedField(11, new CWE[0]);
311        return retVal;
312    }
313
314
315    /**
316     * Returns a count of the current number of repetitions of Requested Discipline(s) (AUT-11).
317     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
318     * it will return zero.
319     */
320    public int getRequestedDisciplineSReps() {
321        return this.getReps(11);
322    }
323
324
325    /**
326     * Returns a specific repetition of
327     * AUT-11: "Requested Discipline(s)" - creates it if necessary
328     *
329     * @param rep The repetition index (0-indexed)
330     */
331    public CWE getRequestedDisciplineS(int rep) { 
332                CWE retVal = this.getTypedField(11, rep);
333                return retVal;
334    }
335
336    /**
337     * Returns a specific repetition of
338     * AUT-11: "Requested Discipline(s)" - creates it if necessary
339     *
340     * @param rep The repetition index (0-indexed)
341     */
342    public CWE getAut11_RequestedDisciplineS(int rep) { 
343                CWE retVal = this.getTypedField(11, rep);
344                return retVal;
345    }
346
347    /**
348     * Returns a count of the current number of repetitions of Requested Discipline(s) (AUT-11).
349     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
350     * it will return zero.
351     */
352    public int getAut11_RequestedDisciplineSReps() {
353        return this.getReps(11);
354    }
355
356
357    /**
358     * Inserts a repetition of
359     * AUT-11: "Requested Discipline(s)" at a specific index
360     *
361     * @param rep The repetition index (0-indexed)
362     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
363     */
364    public CWE insertRequestedDisciplineS(int rep) throws HL7Exception { 
365        return (CWE) super.insertRepetition(11, rep);
366    }
367
368
369    /**
370     * Inserts a repetition of
371     * AUT-11: "Requested Discipline(s)" at a specific index
372     *
373     * @param rep The repetition index (0-indexed)
374     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
375     */
376    public CWE insertAut11_RequestedDisciplineS(int rep) throws HL7Exception { 
377        return (CWE) super.insertRepetition(11, rep);
378    }
379
380
381    /**
382     * Removes a repetition of
383     * AUT-11: "Requested Discipline(s)" at a specific index
384     *
385     * @param rep The repetition index (0-indexed)
386     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
387     */
388    public CWE removeRequestedDisciplineS(int rep) throws HL7Exception { 
389        return (CWE) super.removeRepetition(11, rep);
390    }
391
392
393    /**
394     * Removes a repetition of
395     * AUT-11: "Requested Discipline(s)" at a specific index
396     *
397     * @param rep The repetition index (0-indexed)
398     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
399     */
400    public CWE removeAut11_RequestedDisciplineS(int rep) throws HL7Exception { 
401        return (CWE) super.removeRepetition(11, rep);
402    }
403
404
405
406    /**
407     * Returns all repetitions of Authorized Discipline(s) (AUT-12).
408     */
409    public CWE[] getAuthorizedDisciplineS() {
410        CWE[] retVal = this.getTypedField(12, new CWE[0]);
411        return retVal;
412    }
413
414
415    /**
416     * Returns all repetitions of Authorized Discipline(s) (AUT-12).
417     */
418    public CWE[] getAut12_AuthorizedDisciplineS() {
419        CWE[] retVal = this.getTypedField(12, new CWE[0]);
420        return retVal;
421    }
422
423
424    /**
425     * Returns a count of the current number of repetitions of Authorized Discipline(s) (AUT-12).
426     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
427     * it will return zero.
428     */
429    public int getAuthorizedDisciplineSReps() {
430        return this.getReps(12);
431    }
432
433
434    /**
435     * Returns a specific repetition of
436     * AUT-12: "Authorized Discipline(s)" - creates it if necessary
437     *
438     * @param rep The repetition index (0-indexed)
439     */
440    public CWE getAuthorizedDisciplineS(int rep) { 
441                CWE retVal = this.getTypedField(12, rep);
442                return retVal;
443    }
444
445    /**
446     * Returns a specific repetition of
447     * AUT-12: "Authorized Discipline(s)" - creates it if necessary
448     *
449     * @param rep The repetition index (0-indexed)
450     */
451    public CWE getAut12_AuthorizedDisciplineS(int rep) { 
452                CWE retVal = this.getTypedField(12, rep);
453                return retVal;
454    }
455
456    /**
457     * Returns a count of the current number of repetitions of Authorized Discipline(s) (AUT-12).
458     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
459     * it will return zero.
460     */
461    public int getAut12_AuthorizedDisciplineSReps() {
462        return this.getReps(12);
463    }
464
465
466    /**
467     * Inserts a repetition of
468     * AUT-12: "Authorized Discipline(s)" at a specific index
469     *
470     * @param rep The repetition index (0-indexed)
471     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
472     */
473    public CWE insertAuthorizedDisciplineS(int rep) throws HL7Exception { 
474        return (CWE) super.insertRepetition(12, rep);
475    }
476
477
478    /**
479     * Inserts a repetition of
480     * AUT-12: "Authorized Discipline(s)" at a specific index
481     *
482     * @param rep The repetition index (0-indexed)
483     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
484     */
485    public CWE insertAut12_AuthorizedDisciplineS(int rep) throws HL7Exception { 
486        return (CWE) super.insertRepetition(12, rep);
487    }
488
489
490    /**
491     * Removes a repetition of
492     * AUT-12: "Authorized Discipline(s)" at a specific index
493     *
494     * @param rep The repetition index (0-indexed)
495     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
496     */
497    public CWE removeAuthorizedDisciplineS(int rep) throws HL7Exception { 
498        return (CWE) super.removeRepetition(12, rep);
499    }
500
501
502    /**
503     * Removes a repetition of
504     * AUT-12: "Authorized Discipline(s)" at a specific index
505     *
506     * @param rep The repetition index (0-indexed)
507     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
508     */
509    public CWE removeAut12_AuthorizedDisciplineS(int rep) throws HL7Exception { 
510        return (CWE) super.removeRepetition(12, rep);
511    }
512
513
514
515
516
517
518    /** {@inheritDoc} */   
519    protected Type createNewTypeWithoutReflection(int field) {
520       switch (field) {
521          case 0: return new CWE(getMessage());
522          case 1: return new CWE(getMessage());
523          case 2: return new ST(getMessage());
524          case 3: return new DTM(getMessage());
525          case 4: return new DTM(getMessage());
526          case 5: return new EI(getMessage());
527          case 6: return new CP(getMessage());
528          case 7: return new CQ(getMessage());
529          case 8: return new CQ(getMessage());
530          case 9: return new DTM(getMessage());
531          case 10: return new CWE(getMessage());
532          case 11: return new CWE(getMessage());
533          default: return null;
534       }
535   }
536
537
538}
539