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 "[file_name]". Description: 15 * "[one_line_description]" 16 * 17 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 18 * 2012. 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 34 package ca.uhn.hl7v2.model.v24.message; 35 36 import ca.uhn.hl7v2.model.v24.group.*; 37 import ca.uhn.hl7v2.model.v24.segment.*; 38 39 import ca.uhn.hl7v2.HL7Exception; 40 import ca.uhn.hl7v2.parser.ModelClassFactory; 41 import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 42 import ca.uhn.hl7v2.model.*; 43 44 45 /** 46 * <p>Represents a ADT_A02 message structure (see chapter 3). This structure contains the 47 * following elements: </p> 48 * <ul> 49 * <li>1: MSH (Message Header) <b> </b> </li> 50 * <li>2: EVN (Event Type) <b> </b> </li> 51 * <li>3: PID (Patient identification) <b> </b> </li> 52 * <li>4: PD1 (patient additional demographic) <b>optional </b> </li> 53 * <li>5: ROL (Role) <b>optional repeating</b> </li> 54 * <li>6: PV1 (Patient visit) <b> </b> </li> 55 * <li>7: PV2 (Patient visit - additional information) <b>optional </b> </li> 56 * <li>8: ROL (Role) <b>optional repeating</b> </li> 57 * <li>9: DB1 (Disability) <b>optional repeating</b> </li> 58 * <li>10: OBX (Observation/Result) <b>optional repeating</b> </li> 59 * <li>11: PDA (Patient death and autopsy) <b>optional </b> </li> 60 * </ul> 61 */ 62 //@SuppressWarnings("unused") 63 public class ADT_A02 extends AbstractMessage { 64 65 /** 66 * Creates a new ADT_A02 message with DefaultModelClassFactory. 67 */ 68 public ADT_A02() { 69 this(new DefaultModelClassFactory()); 70 } 71 72 /** 73 * Creates a new ADT_A02 message with custom ModelClassFactory. 74 */ 75 public ADT_A02(ModelClassFactory factory) { 76 super(factory); 77 init(factory); 78 } 79 80 private void init(ModelClassFactory factory) { 81 try { 82 this.add(MSH.class, true, false); 83 this.add(EVN.class, true, false); 84 this.add(PID.class, true, false); 85 this.add(PD1.class, false, false); 86 this.add(ROL.class, false, true); 87 this.add(PV1.class, true, false); 88 this.add(PV2.class, false, false); 89 this.add(ROL.class, false, true); 90 this.add(DB1.class, false, true); 91 this.add(OBX.class, false, true); 92 this.add(PDA.class, false, false); 93 } catch(HL7Exception e) { 94 log.error("Unexpected error creating ADT_A02 - this is probably a bug in the source code generator.", e); 95 } 96 } 97 98 99 /** 100 * Returns "2.4" 101 */ 102 public String getVersion() { 103 return "2.4"; 104 } 105 106 107 108 109 /** 110 * <p> 111 * Returns 112 * MSH (Message Header) - creates it if necessary 113 * </p> 114 * 115 * 116 */ 117 public MSH getMSH() { 118 return getTyped("MSH", MSH.class); 119 } 120 121 122 123 124 125 /** 126 * <p> 127 * Returns 128 * EVN (Event Type) - creates it if necessary 129 * </p> 130 * 131 * 132 */ 133 public EVN getEVN() { 134 return getTyped("EVN", EVN.class); 135 } 136 137 138 139 140 141 /** 142 * <p> 143 * Returns 144 * PID (Patient identification) - creates it if necessary 145 * </p> 146 * 147 * 148 */ 149 public PID getPID() { 150 return getTyped("PID", PID.class); 151 } 152 153 154 155 156 157 /** 158 * <p> 159 * Returns 160 * PD1 (patient additional demographic) - creates it if necessary 161 * </p> 162 * 163 * 164 */ 165 public PD1 getPD1() { 166 return getTyped("PD1", PD1.class); 167 } 168 169 170 171 172 173 /** 174 * <p> 175 * Returns 176 * the first repetition of 177 * ROL (Role) - creates it if necessary 178 * </p> 179 * 180 * 181 */ 182 public ROL getROL() { 183 return getTyped("ROL", ROL.class); 184 } 185 186 187 /** 188 * <p> 189 * Returns a specific repetition of 190 * ROL (Role) - creates it if necessary 191 * </p> 192 * 193 * 194 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 195 * @throws HL7Exception if the repetition requested is more than one 196 * greater than the number of existing repetitions. 197 */ 198 public ROL getROL(int rep) { 199 return getTyped("ROL", rep, ROL.class); 200 } 201 202 /** 203 * <p> 204 * Returns the number of existing repetitions of ROL 205 * </p> 206 * 207 */ 208 public int getROLReps() { 209 return getReps("ROL"); 210 } 211 212 /** 213 * <p> 214 * Returns a non-modifiable List containing all current existing repetitions of ROL. 215 * <p> 216 * <p> 217 * Note that unlike {@link #getROL()}, this method will not create any reps 218 * if none are already present, so an empty list may be returned. 219 * </p> 220 * 221 */ 222 public java.util.List<ROL> getROLAll() throws HL7Exception { 223 return getAllAsList("ROL", ROL.class); 224 } 225 226 /** 227 * <p> 228 * Inserts a specific repetition of ROL (Role) 229 * </p> 230 * 231 * 232 * @see AbstractGroup#insertRepetition(Structure, int) 233 */ 234 public void insertROL(ROL structure, int rep) throws HL7Exception { 235 super.insertRepetition( "ROL", structure, rep); 236 } 237 238 239 /** 240 * <p> 241 * Inserts a specific repetition of ROL (Role) 242 * </p> 243 * 244 * 245 * @see AbstractGroup#insertRepetition(Structure, int) 246 */ 247 public ROL insertROL(int rep) throws HL7Exception { 248 return (ROL)super.insertRepetition("ROL", rep); 249 } 250 251 252 /** 253 * <p> 254 * Removes a specific repetition of ROL (Role) 255 * </p> 256 * 257 * 258 * @see AbstractGroup#removeRepetition(String, int) 259 */ 260 public ROL removeROL(int rep) throws HL7Exception { 261 return (ROL)super.removeRepetition("ROL", rep); 262 } 263 264 265 266 267 /** 268 * <p> 269 * Returns 270 * PV1 (Patient visit) - creates it if necessary 271 * </p> 272 * 273 * 274 */ 275 public PV1 getPV1() { 276 return getTyped("PV1", PV1.class); 277 } 278 279 280 281 282 283 /** 284 * <p> 285 * Returns 286 * PV2 (Patient visit - additional information) - creates it if necessary 287 * </p> 288 * 289 * 290 */ 291 public PV2 getPV2() { 292 return getTyped("PV2", PV2.class); 293 } 294 295 296 297 298 299 /** 300 * <p> 301 * Returns 302 * the first repetition of 303 * ROL2 (Role) - creates it if necessary 304 * </p> 305 * 306 * 307 */ 308 public ROL getROL2() { 309 return getTyped("ROL2", ROL.class); 310 } 311 312 313 /** 314 * <p> 315 * Returns a specific repetition of 316 * ROL2 (Role) - creates it if necessary 317 * </p> 318 * 319 * 320 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 321 * @throws HL7Exception if the repetition requested is more than one 322 * greater than the number of existing repetitions. 323 */ 324 public ROL getROL2(int rep) { 325 return getTyped("ROL2", rep, ROL.class); 326 } 327 328 /** 329 * <p> 330 * Returns the number of existing repetitions of ROL2 331 * </p> 332 * 333 */ 334 public int getROL2Reps() { 335 return getReps("ROL2"); 336 } 337 338 /** 339 * <p> 340 * Returns a non-modifiable List containing all current existing repetitions of ROL2. 341 * <p> 342 * <p> 343 * Note that unlike {@link #getROL2()}, this method will not create any reps 344 * if none are already present, so an empty list may be returned. 345 * </p> 346 * 347 */ 348 public java.util.List<ROL> getROL2All() throws HL7Exception { 349 return getAllAsList("ROL2", ROL.class); 350 } 351 352 /** 353 * <p> 354 * Inserts a specific repetition of ROL2 (Role) 355 * </p> 356 * 357 * 358 * @see AbstractGroup#insertRepetition(Structure, int) 359 */ 360 public void insertROL2(ROL structure, int rep) throws HL7Exception { 361 super.insertRepetition( "ROL2", structure, rep); 362 } 363 364 365 /** 366 * <p> 367 * Inserts a specific repetition of ROL2 (Role) 368 * </p> 369 * 370 * 371 * @see AbstractGroup#insertRepetition(Structure, int) 372 */ 373 public ROL insertROL2(int rep) throws HL7Exception { 374 return (ROL)super.insertRepetition("ROL2", rep); 375 } 376 377 378 /** 379 * <p> 380 * Removes a specific repetition of ROL2 (Role) 381 * </p> 382 * 383 * 384 * @see AbstractGroup#removeRepetition(String, int) 385 */ 386 public ROL removeROL2(int rep) throws HL7Exception { 387 return (ROL)super.removeRepetition("ROL2", rep); 388 } 389 390 391 392 393 /** 394 * <p> 395 * Returns 396 * the first repetition of 397 * DB1 (Disability) - creates it if necessary 398 * </p> 399 * 400 * 401 */ 402 public DB1 getDB1() { 403 return getTyped("DB1", DB1.class); 404 } 405 406 407 /** 408 * <p> 409 * Returns a specific repetition of 410 * DB1 (Disability) - creates it if necessary 411 * </p> 412 * 413 * 414 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 415 * @throws HL7Exception if the repetition requested is more than one 416 * greater than the number of existing repetitions. 417 */ 418 public DB1 getDB1(int rep) { 419 return getTyped("DB1", rep, DB1.class); 420 } 421 422 /** 423 * <p> 424 * Returns the number of existing repetitions of DB1 425 * </p> 426 * 427 */ 428 public int getDB1Reps() { 429 return getReps("DB1"); 430 } 431 432 /** 433 * <p> 434 * Returns a non-modifiable List containing all current existing repetitions of DB1. 435 * <p> 436 * <p> 437 * Note that unlike {@link #getDB1()}, this method will not create any reps 438 * if none are already present, so an empty list may be returned. 439 * </p> 440 * 441 */ 442 public java.util.List<DB1> getDB1All() throws HL7Exception { 443 return getAllAsList("DB1", DB1.class); 444 } 445 446 /** 447 * <p> 448 * Inserts a specific repetition of DB1 (Disability) 449 * </p> 450 * 451 * 452 * @see AbstractGroup#insertRepetition(Structure, int) 453 */ 454 public void insertDB1(DB1 structure, int rep) throws HL7Exception { 455 super.insertRepetition( "DB1", structure, rep); 456 } 457 458 459 /** 460 * <p> 461 * Inserts a specific repetition of DB1 (Disability) 462 * </p> 463 * 464 * 465 * @see AbstractGroup#insertRepetition(Structure, int) 466 */ 467 public DB1 insertDB1(int rep) throws HL7Exception { 468 return (DB1)super.insertRepetition("DB1", rep); 469 } 470 471 472 /** 473 * <p> 474 * Removes a specific repetition of DB1 (Disability) 475 * </p> 476 * 477 * 478 * @see AbstractGroup#removeRepetition(String, int) 479 */ 480 public DB1 removeDB1(int rep) throws HL7Exception { 481 return (DB1)super.removeRepetition("DB1", rep); 482 } 483 484 485 486 487 /** 488 * <p> 489 * Returns 490 * the first repetition of 491 * OBX (Observation/Result) - creates it if necessary 492 * </p> 493 * 494 * 495 */ 496 public OBX getOBX() { 497 return getTyped("OBX", OBX.class); 498 } 499 500 501 /** 502 * <p> 503 * Returns a specific repetition of 504 * OBX (Observation/Result) - creates it if necessary 505 * </p> 506 * 507 * 508 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 509 * @throws HL7Exception if the repetition requested is more than one 510 * greater than the number of existing repetitions. 511 */ 512 public OBX getOBX(int rep) { 513 return getTyped("OBX", rep, OBX.class); 514 } 515 516 /** 517 * <p> 518 * Returns the number of existing repetitions of OBX 519 * </p> 520 * 521 */ 522 public int getOBXReps() { 523 return getReps("OBX"); 524 } 525 526 /** 527 * <p> 528 * Returns a non-modifiable List containing all current existing repetitions of OBX. 529 * <p> 530 * <p> 531 * Note that unlike {@link #getOBX()}, this method will not create any reps 532 * if none are already present, so an empty list may be returned. 533 * </p> 534 * 535 */ 536 public java.util.List<OBX> getOBXAll() throws HL7Exception { 537 return getAllAsList("OBX", OBX.class); 538 } 539 540 /** 541 * <p> 542 * Inserts a specific repetition of OBX (Observation/Result) 543 * </p> 544 * 545 * 546 * @see AbstractGroup#insertRepetition(Structure, int) 547 */ 548 public void insertOBX(OBX structure, int rep) throws HL7Exception { 549 super.insertRepetition( "OBX", structure, rep); 550 } 551 552 553 /** 554 * <p> 555 * Inserts a specific repetition of OBX (Observation/Result) 556 * </p> 557 * 558 * 559 * @see AbstractGroup#insertRepetition(Structure, int) 560 */ 561 public OBX insertOBX(int rep) throws HL7Exception { 562 return (OBX)super.insertRepetition("OBX", rep); 563 } 564 565 566 /** 567 * <p> 568 * Removes a specific repetition of OBX (Observation/Result) 569 * </p> 570 * 571 * 572 * @see AbstractGroup#removeRepetition(String, int) 573 */ 574 public OBX removeOBX(int rep) throws HL7Exception { 575 return (OBX)super.removeRepetition("OBX", rep); 576 } 577 578 579 580 581 /** 582 * <p> 583 * Returns 584 * PDA (Patient death and autopsy) - creates it if necessary 585 * </p> 586 * 587 * 588 */ 589 public PDA getPDA() { 590 return getTyped("PDA", PDA.class); 591 } 592 593 594 595 596 } 597