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
033package ca.uhn.hl7v2.model.v24.datatype;
034
035import ca.uhn.hl7v2.model.DataTypeException;
036import ca.uhn.hl7v2.model.Message;
037import ca.uhn.hl7v2.model.Type;
038import ca.uhn.hl7v2.model.AbstractComposite;
039
040/**
041 * <p>Represents an HL7 OSD (order sequence) data type. 
042 * This type consists of the following components:</p>
043 * <ul>
044 * <li>sequence/results flag (ID)
045 * <li>placer order number: entity identifier (ST)
046 * <li>placer order number: namespace ID (IS)
047 * <li>filler order number: entity identifier (ST)
048 * <li>filler order number: namespace ID (IS)
049 * <li>sequence condition value (ST)
050 * <li>maximum number of repeats (NM)
051 * <li>placer order number: universal ID (ST)
052 * <li>placer order number; universal ID type (ID)
053 * <li>filler order number: universal ID (ST)
054 * <li>filler order number: universal ID type (ID)
055 * </ul>
056 */
057@SuppressWarnings("unused")
058public class OSD extends AbstractComposite {
059
060    private Type[] data;
061
062    /** 
063     * Creates a new OSD type
064     */
065    public OSD(Message message) {
066        super(message);
067        init();
068    }
069
070    private void init() {
071        data = new Type[11];    
072        data[0] = new ID(getMessage(), 0);
073        data[1] = new ST(getMessage());
074        data[2] = new IS(getMessage(), 0);
075        data[3] = new ST(getMessage());
076        data[4] = new IS(getMessage(), 0);
077        data[5] = new ST(getMessage());
078        data[6] = new NM(getMessage());
079        data[7] = new ST(getMessage());
080        data[8] = new ID(getMessage(), 0);
081        data[9] = new ST(getMessage());
082        data[10] = new ID(getMessage(), 0);
083    }
084
085
086    /**
087     * Returns an array containing the data elements.
088     */
089    public Type[] getComponents() { 
090        return this.data; 
091    }
092
093    /**
094     * Returns an individual data component.
095     *
096     * @param number The component number (0-indexed)
097     * @throws DataTypeException if the given element number is out of range.
098     */
099    public Type getComponent(int number) throws DataTypeException { 
100
101        try { 
102            return this.data[number]; 
103        } catch (ArrayIndexOutOfBoundsException e) { 
104            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
105        } 
106    } 
107
108
109    /**
110     * Returns sequence/results flag (component 1).  This is a convenience method that saves you from 
111     * casting and handling an exception.
112     */
113    public ID getSequenceResultsFlag() {
114       return getTyped(0, ID.class);
115    }
116
117    
118    /**
119     * Returns sequence/results flag (component 1).  This is a convenience method that saves you from 
120     * casting and handling an exception.
121     */
122    public ID getOsd1_SequenceResultsFlag() {
123       return getTyped(0, ID.class);
124    }
125
126
127    /**
128     * Returns placer order number: entity identifier (component 2).  This is a convenience method that saves you from 
129     * casting and handling an exception.
130     */
131    public ST getPlacerOrderNumberEntityIdentifier() {
132       return getTyped(1, ST.class);
133    }
134
135    
136    /**
137     * Returns placer order number: entity identifier (component 2).  This is a convenience method that saves you from 
138     * casting and handling an exception.
139     */
140    public ST getOsd2_PlacerOrderNumberEntityIdentifier() {
141       return getTyped(1, ST.class);
142    }
143
144
145    /**
146     * Returns placer order number: namespace ID (component 3).  This is a convenience method that saves you from 
147     * casting and handling an exception.
148     */
149    public IS getPlacerOrderNumberNamespaceID() {
150       return getTyped(2, IS.class);
151    }
152
153    
154    /**
155     * Returns placer order number: namespace ID (component 3).  This is a convenience method that saves you from 
156     * casting and handling an exception.
157     */
158    public IS getOsd3_PlacerOrderNumberNamespaceID() {
159       return getTyped(2, IS.class);
160    }
161
162
163    /**
164     * Returns filler order number: entity identifier (component 4).  This is a convenience method that saves you from 
165     * casting and handling an exception.
166     */
167    public ST getFillerOrderNumberEntityIdentifier() {
168       return getTyped(3, ST.class);
169    }
170
171    
172    /**
173     * Returns filler order number: entity identifier (component 4).  This is a convenience method that saves you from 
174     * casting and handling an exception.
175     */
176    public ST getOsd4_FillerOrderNumberEntityIdentifier() {
177       return getTyped(3, ST.class);
178    }
179
180
181    /**
182     * Returns filler order number: namespace ID (component 5).  This is a convenience method that saves you from 
183     * casting and handling an exception.
184     */
185    public IS getFillerOrderNumberNamespaceID() {
186       return getTyped(4, IS.class);
187    }
188
189    
190    /**
191     * Returns filler order number: namespace ID (component 5).  This is a convenience method that saves you from 
192     * casting and handling an exception.
193     */
194    public IS getOsd5_FillerOrderNumberNamespaceID() {
195       return getTyped(4, IS.class);
196    }
197
198
199    /**
200     * Returns sequence condition value (component 6).  This is a convenience method that saves you from 
201     * casting and handling an exception.
202     */
203    public ST getSequenceConditionValue() {
204       return getTyped(5, ST.class);
205    }
206
207    
208    /**
209     * Returns sequence condition value (component 6).  This is a convenience method that saves you from 
210     * casting and handling an exception.
211     */
212    public ST getOsd6_SequenceConditionValue() {
213       return getTyped(5, ST.class);
214    }
215
216
217    /**
218     * Returns maximum number of repeats (component 7).  This is a convenience method that saves you from 
219     * casting and handling an exception.
220     */
221    public NM getMaximumNumberOfRepeats() {
222       return getTyped(6, NM.class);
223    }
224
225    
226    /**
227     * Returns maximum number of repeats (component 7).  This is a convenience method that saves you from 
228     * casting and handling an exception.
229     */
230    public NM getOsd7_MaximumNumberOfRepeats() {
231       return getTyped(6, NM.class);
232    }
233
234
235    /**
236     * Returns placer order number: universal ID (component 8).  This is a convenience method that saves you from 
237     * casting and handling an exception.
238     */
239    public ST getPlacerOrderNumberUniversalID() {
240       return getTyped(7, ST.class);
241    }
242
243    
244    /**
245     * Returns placer order number: universal ID (component 8).  This is a convenience method that saves you from 
246     * casting and handling an exception.
247     */
248    public ST getOsd8_PlacerOrderNumberUniversalID() {
249       return getTyped(7, ST.class);
250    }
251
252
253    /**
254     * Returns placer order number; universal ID type (component 9).  This is a convenience method that saves you from 
255     * casting and handling an exception.
256     */
257    public ID getPlacerOrderNumberUniversalIDType() {
258       return getTyped(8, ID.class);
259    }
260
261    
262    /**
263     * Returns placer order number; universal ID type (component 9).  This is a convenience method that saves you from 
264     * casting and handling an exception.
265     */
266    public ID getOsd9_PlacerOrderNumberUniversalIDType() {
267       return getTyped(8, ID.class);
268    }
269
270
271    /**
272     * Returns filler order number: universal ID (component 10).  This is a convenience method that saves you from 
273     * casting and handling an exception.
274     */
275    public ST getFillerOrderNumberUniversalID() {
276       return getTyped(9, ST.class);
277    }
278
279    
280    /**
281     * Returns filler order number: universal ID (component 10).  This is a convenience method that saves you from 
282     * casting and handling an exception.
283     */
284    public ST getOsd10_FillerOrderNumberUniversalID() {
285       return getTyped(9, ST.class);
286    }
287
288
289    /**
290     * Returns filler order number: universal ID type (component 11).  This is a convenience method that saves you from 
291     * casting and handling an exception.
292     */
293    public ID getFillerOrderNumberUniversalIDType() {
294       return getTyped(10, ID.class);
295    }
296
297    
298    /**
299     * Returns filler order number: universal ID type (component 11).  This is a convenience method that saves you from 
300     * casting and handling an exception.
301     */
302    public ID getOsd11_FillerOrderNumberUniversalIDType() {
303       return getTyped(10, ID.class);
304    }
305
306
307
308}
309