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 ADJ message segment (Adjustment). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>ADJ-1: Provider Adjustment Number (EI) <b> </b>
053     * <li>ADJ-2: Payer Adjustment Number (EI) <b> </b>
054     * <li>ADJ-3: Adjustment Sequence Number (SI) <b> </b>
055     * <li>ADJ-4: Adjustment Category (CWE) <b> </b>
056     * <li>ADJ-5: Adjustment Amount (CP) <b>optional </b>
057     * <li>ADJ-6: Adjustment Quantity (CQ) <b>optional </b>
058     * <li>ADJ-7: Adjustment Reason PA (CWE) <b>optional </b>
059     * <li>ADJ-8: Adjustment Description (ST) <b>optional </b>
060     * <li>ADJ-9: Original Value (NM) <b>optional </b>
061     * <li>ADJ-10: Substitute Value (NM) <b>optional </b>
062     * <li>ADJ-11: Adjustment Action (CWE) <b>optional </b>
063     * <li>ADJ-12: Provider Adjustment Number Cross Reference (EI) <b>optional </b>
064     * <li>ADJ-13: Provider Product/Service Line Item Number Cross Reference (EI) <b>optional </b>
065     * <li>ADJ-14: Adjustment Date (DTM) <b> </b>
066     * <li>ADJ-15: Responsible Organization (XON) <b>optional </b>
067 * </ul>
068 */
069@SuppressWarnings("unused")
070public class ADJ extends AbstractSegment {
071
072    /** 
073     * Creates a new ADJ segment
074     */
075    public ADJ(Group parent, ModelClassFactory factory) {
076       super(parent, factory);
077       init(factory);
078    }
079
080    private void init(ModelClassFactory factory) {
081       try {
082                                  this.add(EI.class, true, 1, 0, new Object[]{ getMessage() }, "Provider Adjustment Number");
083                                  this.add(EI.class, true, 1, 0, new Object[]{ getMessage() }, "Payer Adjustment Number");
084                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Adjustment Sequence Number");
085                                  this.add(CWE.class, true, 1, 0, new Object[]{ getMessage() }, "Adjustment Category");
086                                  this.add(CP.class, false, 1, 0, new Object[]{ getMessage() }, "Adjustment Amount");
087                                  this.add(CQ.class, false, 1, 0, new Object[]{ getMessage() }, "Adjustment Quantity");
088                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Adjustment Reason PA");
089                                  this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Adjustment Description");
090                                  this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Original Value");
091                                  this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Substitute Value");
092                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Adjustment Action");
093                                  this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "Provider Adjustment Number Cross Reference");
094                                  this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "Provider Product/Service Line Item Number Cross Reference");
095                                  this.add(DTM.class, true, 1, 0, new Object[]{ getMessage() }, "Adjustment Date");
096                                  this.add(XON.class, false, 1, 0, new Object[]{ getMessage() }, "Responsible Organization");
097       } catch(HL7Exception e) {
098          log.error("Unexpected error creating ADJ - this is probably a bug in the source code generator.", e);
099       }
100    }
101
102
103
104    /**
105     * Returns
106     * ADJ-1: "Provider Adjustment Number" - creates it if necessary
107     */
108    public EI getProviderAdjustmentNumber() { 
109                EI retVal = this.getTypedField(1, 0);
110                return retVal;
111    }
112    
113    /**
114     * Returns
115     * ADJ-1: "Provider Adjustment Number" - creates it if necessary
116     */
117    public EI getAdj1_ProviderAdjustmentNumber() { 
118                EI retVal = this.getTypedField(1, 0);
119                return retVal;
120    }
121
122
123
124    /**
125     * Returns
126     * ADJ-2: "Payer Adjustment Number" - creates it if necessary
127     */
128    public EI getPayerAdjustmentNumber() { 
129                EI retVal = this.getTypedField(2, 0);
130                return retVal;
131    }
132    
133    /**
134     * Returns
135     * ADJ-2: "Payer Adjustment Number" - creates it if necessary
136     */
137    public EI getAdj2_PayerAdjustmentNumber() { 
138                EI retVal = this.getTypedField(2, 0);
139                return retVal;
140    }
141
142
143
144    /**
145     * Returns
146     * ADJ-3: "Adjustment Sequence Number" - creates it if necessary
147     */
148    public SI getAdjustmentSequenceNumber() { 
149                SI retVal = this.getTypedField(3, 0);
150                return retVal;
151    }
152    
153    /**
154     * Returns
155     * ADJ-3: "Adjustment Sequence Number" - creates it if necessary
156     */
157    public SI getAdj3_AdjustmentSequenceNumber() { 
158                SI retVal = this.getTypedField(3, 0);
159                return retVal;
160    }
161
162
163
164    /**
165     * Returns
166     * ADJ-4: "Adjustment Category" - creates it if necessary
167     */
168    public CWE getAdjustmentCategory() { 
169                CWE retVal = this.getTypedField(4, 0);
170                return retVal;
171    }
172    
173    /**
174     * Returns
175     * ADJ-4: "Adjustment Category" - creates it if necessary
176     */
177    public CWE getAdj4_AdjustmentCategory() { 
178                CWE retVal = this.getTypedField(4, 0);
179                return retVal;
180    }
181
182
183
184    /**
185     * Returns
186     * ADJ-5: "Adjustment Amount" - creates it if necessary
187     */
188    public CP getAdjustmentAmount() { 
189                CP retVal = this.getTypedField(5, 0);
190                return retVal;
191    }
192    
193    /**
194     * Returns
195     * ADJ-5: "Adjustment Amount" - creates it if necessary
196     */
197    public CP getAdj5_AdjustmentAmount() { 
198                CP retVal = this.getTypedField(5, 0);
199                return retVal;
200    }
201
202
203
204    /**
205     * Returns
206     * ADJ-6: "Adjustment Quantity" - creates it if necessary
207     */
208    public CQ getAdjustmentQuantity() { 
209                CQ retVal = this.getTypedField(6, 0);
210                return retVal;
211    }
212    
213    /**
214     * Returns
215     * ADJ-6: "Adjustment Quantity" - creates it if necessary
216     */
217    public CQ getAdj6_AdjustmentQuantity() { 
218                CQ retVal = this.getTypedField(6, 0);
219                return retVal;
220    }
221
222
223
224    /**
225     * Returns
226     * ADJ-7: "Adjustment Reason PA" - creates it if necessary
227     */
228    public CWE getAdjustmentReasonPA() { 
229                CWE retVal = this.getTypedField(7, 0);
230                return retVal;
231    }
232    
233    /**
234     * Returns
235     * ADJ-7: "Adjustment Reason PA" - creates it if necessary
236     */
237    public CWE getAdj7_AdjustmentReasonPA() { 
238                CWE retVal = this.getTypedField(7, 0);
239                return retVal;
240    }
241
242
243
244    /**
245     * Returns
246     * ADJ-8: "Adjustment Description" - creates it if necessary
247     */
248    public ST getAdjustmentDescription() { 
249                ST retVal = this.getTypedField(8, 0);
250                return retVal;
251    }
252    
253    /**
254     * Returns
255     * ADJ-8: "Adjustment Description" - creates it if necessary
256     */
257    public ST getAdj8_AdjustmentDescription() { 
258                ST retVal = this.getTypedField(8, 0);
259                return retVal;
260    }
261
262
263
264    /**
265     * Returns
266     * ADJ-9: "Original Value" - creates it if necessary
267     */
268    public NM getOriginalValue() { 
269                NM retVal = this.getTypedField(9, 0);
270                return retVal;
271    }
272    
273    /**
274     * Returns
275     * ADJ-9: "Original Value" - creates it if necessary
276     */
277    public NM getAdj9_OriginalValue() { 
278                NM retVal = this.getTypedField(9, 0);
279                return retVal;
280    }
281
282
283
284    /**
285     * Returns
286     * ADJ-10: "Substitute Value" - creates it if necessary
287     */
288    public NM getSubstituteValue() { 
289                NM retVal = this.getTypedField(10, 0);
290                return retVal;
291    }
292    
293    /**
294     * Returns
295     * ADJ-10: "Substitute Value" - creates it if necessary
296     */
297    public NM getAdj10_SubstituteValue() { 
298                NM retVal = this.getTypedField(10, 0);
299                return retVal;
300    }
301
302
303
304    /**
305     * Returns
306     * ADJ-11: "Adjustment Action" - creates it if necessary
307     */
308    public CWE getAdjustmentAction() { 
309                CWE retVal = this.getTypedField(11, 0);
310                return retVal;
311    }
312    
313    /**
314     * Returns
315     * ADJ-11: "Adjustment Action" - creates it if necessary
316     */
317    public CWE getAdj11_AdjustmentAction() { 
318                CWE retVal = this.getTypedField(11, 0);
319                return retVal;
320    }
321
322
323
324    /**
325     * Returns
326     * ADJ-12: "Provider Adjustment Number Cross Reference" - creates it if necessary
327     */
328    public EI getProviderAdjustmentNumberCrossReference() { 
329                EI retVal = this.getTypedField(12, 0);
330                return retVal;
331    }
332    
333    /**
334     * Returns
335     * ADJ-12: "Provider Adjustment Number Cross Reference" - creates it if necessary
336     */
337    public EI getAdj12_ProviderAdjustmentNumberCrossReference() { 
338                EI retVal = this.getTypedField(12, 0);
339                return retVal;
340    }
341
342
343
344    /**
345     * Returns
346     * ADJ-13: "Provider Product/Service Line Item Number Cross Reference" - creates it if necessary
347     */
348    public EI getProviderProductServiceLineItemNumberCrossReference() { 
349                EI retVal = this.getTypedField(13, 0);
350                return retVal;
351    }
352    
353    /**
354     * Returns
355     * ADJ-13: "Provider Product/Service Line Item Number Cross Reference" - creates it if necessary
356     */
357    public EI getAdj13_ProviderProductServiceLineItemNumberCrossReference() { 
358                EI retVal = this.getTypedField(13, 0);
359                return retVal;
360    }
361
362
363
364    /**
365     * Returns
366     * ADJ-14: "Adjustment Date" - creates it if necessary
367     */
368    public DTM getAdjustmentDate() { 
369                DTM retVal = this.getTypedField(14, 0);
370                return retVal;
371    }
372    
373    /**
374     * Returns
375     * ADJ-14: "Adjustment Date" - creates it if necessary
376     */
377    public DTM getAdj14_AdjustmentDate() { 
378                DTM retVal = this.getTypedField(14, 0);
379                return retVal;
380    }
381
382
383
384    /**
385     * Returns
386     * ADJ-15: "Responsible Organization" - creates it if necessary
387     */
388    public XON getResponsibleOrganization() { 
389                XON retVal = this.getTypedField(15, 0);
390                return retVal;
391    }
392    
393    /**
394     * Returns
395     * ADJ-15: "Responsible Organization" - creates it if necessary
396     */
397    public XON getAdj15_ResponsibleOrganization() { 
398                XON retVal = this.getTypedField(15, 0);
399                return retVal;
400    }
401
402
403
404
405
406    /** {@inheritDoc} */   
407    protected Type createNewTypeWithoutReflection(int field) {
408       switch (field) {
409          case 0: return new EI(getMessage());
410          case 1: return new EI(getMessage());
411          case 2: return new SI(getMessage());
412          case 3: return new CWE(getMessage());
413          case 4: return new CP(getMessage());
414          case 5: return new CQ(getMessage());
415          case 6: return new CWE(getMessage());
416          case 7: return new ST(getMessage());
417          case 8: return new NM(getMessage());
418          case 9: return new NM(getMessage());
419          case 10: return new CWE(getMessage());
420          case 11: return new EI(getMessage());
421          case 12: return new EI(getMessage());
422          case 13: return new DTM(getMessage());
423          case 14: return new XON(getMessage());
424          default: return null;
425       }
426   }
427
428
429}
430