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