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 "XAD.java". Description: 15 * "Composite class XAD" 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 XAD (Extended Address) data type. 43 * This type consists of the following components:</p> 44 * <ul> 45 * <li>Street Address (SAD) 46 * <li>Other Designation (ST) 47 * <li>City (ST) 48 * <li>State or Province (ST) 49 * <li>Zip or Postal Code (ST) 50 * <li>Country (ID) 51 * <li>Address Type (ID) 52 * <li>Other Geographic Designation (ST) 53 * <li>County/Parish Code (CWE) 54 * <li>Census Tract (CWE) 55 * <li>Address Representation Code (ID) 56 * <li>Address Validity Range (NULLDT) 57 * <li>Effective Date (DTM) 58 * <li>Expiration Date (DTM) 59 * <li>Expiration Reason (CWE) 60 * <li>Temporary Indicator (ID) 61 * <li>Bad Address Indicator (ID) 62 * <li>Address Usage (ID) 63 * <li>Addressee (ST) 64 * <li>Comment (ST) 65 * <li>Preference Order (NM) 66 * <li>Protection Code (CWE) 67 * <li>Address Identifier (EI) 68 * </ul> 69 */ 70 @SuppressWarnings("unused") 71 public class XAD extends AbstractComposite { 72 73 private Type[] data; 74 75 /** 76 * Creates a new XAD type 77 */ 78 public XAD(Message message) { 79 super(message); 80 init(); 81 } 82 83 private void init() { 84 data = new Type[23]; 85 data[0] = new SAD(getMessage()); 86 data[1] = new ST(getMessage()); 87 data[2] = new ST(getMessage()); 88 data[3] = new ST(getMessage()); 89 data[4] = new ST(getMessage()); 90 data[5] = new ID(getMessage(), 399); 91 data[6] = new ID(getMessage(), 190); 92 data[7] = new ST(getMessage()); 93 data[8] = new CWE(getMessage()); 94 data[9] = new CWE(getMessage()); 95 data[10] = new ID(getMessage(), 465); 96 data[11] = new NULLDT(getMessage()); 97 data[12] = new DTM(getMessage()); 98 data[13] = new DTM(getMessage()); 99 data[14] = new CWE(getMessage()); 100 data[15] = new ID(getMessage(), 136); 101 data[16] = new ID(getMessage(), 136); 102 data[17] = new ID(getMessage(), 617); 103 data[18] = new ST(getMessage()); 104 data[19] = new ST(getMessage()); 105 data[20] = new NM(getMessage()); 106 data[21] = new CWE(getMessage()); 107 data[22] = new EI(getMessage()); 108 } 109 110 111 /** 112 * Returns an array containing the data elements. 113 */ 114 public Type[] getComponents() { 115 return this.data; 116 } 117 118 /** 119 * Returns an individual data component. 120 * 121 * @param number The component number (0-indexed) 122 * @throws DataTypeException if the given element number is out of range. 123 */ 124 public Type getComponent(int number) throws DataTypeException { 125 126 try { 127 return this.data[number]; 128 } catch (ArrayIndexOutOfBoundsException e) { 129 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 130 } 131 } 132 133 134 /** 135 * Returns Street Address (component 1). This is a convenience method that saves you from 136 * casting and handling an exception. 137 */ 138 public SAD getStreetAddress() { 139 return getTyped(0, SAD.class); 140 } 141 142 143 /** 144 * Returns Street Address (component 1). This is a convenience method that saves you from 145 * casting and handling an exception. 146 */ 147 public SAD getXad1_StreetAddress() { 148 return getTyped(0, SAD.class); 149 } 150 151 152 /** 153 * Returns Other Designation (component 2). This is a convenience method that saves you from 154 * casting and handling an exception. 155 */ 156 public ST getOtherDesignation() { 157 return getTyped(1, ST.class); 158 } 159 160 161 /** 162 * Returns Other Designation (component 2). This is a convenience method that saves you from 163 * casting and handling an exception. 164 */ 165 public ST getXad2_OtherDesignation() { 166 return getTyped(1, ST.class); 167 } 168 169 170 /** 171 * Returns City (component 3). This is a convenience method that saves you from 172 * casting and handling an exception. 173 */ 174 public ST getCity() { 175 return getTyped(2, ST.class); 176 } 177 178 179 /** 180 * Returns City (component 3). This is a convenience method that saves you from 181 * casting and handling an exception. 182 */ 183 public ST getXad3_City() { 184 return getTyped(2, ST.class); 185 } 186 187 188 /** 189 * Returns State or Province (component 4). This is a convenience method that saves you from 190 * casting and handling an exception. 191 */ 192 public ST getStateOrProvince() { 193 return getTyped(3, ST.class); 194 } 195 196 197 /** 198 * Returns State or Province (component 4). This is a convenience method that saves you from 199 * casting and handling an exception. 200 */ 201 public ST getXad4_StateOrProvince() { 202 return getTyped(3, ST.class); 203 } 204 205 206 /** 207 * Returns Zip or Postal Code (component 5). This is a convenience method that saves you from 208 * casting and handling an exception. 209 */ 210 public ST getZipOrPostalCode() { 211 return getTyped(4, ST.class); 212 } 213 214 215 /** 216 * Returns Zip or Postal Code (component 5). This is a convenience method that saves you from 217 * casting and handling an exception. 218 */ 219 public ST getXad5_ZipOrPostalCode() { 220 return getTyped(4, ST.class); 221 } 222 223 224 /** 225 * Returns Country (component 6). This is a convenience method that saves you from 226 * casting and handling an exception. 227 */ 228 public ID getCountry() { 229 return getTyped(5, ID.class); 230 } 231 232 233 /** 234 * Returns Country (component 6). This is a convenience method that saves you from 235 * casting and handling an exception. 236 */ 237 public ID getXad6_Country() { 238 return getTyped(5, ID.class); 239 } 240 241 242 /** 243 * Returns Address Type (component 7). This is a convenience method that saves you from 244 * casting and handling an exception. 245 */ 246 public ID getAddressType() { 247 return getTyped(6, ID.class); 248 } 249 250 251 /** 252 * Returns Address Type (component 7). This is a convenience method that saves you from 253 * casting and handling an exception. 254 */ 255 public ID getXad7_AddressType() { 256 return getTyped(6, ID.class); 257 } 258 259 260 /** 261 * Returns Other Geographic Designation (component 8). This is a convenience method that saves you from 262 * casting and handling an exception. 263 */ 264 public ST getOtherGeographicDesignation() { 265 return getTyped(7, ST.class); 266 } 267 268 269 /** 270 * Returns Other Geographic Designation (component 8). This is a convenience method that saves you from 271 * casting and handling an exception. 272 */ 273 public ST getXad8_OtherGeographicDesignation() { 274 return getTyped(7, ST.class); 275 } 276 277 278 /** 279 * Returns County/Parish Code (component 9). This is a convenience method that saves you from 280 * casting and handling an exception. 281 */ 282 public CWE getCountyParishCode() { 283 return getTyped(8, CWE.class); 284 } 285 286 287 /** 288 * Returns County/Parish Code (component 9). This is a convenience method that saves you from 289 * casting and handling an exception. 290 */ 291 public CWE getXad9_CountyParishCode() { 292 return getTyped(8, CWE.class); 293 } 294 295 296 /** 297 * Returns Census Tract (component 10). This is a convenience method that saves you from 298 * casting and handling an exception. 299 */ 300 public CWE getCensusTract() { 301 return getTyped(9, CWE.class); 302 } 303 304 305 /** 306 * Returns Census Tract (component 10). This is a convenience method that saves you from 307 * casting and handling an exception. 308 */ 309 public CWE getXad10_CensusTract() { 310 return getTyped(9, CWE.class); 311 } 312 313 314 /** 315 * Returns Address Representation Code (component 11). This is a convenience method that saves you from 316 * casting and handling an exception. 317 */ 318 public ID getAddressRepresentationCode() { 319 return getTyped(10, ID.class); 320 } 321 322 323 /** 324 * Returns Address Representation Code (component 11). This is a convenience method that saves you from 325 * casting and handling an exception. 326 */ 327 public ID getXad11_AddressRepresentationCode() { 328 return getTyped(10, ID.class); 329 } 330 331 332 /** 333 * Returns Address Validity Range (component 12). This is a convenience method that saves you from 334 * casting and handling an exception. 335 */ 336 public NULLDT getAddressValidityRange() { 337 return getTyped(11, NULLDT.class); 338 } 339 340 341 /** 342 * Returns Address Validity Range (component 12). This is a convenience method that saves you from 343 * casting and handling an exception. 344 */ 345 public NULLDT getXad12_AddressValidityRange() { 346 return getTyped(11, NULLDT.class); 347 } 348 349 350 /** 351 * Returns Effective Date (component 13). This is a convenience method that saves you from 352 * casting and handling an exception. 353 */ 354 public DTM getEffectiveDate() { 355 return getTyped(12, DTM.class); 356 } 357 358 359 /** 360 * Returns Effective Date (component 13). This is a convenience method that saves you from 361 * casting and handling an exception. 362 */ 363 public DTM getXad13_EffectiveDate() { 364 return getTyped(12, DTM.class); 365 } 366 367 368 /** 369 * Returns Expiration Date (component 14). This is a convenience method that saves you from 370 * casting and handling an exception. 371 */ 372 public DTM getExpirationDate() { 373 return getTyped(13, DTM.class); 374 } 375 376 377 /** 378 * Returns Expiration Date (component 14). This is a convenience method that saves you from 379 * casting and handling an exception. 380 */ 381 public DTM getXad14_ExpirationDate() { 382 return getTyped(13, DTM.class); 383 } 384 385 386 /** 387 * Returns Expiration Reason (component 15). This is a convenience method that saves you from 388 * casting and handling an exception. 389 */ 390 public CWE getExpirationReason() { 391 return getTyped(14, CWE.class); 392 } 393 394 395 /** 396 * Returns Expiration Reason (component 15). This is a convenience method that saves you from 397 * casting and handling an exception. 398 */ 399 public CWE getXad15_ExpirationReason() { 400 return getTyped(14, CWE.class); 401 } 402 403 404 /** 405 * Returns Temporary Indicator (component 16). This is a convenience method that saves you from 406 * casting and handling an exception. 407 */ 408 public ID getTemporaryIndicator() { 409 return getTyped(15, ID.class); 410 } 411 412 413 /** 414 * Returns Temporary Indicator (component 16). This is a convenience method that saves you from 415 * casting and handling an exception. 416 */ 417 public ID getXad16_TemporaryIndicator() { 418 return getTyped(15, ID.class); 419 } 420 421 422 /** 423 * Returns Bad Address Indicator (component 17). This is a convenience method that saves you from 424 * casting and handling an exception. 425 */ 426 public ID getBadAddressIndicator() { 427 return getTyped(16, ID.class); 428 } 429 430 431 /** 432 * Returns Bad Address Indicator (component 17). This is a convenience method that saves you from 433 * casting and handling an exception. 434 */ 435 public ID getXad17_BadAddressIndicator() { 436 return getTyped(16, ID.class); 437 } 438 439 440 /** 441 * Returns Address Usage (component 18). This is a convenience method that saves you from 442 * casting and handling an exception. 443 */ 444 public ID getAddressUsage() { 445 return getTyped(17, ID.class); 446 } 447 448 449 /** 450 * Returns Address Usage (component 18). This is a convenience method that saves you from 451 * casting and handling an exception. 452 */ 453 public ID getXad18_AddressUsage() { 454 return getTyped(17, ID.class); 455 } 456 457 458 /** 459 * Returns Addressee (component 19). This is a convenience method that saves you from 460 * casting and handling an exception. 461 */ 462 public ST getAddressee() { 463 return getTyped(18, ST.class); 464 } 465 466 467 /** 468 * Returns Addressee (component 19). This is a convenience method that saves you from 469 * casting and handling an exception. 470 */ 471 public ST getXad19_Addressee() { 472 return getTyped(18, ST.class); 473 } 474 475 476 /** 477 * Returns Comment (component 20). This is a convenience method that saves you from 478 * casting and handling an exception. 479 */ 480 public ST getComment() { 481 return getTyped(19, ST.class); 482 } 483 484 485 /** 486 * Returns Comment (component 20). This is a convenience method that saves you from 487 * casting and handling an exception. 488 */ 489 public ST getXad20_Comment() { 490 return getTyped(19, ST.class); 491 } 492 493 494 /** 495 * Returns Preference Order (component 21). This is a convenience method that saves you from 496 * casting and handling an exception. 497 */ 498 public NM getPreferenceOrder() { 499 return getTyped(20, NM.class); 500 } 501 502 503 /** 504 * Returns Preference Order (component 21). This is a convenience method that saves you from 505 * casting and handling an exception. 506 */ 507 public NM getXad21_PreferenceOrder() { 508 return getTyped(20, NM.class); 509 } 510 511 512 /** 513 * Returns Protection Code (component 22). This is a convenience method that saves you from 514 * casting and handling an exception. 515 */ 516 public CWE getProtectionCode() { 517 return getTyped(21, CWE.class); 518 } 519 520 521 /** 522 * Returns Protection Code (component 22). This is a convenience method that saves you from 523 * casting and handling an exception. 524 */ 525 public CWE getXad22_ProtectionCode() { 526 return getTyped(21, CWE.class); 527 } 528 529 530 /** 531 * Returns Address Identifier (component 23). This is a convenience method that saves you from 532 * casting and handling an exception. 533 */ 534 public EI getAddressIdentifier() { 535 return getTyped(22, EI.class); 536 } 537 538 539 /** 540 * Returns Address Identifier (component 23). This is a convenience method that saves you from 541 * casting and handling an exception. 542 */ 543 public EI getXad23_AddressIdentifier() { 544 return getTyped(22, EI.class); 545 } 546 547 548 549 } 550