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.v24.segment;
035
036// import ca.uhn.hl7v2.model.v24.group.*;
037import ca.uhn.hl7v2.model.v24.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 GP1 message segment (Grouping/Reimbursement - Visit). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>GP1-1: Type of Bill Code (IS) <b> </b>
052     * <li>GP1-2: Revenue Code (IS) <b>optional repeating</b>
053     * <li>GP1-3: Overall Claim Disposition Code (IS) <b>optional </b>
054     * <li>GP1-4: OCE Edits per Visit Code (IS) <b>optional repeating</b>
055     * <li>GP1-5: Outlier Cost (CP) <b>optional </b>
056 * </ul>
057 */
058@SuppressWarnings("unused")
059public class GP1 extends AbstractSegment {
060
061    /** 
062     * Creates a new GP1 segment
063     */
064    public GP1(Group parent, ModelClassFactory factory) {
065       super(parent, factory);
066       init(factory);
067    }
068
069    private void init(ModelClassFactory factory) {
070       try {
071                                              this.add(IS.class, true, 1, 3, new Object[]{ getMessage(), new Integer(455) }, "Type of Bill Code");
072                                              this.add(IS.class, false, 0, 3, new Object[]{ getMessage(), new Integer(456) }, "Revenue Code");
073                                              this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(457) }, "Overall Claim Disposition Code");
074                                              this.add(IS.class, false, 0, 2, new Object[]{ getMessage(), new Integer(458) }, "OCE Edits per Visit Code");
075                                  this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Outlier Cost");
076       } catch(HL7Exception e) {
077          log.error("Unexpected error creating GP1 - this is probably a bug in the source code generator.", e);
078       }
079    }
080
081
082
083    /**
084     * Returns
085     * GP1-1: "Type of Bill Code" - creates it if necessary
086     */
087    public IS getTypeOfBillCode() { 
088                IS retVal = this.getTypedField(1, 0);
089                return retVal;
090    }
091    
092    /**
093     * Returns
094     * GP1-1: "Type of Bill Code" - creates it if necessary
095     */
096    public IS getGp11_TypeOfBillCode() { 
097                IS retVal = this.getTypedField(1, 0);
098                return retVal;
099    }
100
101
102    /**
103     * Returns all repetitions of Revenue Code (GP1-2).
104     */
105    public IS[] getRevenueCode() {
106        IS[] retVal = this.getTypedField(2, new IS[0]);
107        return retVal;
108    }
109
110
111    /**
112     * Returns all repetitions of Revenue Code (GP1-2).
113     */
114    public IS[] getGp12_RevenueCode() {
115        IS[] retVal = this.getTypedField(2, new IS[0]);
116        return retVal;
117    }
118
119
120    /**
121     * Returns a count of the current number of repetitions of Revenue Code (GP1-2).
122     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
123     * it will return zero.
124     */
125    public int getRevenueCodeReps() {
126        return this.getReps(2);
127    }
128
129
130    /**
131     * Returns a specific repetition of
132     * GP1-2: "Revenue Code" - creates it if necessary
133     *
134     * @param rep The repetition index (0-indexed)
135     */
136    public IS getRevenueCode(int rep) { 
137                IS retVal = this.getTypedField(2, rep);
138                return retVal;
139    }
140
141    /**
142     * Returns a specific repetition of
143     * GP1-2: "Revenue Code" - creates it if necessary
144     *
145     * @param rep The repetition index (0-indexed)
146     */
147    public IS getGp12_RevenueCode(int rep) { 
148                IS retVal = this.getTypedField(2, rep);
149                return retVal;
150    }
151
152    /**
153     * Returns a count of the current number of repetitions of Revenue Code (GP1-2).
154     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
155     * it will return zero.
156     */
157    public int getGp12_RevenueCodeReps() {
158        return this.getReps(2);
159    }
160
161
162    /**
163     * Inserts a repetition of
164     * GP1-2: "Revenue Code" at a specific index
165     *
166     * @param rep The repetition index (0-indexed)
167     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
168     */
169    public IS insertRevenueCode(int rep) throws HL7Exception { 
170        return (IS) super.insertRepetition(2, rep);
171    }
172
173
174    /**
175     * Inserts a repetition of
176     * GP1-2: "Revenue Code" at a specific index
177     *
178     * @param rep The repetition index (0-indexed)
179     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
180     */
181    public IS insertGp12_RevenueCode(int rep) throws HL7Exception { 
182        return (IS) super.insertRepetition(2, rep);
183    }
184
185
186    /**
187     * Removes a repetition of
188     * GP1-2: "Revenue Code" at a specific index
189     *
190     * @param rep The repetition index (0-indexed)
191     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
192     */
193    public IS removeRevenueCode(int rep) throws HL7Exception { 
194        return (IS) super.removeRepetition(2, rep);
195    }
196
197
198    /**
199     * Removes a repetition of
200     * GP1-2: "Revenue Code" at a specific index
201     *
202     * @param rep The repetition index (0-indexed)
203     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
204     */
205    public IS removeGp12_RevenueCode(int rep) throws HL7Exception { 
206        return (IS) super.removeRepetition(2, rep);
207    }
208
209
210
211
212    /**
213     * Returns
214     * GP1-3: "Overall Claim Disposition Code" - creates it if necessary
215     */
216    public IS getOverallClaimDispositionCode() { 
217                IS retVal = this.getTypedField(3, 0);
218                return retVal;
219    }
220    
221    /**
222     * Returns
223     * GP1-3: "Overall Claim Disposition Code" - creates it if necessary
224     */
225    public IS getGp13_OverallClaimDispositionCode() { 
226                IS retVal = this.getTypedField(3, 0);
227                return retVal;
228    }
229
230
231    /**
232     * Returns all repetitions of OCE Edits per Visit Code (GP1-4).
233     */
234    public IS[] getOCEEditsPerVisitCode() {
235        IS[] retVal = this.getTypedField(4, new IS[0]);
236        return retVal;
237    }
238
239
240    /**
241     * Returns all repetitions of OCE Edits per Visit Code (GP1-4).
242     */
243    public IS[] getGp14_OCEEditsPerVisitCode() {
244        IS[] retVal = this.getTypedField(4, new IS[0]);
245        return retVal;
246    }
247
248
249    /**
250     * Returns a count of the current number of repetitions of OCE Edits per Visit Code (GP1-4).
251     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
252     * it will return zero.
253     */
254    public int getOCEEditsPerVisitCodeReps() {
255        return this.getReps(4);
256    }
257
258
259    /**
260     * Returns a specific repetition of
261     * GP1-4: "OCE Edits per Visit Code" - creates it if necessary
262     *
263     * @param rep The repetition index (0-indexed)
264     */
265    public IS getOCEEditsPerVisitCode(int rep) { 
266                IS retVal = this.getTypedField(4, rep);
267                return retVal;
268    }
269
270    /**
271     * Returns a specific repetition of
272     * GP1-4: "OCE Edits per Visit Code" - creates it if necessary
273     *
274     * @param rep The repetition index (0-indexed)
275     */
276    public IS getGp14_OCEEditsPerVisitCode(int rep) { 
277                IS retVal = this.getTypedField(4, rep);
278                return retVal;
279    }
280
281    /**
282     * Returns a count of the current number of repetitions of OCE Edits per Visit Code (GP1-4).
283     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
284     * it will return zero.
285     */
286    public int getGp14_OCEEditsPerVisitCodeReps() {
287        return this.getReps(4);
288    }
289
290
291    /**
292     * Inserts a repetition of
293     * GP1-4: "OCE Edits per Visit Code" at a specific index
294     *
295     * @param rep The repetition index (0-indexed)
296     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
297     */
298    public IS insertOCEEditsPerVisitCode(int rep) throws HL7Exception { 
299        return (IS) super.insertRepetition(4, rep);
300    }
301
302
303    /**
304     * Inserts a repetition of
305     * GP1-4: "OCE Edits per Visit Code" at a specific index
306     *
307     * @param rep The repetition index (0-indexed)
308     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
309     */
310    public IS insertGp14_OCEEditsPerVisitCode(int rep) throws HL7Exception { 
311        return (IS) super.insertRepetition(4, rep);
312    }
313
314
315    /**
316     * Removes a repetition of
317     * GP1-4: "OCE Edits per Visit Code" at a specific index
318     *
319     * @param rep The repetition index (0-indexed)
320     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
321     */
322    public IS removeOCEEditsPerVisitCode(int rep) throws HL7Exception { 
323        return (IS) super.removeRepetition(4, rep);
324    }
325
326
327    /**
328     * Removes a repetition of
329     * GP1-4: "OCE Edits per Visit Code" at a specific index
330     *
331     * @param rep The repetition index (0-indexed)
332     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
333     */
334    public IS removeGp14_OCEEditsPerVisitCode(int rep) throws HL7Exception { 
335        return (IS) super.removeRepetition(4, rep);
336    }
337
338
339
340
341    /**
342     * Returns
343     * GP1-5: "Outlier Cost" - creates it if necessary
344     */
345    public CP getOutlierCost() { 
346                CP retVal = this.getTypedField(5, 0);
347                return retVal;
348    }
349    
350    /**
351     * Returns
352     * GP1-5: "Outlier Cost" - creates it if necessary
353     */
354    public CP getGp15_OutlierCost() { 
355                CP retVal = this.getTypedField(5, 0);
356                return retVal;
357    }
358
359
360
361
362
363    /** {@inheritDoc} */   
364    protected Type createNewTypeWithoutReflection(int field) {
365       switch (field) {
366          case 0: return new IS(getMessage(), new Integer( 455 ));
367          case 1: return new IS(getMessage(), new Integer( 456 ));
368          case 2: return new IS(getMessage(), new Integer( 457 ));
369          case 3: return new IS(getMessage(), new Integer( 458 ));
370          case 4: return new CP(getMessage());
371          default: return null;
372       }
373   }
374
375
376}
377