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 "CM_CSU.java".  Description:
015 * "Composite class CM_CSU"
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2013.  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.v23.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/**
042 * <p>Represents an HL7 CM_CSU (channel sensitivity/units) data type. 
043 * This type consists of the following components:</p>
044 * <ul>
045 * <li>sensitivity (NM)
046 * <li>units identifier (ID)
047 * <li>units text (ST)
048 * <li>units name of coding system (ST)
049 * <li>units alternate identifier (ID)
050 * <li>units alternate text (ST)
051 * <li>units name of alternate coding system (ST)
052 * </ul>
053 */
054@SuppressWarnings("unused")
055public class CM_CSU extends AbstractComposite {
056
057    private Type[] data;
058
059    /** 
060     * Creates a new CM_CSU type
061     */
062    public CM_CSU(Message message) {
063        super(message);
064        init();
065    }
066
067    private void init() {
068        data = new Type[7];    
069        data[0] = new NM(getMessage());
070        data[1] = new ID(getMessage(), 0);
071        data[2] = new ST(getMessage());
072        data[3] = new ST(getMessage());
073        data[4] = new ID(getMessage(), 0);
074        data[5] = new ST(getMessage());
075        data[6] = new ST(getMessage());
076    }
077
078
079    /**
080     * Returns an array containing the data elements.
081     */
082    public Type[] getComponents() { 
083        return this.data; 
084    }
085
086    /**
087     * Returns an individual data component.
088     *
089     * @param number The component number (0-indexed)
090     * @throws DataTypeException if the given element number is out of range.
091     */
092    public Type getComponent(int number) throws DataTypeException { 
093
094        try { 
095            return this.data[number]; 
096        } catch (ArrayIndexOutOfBoundsException e) { 
097            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
098        } 
099    } 
100
101
102    /**
103     * Returns sensitivity (component 1).  This is a convenience method that saves you from 
104     * casting and handling an exception.
105     */
106    public NM getSensitivity() {
107       return getTyped(0, NM.class);
108    }
109
110    
111    /**
112     * Returns sensitivity (component 1).  This is a convenience method that saves you from 
113     * casting and handling an exception.
114     */
115    public NM getCm_csu1_Sensitivity() {
116       return getTyped(0, NM.class);
117    }
118
119
120    /**
121     * Returns units identifier (component 2).  This is a convenience method that saves you from 
122     * casting and handling an exception.
123     */
124    public ID getUnitsIdentifier() {
125       return getTyped(1, ID.class);
126    }
127
128    
129    /**
130     * Returns units identifier (component 2).  This is a convenience method that saves you from 
131     * casting and handling an exception.
132     */
133    public ID getCm_csu2_UnitsIdentifier() {
134       return getTyped(1, ID.class);
135    }
136
137
138    /**
139     * Returns units text (component 3).  This is a convenience method that saves you from 
140     * casting and handling an exception.
141     */
142    public ST getUnitsText() {
143       return getTyped(2, ST.class);
144    }
145
146    
147    /**
148     * Returns units text (component 3).  This is a convenience method that saves you from 
149     * casting and handling an exception.
150     */
151    public ST getCm_csu3_UnitsText() {
152       return getTyped(2, ST.class);
153    }
154
155
156    /**
157     * Returns units name of coding system (component 4).  This is a convenience method that saves you from 
158     * casting and handling an exception.
159     */
160    public ST getUnitsNameOfCodingSystem() {
161       return getTyped(3, ST.class);
162    }
163
164    
165    /**
166     * Returns units name of coding system (component 4).  This is a convenience method that saves you from 
167     * casting and handling an exception.
168     */
169    public ST getCm_csu4_UnitsNameOfCodingSystem() {
170       return getTyped(3, ST.class);
171    }
172
173
174    /**
175     * Returns units alternate identifier (component 5).  This is a convenience method that saves you from 
176     * casting and handling an exception.
177     */
178    public ID getUnitsAlternateIdentifier() {
179       return getTyped(4, ID.class);
180    }
181
182    
183    /**
184     * Returns units alternate identifier (component 5).  This is a convenience method that saves you from 
185     * casting and handling an exception.
186     */
187    public ID getCm_csu5_UnitsAlternateIdentifier() {
188       return getTyped(4, ID.class);
189    }
190
191
192    /**
193     * Returns units alternate text (component 6).  This is a convenience method that saves you from 
194     * casting and handling an exception.
195     */
196    public ST getUnitsAlternateText() {
197       return getTyped(5, ST.class);
198    }
199
200    
201    /**
202     * Returns units alternate text (component 6).  This is a convenience method that saves you from 
203     * casting and handling an exception.
204     */
205    public ST getCm_csu6_UnitsAlternateText() {
206       return getTyped(5, ST.class);
207    }
208
209
210    /**
211     * Returns units name of alternate coding system (component 7).  This is a convenience method that saves you from 
212     * casting and handling an exception.
213     */
214    public ST getUnitsNameOfAlternateCodingSystem() {
215       return getTyped(6, ST.class);
216    }
217
218    
219    /**
220     * Returns units name of alternate coding system (component 7).  This is a convenience method that saves you from 
221     * casting and handling an exception.
222     */
223    public ST getCm_csu7_UnitsNameOfAlternateCodingSystem() {
224       return getTyped(6, ST.class);
225    }
226
227
228
229}
230