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 "CWE.java". Description: 15 * "Composite class CWE" 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 CWE (Coded with Exceptions) data type. 43 * This type consists of the following components:</p> 44 * <ul> 45 * <li>Identifier (ST) 46 * <li>Text (ST) 47 * <li>Name of Coding System (ID) 48 * <li>Alternate Identifier (ST) 49 * <li>Alternate Text (ST) 50 * <li>Name of Alternate Coding System (ID) 51 * <li>Coding System Version ID (ST) 52 * <li>Alternate Coding System Version ID (ST) 53 * <li>Original Text (ST) 54 * <li>Second Alternate Identifier (ST) 55 * <li>Second Alternate Text (ST) 56 * <li>Name of Second Alternate Coding System (ID) 57 * <li>Second Alternate Coding System Version ID (ST) 58 * <li>Coding System OID (ST) 59 * <li>Value Set OID (ST) 60 * <li>Value Set Version ID (DTM) 61 * <li>Alternate Coding System OID (ST) 62 * <li>Alternate Value Set OID (ST) 63 * <li>Alternate Value Set Version ID (DTM) 64 * <li>Second Alternate Coding System OID (ST) 65 * <li>Second Alternate Value Set OID (ST) 66 * <li>Second Alternate Value Set Version ID (DTM) 67 * </ul> 68 */ 69 @SuppressWarnings("unused") 70 public class CWE extends AbstractComposite { 71 72 private Type[] data; 73 74 /** 75 * Creates a new CWE type 76 */ 77 public CWE(Message message) { 78 super(message); 79 init(); 80 } 81 82 private void init() { 83 data = new Type[22]; 84 data[0] = new ST(getMessage()); 85 data[1] = new ST(getMessage()); 86 data[2] = new ID(getMessage(), 396); 87 data[3] = new ST(getMessage()); 88 data[4] = new ST(getMessage()); 89 data[5] = new ID(getMessage(), 396); 90 data[6] = new ST(getMessage()); 91 data[7] = new ST(getMessage()); 92 data[8] = new ST(getMessage()); 93 data[9] = new ST(getMessage()); 94 data[10] = new ST(getMessage()); 95 data[11] = new ID(getMessage(), 396); 96 data[12] = new ST(getMessage()); 97 data[13] = new ST(getMessage()); 98 data[14] = new ST(getMessage()); 99 data[15] = new DTM(getMessage()); 100 data[16] = new ST(getMessage()); 101 data[17] = new ST(getMessage()); 102 data[18] = new DTM(getMessage()); 103 data[19] = new ST(getMessage()); 104 data[20] = new ST(getMessage()); 105 data[21] = new DTM(getMessage()); 106 } 107 108 109 /** 110 * Returns an array containing the data elements. 111 */ 112 public Type[] getComponents() { 113 return this.data; 114 } 115 116 /** 117 * Returns an individual data component. 118 * 119 * @param number The component number (0-indexed) 120 * @throws DataTypeException if the given element number is out of range. 121 */ 122 public Type getComponent(int number) throws DataTypeException { 123 124 try { 125 return this.data[number]; 126 } catch (ArrayIndexOutOfBoundsException e) { 127 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 128 } 129 } 130 131 132 /** 133 * Returns Identifier (component 1). This is a convenience method that saves you from 134 * casting and handling an exception. 135 */ 136 public ST getIdentifier() { 137 return getTyped(0, ST.class); 138 } 139 140 141 /** 142 * Returns Identifier (component 1). This is a convenience method that saves you from 143 * casting and handling an exception. 144 */ 145 public ST getCwe1_Identifier() { 146 return getTyped(0, ST.class); 147 } 148 149 150 /** 151 * Returns Text (component 2). This is a convenience method that saves you from 152 * casting and handling an exception. 153 */ 154 public ST getText() { 155 return getTyped(1, ST.class); 156 } 157 158 159 /** 160 * Returns Text (component 2). This is a convenience method that saves you from 161 * casting and handling an exception. 162 */ 163 public ST getCwe2_Text() { 164 return getTyped(1, ST.class); 165 } 166 167 168 /** 169 * Returns Name of Coding System (component 3). This is a convenience method that saves you from 170 * casting and handling an exception. 171 */ 172 public ID getNameOfCodingSystem() { 173 return getTyped(2, ID.class); 174 } 175 176 177 /** 178 * Returns Name of Coding System (component 3). This is a convenience method that saves you from 179 * casting and handling an exception. 180 */ 181 public ID getCwe3_NameOfCodingSystem() { 182 return getTyped(2, ID.class); 183 } 184 185 186 /** 187 * Returns Alternate Identifier (component 4). This is a convenience method that saves you from 188 * casting and handling an exception. 189 */ 190 public ST getAlternateIdentifier() { 191 return getTyped(3, ST.class); 192 } 193 194 195 /** 196 * Returns Alternate Identifier (component 4). This is a convenience method that saves you from 197 * casting and handling an exception. 198 */ 199 public ST getCwe4_AlternateIdentifier() { 200 return getTyped(3, ST.class); 201 } 202 203 204 /** 205 * Returns Alternate Text (component 5). This is a convenience method that saves you from 206 * casting and handling an exception. 207 */ 208 public ST getAlternateText() { 209 return getTyped(4, ST.class); 210 } 211 212 213 /** 214 * Returns Alternate Text (component 5). This is a convenience method that saves you from 215 * casting and handling an exception. 216 */ 217 public ST getCwe5_AlternateText() { 218 return getTyped(4, ST.class); 219 } 220 221 222 /** 223 * Returns Name of Alternate Coding System (component 6). This is a convenience method that saves you from 224 * casting and handling an exception. 225 */ 226 public ID getNameOfAlternateCodingSystem() { 227 return getTyped(5, ID.class); 228 } 229 230 231 /** 232 * Returns Name of Alternate Coding System (component 6). This is a convenience method that saves you from 233 * casting and handling an exception. 234 */ 235 public ID getCwe6_NameOfAlternateCodingSystem() { 236 return getTyped(5, ID.class); 237 } 238 239 240 /** 241 * Returns Coding System Version ID (component 7). This is a convenience method that saves you from 242 * casting and handling an exception. 243 */ 244 public ST getCodingSystemVersionID() { 245 return getTyped(6, ST.class); 246 } 247 248 249 /** 250 * Returns Coding System Version ID (component 7). This is a convenience method that saves you from 251 * casting and handling an exception. 252 */ 253 public ST getCwe7_CodingSystemVersionID() { 254 return getTyped(6, ST.class); 255 } 256 257 258 /** 259 * Returns Alternate Coding System Version ID (component 8). This is a convenience method that saves you from 260 * casting and handling an exception. 261 */ 262 public ST getAlternateCodingSystemVersionID() { 263 return getTyped(7, ST.class); 264 } 265 266 267 /** 268 * Returns Alternate Coding System Version ID (component 8). This is a convenience method that saves you from 269 * casting and handling an exception. 270 */ 271 public ST getCwe8_AlternateCodingSystemVersionID() { 272 return getTyped(7, ST.class); 273 } 274 275 276 /** 277 * Returns Original Text (component 9). This is a convenience method that saves you from 278 * casting and handling an exception. 279 */ 280 public ST getOriginalText() { 281 return getTyped(8, ST.class); 282 } 283 284 285 /** 286 * Returns Original Text (component 9). This is a convenience method that saves you from 287 * casting and handling an exception. 288 */ 289 public ST getCwe9_OriginalText() { 290 return getTyped(8, ST.class); 291 } 292 293 294 /** 295 * Returns Second Alternate Identifier (component 10). This is a convenience method that saves you from 296 * casting and handling an exception. 297 */ 298 public ST getSecondAlternateIdentifier() { 299 return getTyped(9, ST.class); 300 } 301 302 303 /** 304 * Returns Second Alternate Identifier (component 10). This is a convenience method that saves you from 305 * casting and handling an exception. 306 */ 307 public ST getCwe10_SecondAlternateIdentifier() { 308 return getTyped(9, ST.class); 309 } 310 311 312 /** 313 * Returns Second Alternate Text (component 11). This is a convenience method that saves you from 314 * casting and handling an exception. 315 */ 316 public ST getSecondAlternateText() { 317 return getTyped(10, ST.class); 318 } 319 320 321 /** 322 * Returns Second Alternate Text (component 11). This is a convenience method that saves you from 323 * casting and handling an exception. 324 */ 325 public ST getCwe11_SecondAlternateText() { 326 return getTyped(10, ST.class); 327 } 328 329 330 /** 331 * Returns Name of Second Alternate Coding System (component 12). This is a convenience method that saves you from 332 * casting and handling an exception. 333 */ 334 public ID getNameOfSecondAlternateCodingSystem() { 335 return getTyped(11, ID.class); 336 } 337 338 339 /** 340 * Returns Name of Second Alternate Coding System (component 12). This is a convenience method that saves you from 341 * casting and handling an exception. 342 */ 343 public ID getCwe12_NameOfSecondAlternateCodingSystem() { 344 return getTyped(11, ID.class); 345 } 346 347 348 /** 349 * Returns Second Alternate Coding System Version ID (component 13). This is a convenience method that saves you from 350 * casting and handling an exception. 351 */ 352 public ST getSecondAlternateCodingSystemVersionID() { 353 return getTyped(12, ST.class); 354 } 355 356 357 /** 358 * Returns Second Alternate Coding System Version ID (component 13). This is a convenience method that saves you from 359 * casting and handling an exception. 360 */ 361 public ST getCwe13_SecondAlternateCodingSystemVersionID() { 362 return getTyped(12, ST.class); 363 } 364 365 366 /** 367 * Returns Coding System OID (component 14). This is a convenience method that saves you from 368 * casting and handling an exception. 369 */ 370 public ST getCodingSystemOID() { 371 return getTyped(13, ST.class); 372 } 373 374 375 /** 376 * Returns Coding System OID (component 14). This is a convenience method that saves you from 377 * casting and handling an exception. 378 */ 379 public ST getCwe14_CodingSystemOID() { 380 return getTyped(13, ST.class); 381 } 382 383 384 /** 385 * Returns Value Set OID (component 15). This is a convenience method that saves you from 386 * casting and handling an exception. 387 */ 388 public ST getValueSetOID() { 389 return getTyped(14, ST.class); 390 } 391 392 393 /** 394 * Returns Value Set OID (component 15). This is a convenience method that saves you from 395 * casting and handling an exception. 396 */ 397 public ST getCwe15_ValueSetOID() { 398 return getTyped(14, ST.class); 399 } 400 401 402 /** 403 * Returns Value Set Version ID (component 16). This is a convenience method that saves you from 404 * casting and handling an exception. 405 */ 406 public DTM getValueSetVersionID() { 407 return getTyped(15, DTM.class); 408 } 409 410 411 /** 412 * Returns Value Set Version ID (component 16). This is a convenience method that saves you from 413 * casting and handling an exception. 414 */ 415 public DTM getCwe16_ValueSetVersionID() { 416 return getTyped(15, DTM.class); 417 } 418 419 420 /** 421 * Returns Alternate Coding System OID (component 17). This is a convenience method that saves you from 422 * casting and handling an exception. 423 */ 424 public ST getAlternateCodingSystemOID() { 425 return getTyped(16, ST.class); 426 } 427 428 429 /** 430 * Returns Alternate Coding System OID (component 17). This is a convenience method that saves you from 431 * casting and handling an exception. 432 */ 433 public ST getCwe17_AlternateCodingSystemOID() { 434 return getTyped(16, ST.class); 435 } 436 437 438 /** 439 * Returns Alternate Value Set OID (component 18). This is a convenience method that saves you from 440 * casting and handling an exception. 441 */ 442 public ST getAlternateValueSetOID() { 443 return getTyped(17, ST.class); 444 } 445 446 447 /** 448 * Returns Alternate Value Set OID (component 18). This is a convenience method that saves you from 449 * casting and handling an exception. 450 */ 451 public ST getCwe18_AlternateValueSetOID() { 452 return getTyped(17, ST.class); 453 } 454 455 456 /** 457 * Returns Alternate Value Set Version ID (component 19). This is a convenience method that saves you from 458 * casting and handling an exception. 459 */ 460 public DTM getAlternateValueSetVersionID() { 461 return getTyped(18, DTM.class); 462 } 463 464 465 /** 466 * Returns Alternate Value Set Version ID (component 19). This is a convenience method that saves you from 467 * casting and handling an exception. 468 */ 469 public DTM getCwe19_AlternateValueSetVersionID() { 470 return getTyped(18, DTM.class); 471 } 472 473 474 /** 475 * Returns Second Alternate Coding System OID (component 20). This is a convenience method that saves you from 476 * casting and handling an exception. 477 */ 478 public ST getSecondAlternateCodingSystemOID() { 479 return getTyped(19, ST.class); 480 } 481 482 483 /** 484 * Returns Second Alternate Coding System OID (component 20). This is a convenience method that saves you from 485 * casting and handling an exception. 486 */ 487 public ST getCwe20_SecondAlternateCodingSystemOID() { 488 return getTyped(19, ST.class); 489 } 490 491 492 /** 493 * Returns Second Alternate Value Set OID (component 21). This is a convenience method that saves you from 494 * casting and handling an exception. 495 */ 496 public ST getSecondAlternateValueSetOID() { 497 return getTyped(20, ST.class); 498 } 499 500 501 /** 502 * Returns Second Alternate Value Set OID (component 21). This is a convenience method that saves you from 503 * casting and handling an exception. 504 */ 505 public ST getCwe21_SecondAlternateValueSetOID() { 506 return getTyped(20, ST.class); 507 } 508 509 510 /** 511 * Returns Second Alternate Value Set Version ID (component 22). This is a convenience method that saves you from 512 * casting and handling an exception. 513 */ 514 public DTM getSecondAlternateValueSetVersionID() { 515 return getTyped(21, DTM.class); 516 } 517 518 519 /** 520 * Returns Second Alternate Value Set Version ID (component 22). This is a convenience method that saves you from 521 * casting and handling an exception. 522 */ 523 public DTM getCwe22_SecondAlternateValueSetVersionID() { 524 return getTyped(21, DTM.class); 525 } 526 527 528 529 } 530