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.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 * <p>Represents an HL7 XAD (extended address) data type. 042 * This type consists of the following components:</p> 043 * <ul> 044 * <li>street address (ST) 045 * <li>other designation (ST) 046 * <li>city (ST) 047 * <li>state or province (ST) 048 * <li>zip or postal code (ST) 049 * <li>country (ID) 050 * <li>address type (ID) 051 * <li>other geographic designation (ST) 052 * <li>county/parish code (IS) 053 * <li>census tract (IS) 054 * </ul> 055 */ 056@SuppressWarnings("unused") 057public class XAD extends AbstractComposite { 058 059 private Type[] data; 060 061 /** 062 * Creates a new XAD type 063 */ 064 public XAD(Message message) { 065 super(message); 066 init(); 067 } 068 069 private void init() { 070 data = new Type[10]; 071 data[0] = new ST(getMessage()); 072 data[1] = new ST(getMessage()); 073 data[2] = new ST(getMessage()); 074 data[3] = new ST(getMessage()); 075 data[4] = new ST(getMessage()); 076 data[5] = new ID(getMessage(), 0); 077 data[6] = new ID(getMessage(), 0); 078 data[7] = new ST(getMessage()); 079 data[8] = new IS(getMessage(), 0); 080 data[9] = new IS(getMessage(), 0); 081 } 082 083 084 /** 085 * Returns an array containing the data elements. 086 */ 087 public Type[] getComponents() { 088 return this.data; 089 } 090 091 /** 092 * Returns an individual data component. 093 * 094 * @param number The component number (0-indexed) 095 * @throws DataTypeException if the given element number is out of range. 096 */ 097 public Type getComponent(int number) throws DataTypeException { 098 099 try { 100 return this.data[number]; 101 } catch (ArrayIndexOutOfBoundsException e) { 102 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 103 } 104 } 105 106 107 /** 108 * Returns street address (component 1). This is a convenience method that saves you from 109 * casting and handling an exception. 110 */ 111 public ST getStreetAddress() { 112 return getTyped(0, ST.class); 113 } 114 115 116 /** 117 * Returns street address (component 1). This is a convenience method that saves you from 118 * casting and handling an exception. 119 */ 120 public ST getXad1_StreetAddress() { 121 return getTyped(0, ST.class); 122 } 123 124 125 /** 126 * Returns other designation (component 2). This is a convenience method that saves you from 127 * casting and handling an exception. 128 */ 129 public ST getOtherDesignation() { 130 return getTyped(1, ST.class); 131 } 132 133 134 /** 135 * Returns other designation (component 2). This is a convenience method that saves you from 136 * casting and handling an exception. 137 */ 138 public ST getXad2_OtherDesignation() { 139 return getTyped(1, ST.class); 140 } 141 142 143 /** 144 * Returns city (component 3). This is a convenience method that saves you from 145 * casting and handling an exception. 146 */ 147 public ST getCity() { 148 return getTyped(2, ST.class); 149 } 150 151 152 /** 153 * Returns city (component 3). This is a convenience method that saves you from 154 * casting and handling an exception. 155 */ 156 public ST getXad3_City() { 157 return getTyped(2, ST.class); 158 } 159 160 161 /** 162 * Returns state or province (component 4). This is a convenience method that saves you from 163 * casting and handling an exception. 164 */ 165 public ST getStateOrProvince() { 166 return getTyped(3, ST.class); 167 } 168 169 170 /** 171 * Returns state or province (component 4). This is a convenience method that saves you from 172 * casting and handling an exception. 173 */ 174 public ST getXad4_StateOrProvince() { 175 return getTyped(3, ST.class); 176 } 177 178 179 /** 180 * Returns zip or postal code (component 5). This is a convenience method that saves you from 181 * casting and handling an exception. 182 */ 183 public ST getZipOrPostalCode() { 184 return getTyped(4, ST.class); 185 } 186 187 188 /** 189 * Returns zip or postal code (component 5). This is a convenience method that saves you from 190 * casting and handling an exception. 191 */ 192 public ST getXad5_ZipOrPostalCode() { 193 return getTyped(4, ST.class); 194 } 195 196 197 /** 198 * Returns country (component 6). This is a convenience method that saves you from 199 * casting and handling an exception. 200 */ 201 public ID getCountry() { 202 return getTyped(5, ID.class); 203 } 204 205 206 /** 207 * Returns country (component 6). This is a convenience method that saves you from 208 * casting and handling an exception. 209 */ 210 public ID getXad6_Country() { 211 return getTyped(5, ID.class); 212 } 213 214 215 /** 216 * Returns address type (component 7). This is a convenience method that saves you from 217 * casting and handling an exception. 218 */ 219 public ID getAddressType() { 220 return getTyped(6, ID.class); 221 } 222 223 224 /** 225 * Returns address type (component 7). This is a convenience method that saves you from 226 * casting and handling an exception. 227 */ 228 public ID getXad7_AddressType() { 229 return getTyped(6, ID.class); 230 } 231 232 233 /** 234 * Returns other geographic designation (component 8). This is a convenience method that saves you from 235 * casting and handling an exception. 236 */ 237 public ST getOtherGeographicDesignation() { 238 return getTyped(7, ST.class); 239 } 240 241 242 /** 243 * Returns other geographic designation (component 8). This is a convenience method that saves you from 244 * casting and handling an exception. 245 */ 246 public ST getXad8_OtherGeographicDesignation() { 247 return getTyped(7, ST.class); 248 } 249 250 251 /** 252 * Returns county/parish code (component 9). This is a convenience method that saves you from 253 * casting and handling an exception. 254 */ 255 public IS getCountyParishCode() { 256 return getTyped(8, IS.class); 257 } 258 259 260 /** 261 * Returns county/parish code (component 9). This is a convenience method that saves you from 262 * casting and handling an exception. 263 */ 264 public IS getXad9_CountyParishCode() { 265 return getTyped(8, IS.class); 266 } 267 268 269 /** 270 * Returns census tract (component 10). This is a convenience method that saves you from 271 * casting and handling an exception. 272 */ 273 public IS getCensusTract() { 274 return getTyped(9, IS.class); 275 } 276 277 278 /** 279 * Returns census tract (component 10). This is a convenience method that saves you from 280 * casting and handling an exception. 281 */ 282 public IS getXad10_CensusTract() { 283 return getTyped(9, IS.class); 284 } 285 286 287 288} 289