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.v22.segment;
035
036// import ca.uhn.hl7v2.model.v22.group.*;
037import ca.uhn.hl7v2.model.v22.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 RXA message segment (PHARMACY AADMINISTRATION). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>RXA-1: Give Sub-ID Counter (NM) <b> </b>
053     * <li>RXA-2: Administration Sub-ID Counter (NM) <b> </b>
054     * <li>RXA-3: Date / time start of administration (TS) <b> </b>
055     * <li>RXA-4: Date / time end of administration (TS) <b> </b>
056     * <li>RXA-5: Administered Code (CE) <b> </b>
057     * <li>RXA-6: Administered Amount (NM) <b> </b>
058     * <li>RXA-7: Administered Units (CE) <b>optional </b>
059     * <li>RXA-8: Administered Dosage Form (CE) <b>optional </b>
060     * <li>RXA-9: Administration Notes (ST) <b>optional </b>
061     * <li>RXA-10: Administering Provider (CN) <b>optional </b>
062     * <li>RXA-11: Administered-at Location (CM_LA1) <b>optional </b>
063     * <li>RXA-12: Administered Per (Time Unit) (ST) <b>optional </b>
064 * </ul>
065 */
066@SuppressWarnings("unused")
067public class RXA extends AbstractSegment {
068
069    /** 
070     * Creates a new RXA segment
071     */
072    public RXA(Group parent, ModelClassFactory factory) {
073       super(parent, factory);
074       init(factory);
075    }
076
077    private void init(ModelClassFactory factory) {
078       try {
079                                  this.add(NM.class, true, 1, 4, new Object[]{ getMessage() }, "Give Sub-ID Counter");
080                                  this.add(NM.class, true, 1, 4, new Object[]{ getMessage() }, "Administration Sub-ID Counter");
081                                  this.add(TS.class, true, 1, 26, new Object[]{ getMessage() }, "Date / time start of administration");
082                                  this.add(TS.class, true, 1, 26, new Object[]{ getMessage() }, "Date / time end of administration");
083                                  this.add(CE.class, true, 1, 100, new Object[]{ getMessage() }, "Administered Code");
084                                  this.add(NM.class, true, 1, 20, new Object[]{ getMessage() }, "Administered Amount");
085                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Administered Units");
086                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Administered Dosage Form");
087                                  this.add(ST.class, false, 1, 200, new Object[]{ getMessage() }, "Administration Notes");
088                                  this.add(CN.class, false, 1, 200, new Object[]{ getMessage() }, "Administering Provider");
089                                  this.add(CM_LA1.class, false, 1, 12, new Object[]{ getMessage() }, "Administered-at Location");
090                                  this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "Administered Per (Time Unit)");
091       } catch(HL7Exception e) {
092          log.error("Unexpected error creating RXA - this is probably a bug in the source code generator.", e);
093       }
094    }
095
096
097
098    /**
099     * Returns
100     * RXA-1: "Give Sub-ID Counter" - creates it if necessary
101     */
102    public NM getGiveSubIDCounter() { 
103                NM retVal = this.getTypedField(1, 0);
104                return retVal;
105    }
106    
107    /**
108     * Returns
109     * RXA-1: "Give Sub-ID Counter" - creates it if necessary
110     */
111    public NM getRxa1_GiveSubIDCounter() { 
112                NM retVal = this.getTypedField(1, 0);
113                return retVal;
114    }
115
116
117
118    /**
119     * Returns
120     * RXA-2: "Administration Sub-ID Counter" - creates it if necessary
121     */
122    public NM getAdministrationSubIDCounter() { 
123                NM retVal = this.getTypedField(2, 0);
124                return retVal;
125    }
126    
127    /**
128     * Returns
129     * RXA-2: "Administration Sub-ID Counter" - creates it if necessary
130     */
131    public NM getRxa2_AdministrationSubIDCounter() { 
132                NM retVal = this.getTypedField(2, 0);
133                return retVal;
134    }
135
136
137
138    /**
139     * Returns
140     * RXA-3: "Date / time start of administration" - creates it if necessary
141     */
142    public TS getDateTimeStartOfAdministration() { 
143                TS retVal = this.getTypedField(3, 0);
144                return retVal;
145    }
146    
147    /**
148     * Returns
149     * RXA-3: "Date / time start of administration" - creates it if necessary
150     */
151    public TS getRxa3_DateTimeStartOfAdministration() { 
152                TS retVal = this.getTypedField(3, 0);
153                return retVal;
154    }
155
156
157
158    /**
159     * Returns
160     * RXA-4: "Date / time end of administration" - creates it if necessary
161     */
162    public TS getDateTimeEndOfAdministration() { 
163                TS retVal = this.getTypedField(4, 0);
164                return retVal;
165    }
166    
167    /**
168     * Returns
169     * RXA-4: "Date / time end of administration" - creates it if necessary
170     */
171    public TS getRxa4_DateTimeEndOfAdministration() { 
172                TS retVal = this.getTypedField(4, 0);
173                return retVal;
174    }
175
176
177
178    /**
179     * Returns
180     * RXA-5: "Administered Code" - creates it if necessary
181     */
182    public CE getAdministeredCode() { 
183                CE retVal = this.getTypedField(5, 0);
184                return retVal;
185    }
186    
187    /**
188     * Returns
189     * RXA-5: "Administered Code" - creates it if necessary
190     */
191    public CE getRxa5_AdministeredCode() { 
192                CE retVal = this.getTypedField(5, 0);
193                return retVal;
194    }
195
196
197
198    /**
199     * Returns
200     * RXA-6: "Administered Amount" - creates it if necessary
201     */
202    public NM getAdministeredAmount() { 
203                NM retVal = this.getTypedField(6, 0);
204                return retVal;
205    }
206    
207    /**
208     * Returns
209     * RXA-6: "Administered Amount" - creates it if necessary
210     */
211    public NM getRxa6_AdministeredAmount() { 
212                NM retVal = this.getTypedField(6, 0);
213                return retVal;
214    }
215
216
217
218    /**
219     * Returns
220     * RXA-7: "Administered Units" - creates it if necessary
221     */
222    public CE getAdministeredUnits() { 
223                CE retVal = this.getTypedField(7, 0);
224                return retVal;
225    }
226    
227    /**
228     * Returns
229     * RXA-7: "Administered Units" - creates it if necessary
230     */
231    public CE getRxa7_AdministeredUnits() { 
232                CE retVal = this.getTypedField(7, 0);
233                return retVal;
234    }
235
236
237
238    /**
239     * Returns
240     * RXA-8: "Administered Dosage Form" - creates it if necessary
241     */
242    public CE getAdministeredDosageForm() { 
243                CE retVal = this.getTypedField(8, 0);
244                return retVal;
245    }
246    
247    /**
248     * Returns
249     * RXA-8: "Administered Dosage Form" - creates it if necessary
250     */
251    public CE getRxa8_AdministeredDosageForm() { 
252                CE retVal = this.getTypedField(8, 0);
253                return retVal;
254    }
255
256
257
258    /**
259     * Returns
260     * RXA-9: "Administration Notes" - creates it if necessary
261     */
262    public ST getAdministrationNotes() { 
263                ST retVal = this.getTypedField(9, 0);
264                return retVal;
265    }
266    
267    /**
268     * Returns
269     * RXA-9: "Administration Notes" - creates it if necessary
270     */
271    public ST getRxa9_AdministrationNotes() { 
272                ST retVal = this.getTypedField(9, 0);
273                return retVal;
274    }
275
276
277
278    /**
279     * Returns
280     * RXA-10: "Administering Provider" - creates it if necessary
281     */
282    public CN getAdministeringProvider() { 
283                CN retVal = this.getTypedField(10, 0);
284                return retVal;
285    }
286    
287    /**
288     * Returns
289     * RXA-10: "Administering Provider" - creates it if necessary
290     */
291    public CN getRxa10_AdministeringProvider() { 
292                CN retVal = this.getTypedField(10, 0);
293                return retVal;
294    }
295
296
297
298    /**
299     * Returns
300     * RXA-11: "Administered-at Location" - creates it if necessary
301     */
302    public CM_LA1 getAdministeredAtLocation() { 
303                CM_LA1 retVal = this.getTypedField(11, 0);
304                return retVal;
305    }
306    
307    /**
308     * Returns
309     * RXA-11: "Administered-at Location" - creates it if necessary
310     */
311    public CM_LA1 getRxa11_AdministeredAtLocation() { 
312                CM_LA1 retVal = this.getTypedField(11, 0);
313                return retVal;
314    }
315
316
317
318    /**
319     * Returns
320     * RXA-12: "Administered Per (Time Unit)" - creates it if necessary
321     */
322    public ST getAdministeredPerTimeUnit() { 
323                ST retVal = this.getTypedField(12, 0);
324                return retVal;
325    }
326    
327    /**
328     * Returns
329     * RXA-12: "Administered Per (Time Unit)" - creates it if necessary
330     */
331    public ST getRxa12_AdministeredPerTimeUnit() { 
332                ST retVal = this.getTypedField(12, 0);
333                return retVal;
334    }
335
336
337
338
339
340    /** {@inheritDoc} */   
341    protected Type createNewTypeWithoutReflection(int field) {
342       switch (field) {
343          case 0: return new NM(getMessage());
344          case 1: return new NM(getMessage());
345          case 2: return new TS(getMessage());
346          case 3: return new TS(getMessage());
347          case 4: return new CE(getMessage());
348          case 5: return new NM(getMessage());
349          case 6: return new CE(getMessage());
350          case 7: return new CE(getMessage());
351          case 8: return new ST(getMessage());
352          case 9: return new CN(getMessage());
353          case 10: return new CM_LA1(getMessage());
354          case 11: return new ST(getMessage());
355          default: return null;
356       }
357   }
358
359
360}
361