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 033 034package ca.uhn.hl7v2.model.v24.message; 035 036import ca.uhn.hl7v2.model.v24.group.*; 037import ca.uhn.hl7v2.model.v24.segment.*; 038 039import java.util.List; 040 041import ca.uhn.hl7v2.HL7Exception; 042import ca.uhn.hl7v2.parser.ModelClassFactory; 043import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 044import ca.uhn.hl7v2.model.AbstractMessage; 045 046/** 047 * <p>Represents a ADT_A03 message structure (see chapter 3). This structure contains the 048 * following elements: </p> 049 * <ul> 050 * <li>1: MSH (Message Header) <b> </b></li> 051 * <li>2: EVN (Event Type) <b> </b></li> 052 * <li>3: PID (Patient identification) <b> </b></li> 053 * <li>4: PD1 (patient additional demographic) <b>optional </b></li> 054 * <li>5: ROL (Role) <b>optional repeating</b></li> 055 * <li>6: PV1 (Patient visit) <b> </b></li> 056 * <li>7: PV2 (Patient visit - additional information) <b>optional </b></li> 057 * <li>8: ROL (Role) <b>optional repeating</b></li> 058 * <li>9: DB1 (Disability) <b>optional repeating</b></li> 059 * <li>10: DG1 (Diagnosis) <b>optional repeating</b></li> 060 * <li>11: DRG (Diagnosis Related Group) <b>optional </b></li> 061 * <li>12: ADT_A03_PROCEDURE (a Group object) <b>optional repeating</b></li> 062 * <li>13: OBX (Observation/Result) <b>optional repeating</b></li> 063 * <li>14: PDA (Patient death and autopsy) <b>optional </b></li> 064 * </ul> 065 */ 066@SuppressWarnings("unused") 067public class ADT_A03 extends AbstractMessage { 068 069 /** 070 * Creates a new ADT_A03 message with DefaultModelClassFactory. 071 */ 072 public ADT_A03() { 073 this(new DefaultModelClassFactory()); 074 } 075 076 /** 077 * Creates a new ADT_A03 message with custom ModelClassFactory. 078 */ 079 public ADT_A03(ModelClassFactory factory) { 080 super(factory); 081 init(factory); 082 } 083 084 private void init(ModelClassFactory factory) { 085 try { 086 this.add(MSH.class, true, false); 087 this.add(EVN.class, true, false); 088 this.add(PID.class, true, false); 089 this.add(PD1.class, false, false); 090 this.add(ROL.class, false, true); 091 this.add(PV1.class, true, false); 092 this.add(PV2.class, false, false); 093 this.add(ROL.class, false, true); 094 this.add(DB1.class, false, true); 095 this.add(DG1.class, false, true); 096 this.add(DRG.class, false, false); 097 this.add(ADT_A03_PROCEDURE.class, false, true); 098 this.add(OBX.class, false, true); 099 this.add(PDA.class, false, false); 100 } catch(HL7Exception e) { 101 log.error("Unexpected error creating ADT_A03 - this is probably a bug in the source code generator.", e); 102 } 103 } 104 105 /** 106 * Returns "2.4" 107 */ 108 public String getVersion() { 109 return "2.4"; 110 } 111 112 113 114 /** 115 * Returns 116 * MSH (Message Header) - creates it if necessary 117 */ 118 public MSH getMSH() { 119 return getTyped("MSH", MSH.class); 120 } 121 122 123 124 125 /** 126 * Returns 127 * EVN (Event Type) - creates it if necessary 128 */ 129 public EVN getEVN() { 130 return getTyped("EVN", EVN.class); 131 } 132 133 134 135 136 /** 137 * Returns 138 * PID (Patient identification) - creates it if necessary 139 */ 140 public PID getPID() { 141 return getTyped("PID", PID.class); 142 } 143 144 145 146 147 /** 148 * Returns 149 * PD1 (patient additional demographic) - creates it if necessary 150 */ 151 public PD1 getPD1() { 152 return getTyped("PD1", PD1.class); 153 } 154 155 156 157 158 /** 159 * Returns 160 * the first repetition of 161 * ROL (Role) - creates it if necessary 162 */ 163 public ROL getROL() { 164 return getTyped("ROL", ROL.class); 165 } 166 167 168 /** 169 * Returns a specific repetition of 170 * ROL (Role) - creates it if necessary 171 * 172 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 173 * @throws HL7Exception if the repetition requested is more than one 174 * greater than the number of existing repetitions. 175 */ 176 public ROL getROL(int rep) { 177 return getTyped("ROL", rep, ROL.class); 178 } 179 180 /** 181 * Returns the number of existing repetitions of ROL 182 */ 183 public int getROLReps() { 184 return getReps("ROL"); 185 } 186 187 /** 188 * <p> 189 * Returns a non-modifiable List containing all current existing repetitions of ROL. 190 * <p> 191 * <p> 192 * Note that unlike {@link #getROL()}, this method will not create any reps 193 * if none are already present, so an empty list may be returned. 194 * </p> 195 */ 196 public List<ROL> getROLAll() throws HL7Exception { 197 return getAllAsList("ROL", ROL.class); 198 } 199 200 /** 201 * Inserts a specific repetition of ROL (Role) 202 * @see AbstractGroup#insertRepetition(Structure, int) 203 */ 204 public void insertROL(ROL structure, int rep) throws HL7Exception { 205 super.insertRepetition( "ROL", structure, rep); 206 } 207 208 209 /** 210 * Inserts a specific repetition of ROL (Role) 211 * @see AbstractGroup#insertRepetition(Structure, int) 212 */ 213 public ROL insertROL(int rep) throws HL7Exception { 214 return (ROL)super.insertRepetition("ROL", rep); 215 } 216 217 218 /** 219 * Removes a specific repetition of ROL (Role) 220 * @see AbstractGroup#removeRepetition(String, int) 221 */ 222 public ROL removeROL(int rep) throws HL7Exception { 223 return (ROL)super.removeRepetition("ROL", rep); 224 } 225 226 227 228 /** 229 * Returns 230 * PV1 (Patient visit) - creates it if necessary 231 */ 232 public PV1 getPV1() { 233 return getTyped("PV1", PV1.class); 234 } 235 236 237 238 239 /** 240 * Returns 241 * PV2 (Patient visit - additional information) - creates it if necessary 242 */ 243 public PV2 getPV2() { 244 return getTyped("PV2", PV2.class); 245 } 246 247 248 249 250 /** 251 * Returns 252 * the first repetition of 253 * ROL2 (Role) - creates it if necessary 254 */ 255 public ROL getROL2() { 256 return getTyped("ROL2", ROL.class); 257 } 258 259 260 /** 261 * Returns a specific repetition of 262 * ROL2 (Role) - creates it if necessary 263 * 264 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 265 * @throws HL7Exception if the repetition requested is more than one 266 * greater than the number of existing repetitions. 267 */ 268 public ROL getROL2(int rep) { 269 return getTyped("ROL2", rep, ROL.class); 270 } 271 272 /** 273 * Returns the number of existing repetitions of ROL2 274 */ 275 public int getROL2Reps() { 276 return getReps("ROL2"); 277 } 278 279 /** 280 * <p> 281 * Returns a non-modifiable List containing all current existing repetitions of ROL2. 282 * <p> 283 * <p> 284 * Note that unlike {@link #getROL2()}, this method will not create any reps 285 * if none are already present, so an empty list may be returned. 286 * </p> 287 */ 288 public List<ROL> getROL2All() throws HL7Exception { 289 return getAllAsList("ROL2", ROL.class); 290 } 291 292 /** 293 * Inserts a specific repetition of ROL2 (Role) 294 * @see AbstractGroup#insertRepetition(Structure, int) 295 */ 296 public void insertROL2(ROL structure, int rep) throws HL7Exception { 297 super.insertRepetition( "ROL2", structure, rep); 298 } 299 300 301 /** 302 * Inserts a specific repetition of ROL2 (Role) 303 * @see AbstractGroup#insertRepetition(Structure, int) 304 */ 305 public ROL insertROL2(int rep) throws HL7Exception { 306 return (ROL)super.insertRepetition("ROL2", rep); 307 } 308 309 310 /** 311 * Removes a specific repetition of ROL2 (Role) 312 * @see AbstractGroup#removeRepetition(String, int) 313 */ 314 public ROL removeROL2(int rep) throws HL7Exception { 315 return (ROL)super.removeRepetition("ROL2", rep); 316 } 317 318 319 320 /** 321 * Returns 322 * the first repetition of 323 * DB1 (Disability) - creates it if necessary 324 */ 325 public DB1 getDB1() { 326 return getTyped("DB1", DB1.class); 327 } 328 329 330 /** 331 * Returns a specific repetition of 332 * DB1 (Disability) - creates it if necessary 333 * 334 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 335 * @throws HL7Exception if the repetition requested is more than one 336 * greater than the number of existing repetitions. 337 */ 338 public DB1 getDB1(int rep) { 339 return getTyped("DB1", rep, DB1.class); 340 } 341 342 /** 343 * Returns the number of existing repetitions of DB1 344 */ 345 public int getDB1Reps() { 346 return getReps("DB1"); 347 } 348 349 /** 350 * <p> 351 * Returns a non-modifiable List containing all current existing repetitions of DB1. 352 * <p> 353 * <p> 354 * Note that unlike {@link #getDB1()}, this method will not create any reps 355 * if none are already present, so an empty list may be returned. 356 * </p> 357 */ 358 public List<DB1> getDB1All() throws HL7Exception { 359 return getAllAsList("DB1", DB1.class); 360 } 361 362 /** 363 * Inserts a specific repetition of DB1 (Disability) 364 * @see AbstractGroup#insertRepetition(Structure, int) 365 */ 366 public void insertDB1(DB1 structure, int rep) throws HL7Exception { 367 super.insertRepetition( "DB1", structure, rep); 368 } 369 370 371 /** 372 * Inserts a specific repetition of DB1 (Disability) 373 * @see AbstractGroup#insertRepetition(Structure, int) 374 */ 375 public DB1 insertDB1(int rep) throws HL7Exception { 376 return (DB1)super.insertRepetition("DB1", rep); 377 } 378 379 380 /** 381 * Removes a specific repetition of DB1 (Disability) 382 * @see AbstractGroup#removeRepetition(String, int) 383 */ 384 public DB1 removeDB1(int rep) throws HL7Exception { 385 return (DB1)super.removeRepetition("DB1", rep); 386 } 387 388 389 390 /** 391 * Returns 392 * the first repetition of 393 * DG1 (Diagnosis) - creates it if necessary 394 */ 395 public DG1 getDG1() { 396 return getTyped("DG1", DG1.class); 397 } 398 399 400 /** 401 * Returns a specific repetition of 402 * DG1 (Diagnosis) - creates it if necessary 403 * 404 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 405 * @throws HL7Exception if the repetition requested is more than one 406 * greater than the number of existing repetitions. 407 */ 408 public DG1 getDG1(int rep) { 409 return getTyped("DG1", rep, DG1.class); 410 } 411 412 /** 413 * Returns the number of existing repetitions of DG1 414 */ 415 public int getDG1Reps() { 416 return getReps("DG1"); 417 } 418 419 /** 420 * <p> 421 * Returns a non-modifiable List containing all current existing repetitions of DG1. 422 * <p> 423 * <p> 424 * Note that unlike {@link #getDG1()}, this method will not create any reps 425 * if none are already present, so an empty list may be returned. 426 * </p> 427 */ 428 public List<DG1> getDG1All() throws HL7Exception { 429 return getAllAsList("DG1", DG1.class); 430 } 431 432 /** 433 * Inserts a specific repetition of DG1 (Diagnosis) 434 * @see AbstractGroup#insertRepetition(Structure, int) 435 */ 436 public void insertDG1(DG1 structure, int rep) throws HL7Exception { 437 super.insertRepetition( "DG1", structure, rep); 438 } 439 440 441 /** 442 * Inserts a specific repetition of DG1 (Diagnosis) 443 * @see AbstractGroup#insertRepetition(Structure, int) 444 */ 445 public DG1 insertDG1(int rep) throws HL7Exception { 446 return (DG1)super.insertRepetition("DG1", rep); 447 } 448 449 450 /** 451 * Removes a specific repetition of DG1 (Diagnosis) 452 * @see AbstractGroup#removeRepetition(String, int) 453 */ 454 public DG1 removeDG1(int rep) throws HL7Exception { 455 return (DG1)super.removeRepetition("DG1", rep); 456 } 457 458 459 460 /** 461 * Returns 462 * DRG (Diagnosis Related Group) - creates it if necessary 463 */ 464 public DRG getDRG() { 465 return getTyped("DRG", DRG.class); 466 } 467 468 469 470 471 /** 472 * Returns 473 * the first repetition of 474 * PROCEDURE (a Group object) - creates it if necessary 475 */ 476 public ADT_A03_PROCEDURE getPROCEDURE() { 477 return getTyped("PROCEDURE", ADT_A03_PROCEDURE.class); 478 } 479 480 481 /** 482 * Returns a specific repetition of 483 * PROCEDURE (a Group object) - creates it if necessary 484 * 485 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 486 * @throws HL7Exception if the repetition requested is more than one 487 * greater than the number of existing repetitions. 488 */ 489 public ADT_A03_PROCEDURE getPROCEDURE(int rep) { 490 return getTyped("PROCEDURE", rep, ADT_A03_PROCEDURE.class); 491 } 492 493 /** 494 * Returns the number of existing repetitions of PROCEDURE 495 */ 496 public int getPROCEDUREReps() { 497 return getReps("PROCEDURE"); 498 } 499 500 /** 501 * <p> 502 * Returns a non-modifiable List containing all current existing repetitions of PROCEDURE. 503 * <p> 504 * <p> 505 * Note that unlike {@link #getPROCEDURE()}, this method will not create any reps 506 * if none are already present, so an empty list may be returned. 507 * </p> 508 */ 509 public List<ADT_A03_PROCEDURE> getPROCEDUREAll() throws HL7Exception { 510 return getAllAsList("PROCEDURE", ADT_A03_PROCEDURE.class); 511 } 512 513 /** 514 * Inserts a specific repetition of PROCEDURE (a Group object) 515 * @see AbstractGroup#insertRepetition(Structure, int) 516 */ 517 public void insertPROCEDURE(ADT_A03_PROCEDURE structure, int rep) throws HL7Exception { 518 super.insertRepetition( "PROCEDURE", structure, rep); 519 } 520 521 522 /** 523 * Inserts a specific repetition of PROCEDURE (a Group object) 524 * @see AbstractGroup#insertRepetition(Structure, int) 525 */ 526 public ADT_A03_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception { 527 return (ADT_A03_PROCEDURE)super.insertRepetition("PROCEDURE", rep); 528 } 529 530 531 /** 532 * Removes a specific repetition of PROCEDURE (a Group object) 533 * @see AbstractGroup#removeRepetition(String, int) 534 */ 535 public ADT_A03_PROCEDURE removePROCEDURE(int rep) throws HL7Exception { 536 return (ADT_A03_PROCEDURE)super.removeRepetition("PROCEDURE", rep); 537 } 538 539 540 541 /** 542 * Returns 543 * the first repetition of 544 * OBX (Observation/Result) - creates it if necessary 545 */ 546 public OBX getOBX() { 547 return getTyped("OBX", OBX.class); 548 } 549 550 551 /** 552 * Returns a specific repetition of 553 * OBX (Observation/Result) - creates it if necessary 554 * 555 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 556 * @throws HL7Exception if the repetition requested is more than one 557 * greater than the number of existing repetitions. 558 */ 559 public OBX getOBX(int rep) { 560 return getTyped("OBX", rep, OBX.class); 561 } 562 563 /** 564 * Returns the number of existing repetitions of OBX 565 */ 566 public int getOBXReps() { 567 return getReps("OBX"); 568 } 569 570 /** 571 * <p> 572 * Returns a non-modifiable List containing all current existing repetitions of OBX. 573 * <p> 574 * <p> 575 * Note that unlike {@link #getOBX()}, this method will not create any reps 576 * if none are already present, so an empty list may be returned. 577 * </p> 578 */ 579 public List<OBX> getOBXAll() throws HL7Exception { 580 return getAllAsList("OBX", OBX.class); 581 } 582 583 /** 584 * Inserts a specific repetition of OBX (Observation/Result) 585 * @see AbstractGroup#insertRepetition(Structure, int) 586 */ 587 public void insertOBX(OBX structure, int rep) throws HL7Exception { 588 super.insertRepetition( "OBX", structure, rep); 589 } 590 591 592 /** 593 * Inserts a specific repetition of OBX (Observation/Result) 594 * @see AbstractGroup#insertRepetition(Structure, int) 595 */ 596 public OBX insertOBX(int rep) throws HL7Exception { 597 return (OBX)super.insertRepetition("OBX", rep); 598 } 599 600 601 /** 602 * Removes a specific repetition of OBX (Observation/Result) 603 * @see AbstractGroup#removeRepetition(String, int) 604 */ 605 public OBX removeOBX(int rep) throws HL7Exception { 606 return (OBX)super.removeRepetition("OBX", rep); 607 } 608 609 610 611 /** 612 * Returns 613 * PDA (Patient death and autopsy) - creates it if necessary 614 */ 615 public PDA getPDA() { 616 return getTyped("PDA", PDA.class); 617 } 618 619 620 621 622} 623