View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "RFR.java".  Description:
15   * "Composite class RFR"
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2013.  All Rights Reserved.
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  package ca.uhn.hl7v2.model.v27.datatype;
34  
35  import ca.uhn.hl7v2.model.DataTypeException;
36  import ca.uhn.hl7v2.model.Message;
37  import ca.uhn.hl7v2.model.Type;
38  import ca.uhn.hl7v2.model.AbstractComposite;
39  
40  
41  /**
42   * <p>Represents an HL7 RFR (Reference Range) data type. 
43   * This type consists of the following components:</p>
44   * <ul>
45   * <li>Numeric Range (NR)
46   * <li>Administrative Sex (CWE)
47   * <li>Age Range (NR)
48   * <li>Gestational Age Range (NR)
49   * <li>Species (ST)
50   * <li>Race/subspecies (ST)
51   * <li>Conditions (TX)
52   * </ul>
53   */
54  @SuppressWarnings("unused")
55  public class RFR extends AbstractComposite {
56  
57      private Type[] data;
58  
59      /** 
60       * Creates a new RFR type
61       */
62      public RFR(Message message) {
63          super(message);
64          init();
65      }
66  
67      private void init() {
68          data = new Type[7];    
69          data[0] = new NR(getMessage());
70          data[1] = new CWE(getMessage());
71          data[2] = new NR(getMessage());
72          data[3] = new NR(getMessage());
73          data[4] = new ST(getMessage());
74          data[5] = new ST(getMessage());
75          data[6] = new TX(getMessage());
76      }
77  
78  
79      /**
80       * Returns an array containing the data elements.
81       */
82      public Type[] getComponents() { 
83          return this.data; 
84      }
85  
86      /**
87       * Returns an individual data component.
88       *
89       * @param number The component number (0-indexed)
90       * @throws DataTypeException if the given element number is out of range.
91       */
92      public Type getComponent(int number) throws DataTypeException { 
93  
94          try { 
95              return this.data[number]; 
96          } catch (ArrayIndexOutOfBoundsException e) { 
97              throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 
98          } 
99      } 
100 
101 
102     /**
103      * Returns Numeric Range (component 1).  This is a convenience method that saves you from 
104      * casting and handling an exception.
105      */
106     public NR getNumericRange() {
107        return getTyped(0, NR.class);
108     }
109 
110     
111     /**
112      * Returns Numeric Range (component 1).  This is a convenience method that saves you from 
113      * casting and handling an exception.
114      */
115     public NR getRfr1_NumericRange() {
116        return getTyped(0, NR.class);
117     }
118 
119 
120     /**
121      * Returns Administrative Sex (component 2).  This is a convenience method that saves you from 
122      * casting and handling an exception.
123      */
124     public CWE getAdministrativeSex() {
125        return getTyped(1, CWE.class);
126     }
127 
128     
129     /**
130      * Returns Administrative Sex (component 2).  This is a convenience method that saves you from 
131      * casting and handling an exception.
132      */
133     public CWE getRfr2_AdministrativeSex() {
134        return getTyped(1, CWE.class);
135     }
136 
137 
138     /**
139      * Returns Age Range (component 3).  This is a convenience method that saves you from 
140      * casting and handling an exception.
141      */
142     public NR getAgeRange() {
143        return getTyped(2, NR.class);
144     }
145 
146     
147     /**
148      * Returns Age Range (component 3).  This is a convenience method that saves you from 
149      * casting and handling an exception.
150      */
151     public NR getRfr3_AgeRange() {
152        return getTyped(2, NR.class);
153     }
154 
155 
156     /**
157      * Returns Gestational Age Range (component 4).  This is a convenience method that saves you from 
158      * casting and handling an exception.
159      */
160     public NR getGestationalAgeRange() {
161        return getTyped(3, NR.class);
162     }
163 
164     
165     /**
166      * Returns Gestational Age Range (component 4).  This is a convenience method that saves you from 
167      * casting and handling an exception.
168      */
169     public NR getRfr4_GestationalAgeRange() {
170        return getTyped(3, NR.class);
171     }
172 
173 
174     /**
175      * Returns Species (component 5).  This is a convenience method that saves you from 
176      * casting and handling an exception.
177      */
178     public ST getSpecies() {
179        return getTyped(4, ST.class);
180     }
181 
182     
183     /**
184      * Returns Species (component 5).  This is a convenience method that saves you from 
185      * casting and handling an exception.
186      */
187     public ST getRfr5_Species() {
188        return getTyped(4, ST.class);
189     }
190 
191 
192     /**
193      * Returns Race/subspecies (component 6).  This is a convenience method that saves you from 
194      * casting and handling an exception.
195      */
196     public ST getRaceSubspecies() {
197        return getTyped(5, ST.class);
198     }
199 
200     
201     /**
202      * Returns Race/subspecies (component 6).  This is a convenience method that saves you from 
203      * casting and handling an exception.
204      */
205     public ST getRfr6_RaceSubspecies() {
206        return getTyped(5, ST.class);
207     }
208 
209 
210     /**
211      * Returns Conditions (component 7).  This is a convenience method that saves you from 
212      * casting and handling an exception.
213      */
214     public TX getConditions() {
215        return getTyped(6, TX.class);
216     }
217 
218     
219     /**
220      * Returns Conditions (component 7).  This is a convenience method that saves you from 
221      * casting and handling an exception.
222      */
223     public TX getRfr7_Conditions() {
224        return getTyped(6, TX.class);
225     }
226 
227 
228 
229 }
230