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 RQ1 message segment (Requisition Detail-1). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>RQ1-1: Anticipated Price (ST) <b>optional </b>
052     * <li>RQ1-2: Manufacturer Identifier (CWE) <b>optional </b>
053     * <li>RQ1-3: Manufacturer's Catalog (ST) <b>optional </b>
054     * <li>RQ1-4: Vendor ID (CWE) <b>optional </b>
055     * <li>RQ1-5: Vendor Catalog (ST) <b>optional </b>
056     * <li>RQ1-6: Taxable (ID) <b>optional </b>
057     * <li>RQ1-7: Substitute Allowed (ID) <b>optional </b>
058 * </ul>
059 */
060@SuppressWarnings("unused")
061public class RQ1 extends AbstractSegment {
062
063    /** 
064     * Creates a new RQ1 segment
065     */
066    public RQ1(Group parent, ModelClassFactory factory) {
067       super(parent, factory);
068       init(factory);
069    }
070
071    private void init(ModelClassFactory factory) {
072       try {
073                                  this.add(ST.class, false, 1, 10, new Object[]{ getMessage() }, "Anticipated Price");
074                                  this.add(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Manufacturer Identifier");
075                                  this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "Manufacturer's Catalog");
076                                  this.add(CWE.class, false, 1, 250, new Object[]{ getMessage() }, "Vendor ID");
077                                  this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "Vendor Catalog");
078                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Taxable");
079                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Substitute Allowed");
080       } catch(HL7Exception e) {
081          log.error("Unexpected error creating RQ1 - this is probably a bug in the source code generator.", e);
082       }
083    }
084
085
086
087    /**
088     * Returns
089     * RQ1-1: "Anticipated Price" - creates it if necessary
090     */
091    public ST getAnticipatedPrice() { 
092                ST retVal = this.getTypedField(1, 0);
093                return retVal;
094    }
095    
096    /**
097     * Returns
098     * RQ1-1: "Anticipated Price" - creates it if necessary
099     */
100    public ST getRq11_AnticipatedPrice() { 
101                ST retVal = this.getTypedField(1, 0);
102                return retVal;
103    }
104
105
106
107    /**
108     * Returns
109     * RQ1-2: "Manufacturer Identifier" - creates it if necessary
110     */
111    public CWE getManufacturerIdentifier() { 
112                CWE retVal = this.getTypedField(2, 0);
113                return retVal;
114    }
115    
116    /**
117     * Returns
118     * RQ1-2: "Manufacturer Identifier" - creates it if necessary
119     */
120    public CWE getRq12_ManufacturerIdentifier() { 
121                CWE retVal = this.getTypedField(2, 0);
122                return retVal;
123    }
124
125
126
127    /**
128     * Returns
129     * RQ1-3: "Manufacturer's Catalog" - creates it if necessary
130     */
131    public ST getManufacturerSCatalog() { 
132                ST retVal = this.getTypedField(3, 0);
133                return retVal;
134    }
135    
136    /**
137     * Returns
138     * RQ1-3: "Manufacturer's Catalog" - creates it if necessary
139     */
140    public ST getRq13_ManufacturerSCatalog() { 
141                ST retVal = this.getTypedField(3, 0);
142                return retVal;
143    }
144
145
146
147    /**
148     * Returns
149     * RQ1-4: "Vendor ID" - creates it if necessary
150     */
151    public CWE getVendorID() { 
152                CWE retVal = this.getTypedField(4, 0);
153                return retVal;
154    }
155    
156    /**
157     * Returns
158     * RQ1-4: "Vendor ID" - creates it if necessary
159     */
160    public CWE getRq14_VendorID() { 
161                CWE retVal = this.getTypedField(4, 0);
162                return retVal;
163    }
164
165
166
167    /**
168     * Returns
169     * RQ1-5: "Vendor Catalog" - creates it if necessary
170     */
171    public ST getVendorCatalog() { 
172                ST retVal = this.getTypedField(5, 0);
173                return retVal;
174    }
175    
176    /**
177     * Returns
178     * RQ1-5: "Vendor Catalog" - creates it if necessary
179     */
180    public ST getRq15_VendorCatalog() { 
181                ST retVal = this.getTypedField(5, 0);
182                return retVal;
183    }
184
185
186
187    /**
188     * Returns
189     * RQ1-6: "Taxable" - creates it if necessary
190     */
191    public ID getTaxable() { 
192                ID retVal = this.getTypedField(6, 0);
193                return retVal;
194    }
195    
196    /**
197     * Returns
198     * RQ1-6: "Taxable" - creates it if necessary
199     */
200    public ID getRq16_Taxable() { 
201                ID retVal = this.getTypedField(6, 0);
202                return retVal;
203    }
204
205
206
207    /**
208     * Returns
209     * RQ1-7: "Substitute Allowed" - creates it if necessary
210     */
211    public ID getSubstituteAllowed() { 
212                ID retVal = this.getTypedField(7, 0);
213                return retVal;
214    }
215    
216    /**
217     * Returns
218     * RQ1-7: "Substitute Allowed" - creates it if necessary
219     */
220    public ID getRq17_SubstituteAllowed() { 
221                ID retVal = this.getTypedField(7, 0);
222                return retVal;
223    }
224
225
226
227
228
229    /** {@inheritDoc} */   
230    protected Type createNewTypeWithoutReflection(int field) {
231       switch (field) {
232          case 0: return new ST(getMessage());
233          case 1: return new CWE(getMessage());
234          case 2: return new ST(getMessage());
235          case 3: return new CWE(getMessage());
236          case 4: return new ST(getMessage());
237          case 5: return new ID(getMessage(), new Integer( 136 ));
238          case 6: return new ID(getMessage(), new Integer( 136 ));
239          default: return null;
240       }
241   }
242
243
244}
245