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.v26.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 RFR (Reference Range) data type. 042 * This type consists of the following components:</p> 043 * <ul> 044 * <li>Numeric Range (NR) 045 * <li>Administrative Sex (IS) 046 * <li>Age Range (NR) 047 * <li>Gestational Age Range (NR) 048 * <li>Species (ST) 049 * <li>Race/subspecies (ST) 050 * <li>Conditions (TX) 051 * </ul> 052 */ 053@SuppressWarnings("unused") 054public class RFR extends AbstractComposite { 055 056 private Type[] data; 057 058 /** 059 * Creates a new RFR type 060 */ 061 public RFR(Message message) { 062 super(message); 063 init(); 064 } 065 066 private void init() { 067 data = new Type[7]; 068 data[0] = new NR(getMessage()); 069 data[1] = new IS(getMessage(), 1); 070 data[2] = new NR(getMessage()); 071 data[3] = new NR(getMessage()); 072 data[4] = new ST(getMessage()); 073 data[5] = new ST(getMessage()); 074 data[6] = new TX(getMessage()); 075 } 076 077 078 /** 079 * Returns an array containing the data elements. 080 */ 081 public Type[] getComponents() { 082 return this.data; 083 } 084 085 /** 086 * Returns an individual data component. 087 * 088 * @param number The component number (0-indexed) 089 * @throws DataTypeException if the given element number is out of range. 090 */ 091 public Type getComponent(int number) throws DataTypeException { 092 093 try { 094 return this.data[number]; 095 } catch (ArrayIndexOutOfBoundsException e) { 096 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 097 } 098 } 099 100 101 /** 102 * Returns Numeric Range (component 1). This is a convenience method that saves you from 103 * casting and handling an exception. 104 */ 105 public NR getNumericRange() { 106 return getTyped(0, NR.class); 107 } 108 109 110 /** 111 * Returns Numeric Range (component 1). This is a convenience method that saves you from 112 * casting and handling an exception. 113 */ 114 public NR getRfr1_NumericRange() { 115 return getTyped(0, NR.class); 116 } 117 118 119 /** 120 * Returns Administrative Sex (component 2). This is a convenience method that saves you from 121 * casting and handling an exception. 122 */ 123 public IS getAdministrativeSex() { 124 return getTyped(1, IS.class); 125 } 126 127 128 /** 129 * Returns Administrative Sex (component 2). This is a convenience method that saves you from 130 * casting and handling an exception. 131 */ 132 public IS getRfr2_AdministrativeSex() { 133 return getTyped(1, IS.class); 134 } 135 136 137 /** 138 * Returns Age Range (component 3). This is a convenience method that saves you from 139 * casting and handling an exception. 140 */ 141 public NR getAgeRange() { 142 return getTyped(2, NR.class); 143 } 144 145 146 /** 147 * Returns Age Range (component 3). This is a convenience method that saves you from 148 * casting and handling an exception. 149 */ 150 public NR getRfr3_AgeRange() { 151 return getTyped(2, NR.class); 152 } 153 154 155 /** 156 * Returns Gestational Age Range (component 4). This is a convenience method that saves you from 157 * casting and handling an exception. 158 */ 159 public NR getGestationalAgeRange() { 160 return getTyped(3, NR.class); 161 } 162 163 164 /** 165 * Returns Gestational Age Range (component 4). This is a convenience method that saves you from 166 * casting and handling an exception. 167 */ 168 public NR getRfr4_GestationalAgeRange() { 169 return getTyped(3, NR.class); 170 } 171 172 173 /** 174 * Returns Species (component 5). This is a convenience method that saves you from 175 * casting and handling an exception. 176 */ 177 public ST getSpecies() { 178 return getTyped(4, ST.class); 179 } 180 181 182 /** 183 * Returns Species (component 5). This is a convenience method that saves you from 184 * casting and handling an exception. 185 */ 186 public ST getRfr5_Species() { 187 return getTyped(4, ST.class); 188 } 189 190 191 /** 192 * Returns Race/subspecies (component 6). This is a convenience method that saves you from 193 * casting and handling an exception. 194 */ 195 public ST getRaceSubspecies() { 196 return getTyped(5, ST.class); 197 } 198 199 200 /** 201 * Returns Race/subspecies (component 6). This is a convenience method that saves you from 202 * casting and handling an exception. 203 */ 204 public ST getRfr6_RaceSubspecies() { 205 return getTyped(5, ST.class); 206 } 207 208 209 /** 210 * Returns Conditions (component 7). This is a convenience method that saves you from 211 * casting and handling an exception. 212 */ 213 public TX getConditions() { 214 return getTyped(6, TX.class); 215 } 216 217 218 /** 219 * Returns Conditions (component 7). This is a convenience method that saves you from 220 * casting and handling an exception. 221 */ 222 public TX getRfr7_Conditions() { 223 return getTyped(6, TX.class); 224 } 225 226 227 228} 229