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