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.v26.message; 035 036import ca.uhn.hl7v2.model.v26.group.*; 037import ca.uhn.hl7v2.model.v26.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 EHC_E13 message structure (see chapter 16.3.8). This structure contains the 048 * following elements: </p> 049 * <ul> 050 * <li>1: MSH (Message Header) <b> </b></li> 051 * <li>2: SFT (Software Segment) <b>optional repeating</b></li> 052 * <li>3: UAC (User Authentication Credential Segment) <b>optional repeating</b></li> 053 * <li>4: MSA (Message Acknowledgment) <b> </b></li> 054 * <li>5: ERR (Error) <b>optional repeating</b></li> 055 * <li>6: RFI (Request for Information) <b> </b></li> 056 * <li>7: CTD (Contact Data) <b>optional repeating</b></li> 057 * <li>8: IVC (Invoice Segment) <b> </b></li> 058 * <li>9: PSS (Product/Service Section) <b> </b></li> 059 * <li>10: PSG (Product/Service Group) <b> </b></li> 060 * <li>11: PID (Patient Identification) <b>optional </b></li> 061 * <li>12: PSL (Product/Service Line Item) <b>optional </b></li> 062 * <li>13: EHC_E13_REQUEST (a Group object) <b> repeating</b></li> 063 * </ul> 064 */ 065@SuppressWarnings("unused") 066public class EHC_E13 extends AbstractMessage { 067 068 /** 069 * Creates a new EHC_E13 message with DefaultModelClassFactory. 070 */ 071 public EHC_E13() { 072 this(new DefaultModelClassFactory()); 073 } 074 075 /** 076 * Creates a new EHC_E13 message with custom ModelClassFactory. 077 */ 078 public EHC_E13(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(SFT.class, false, true); 087 this.add(UAC.class, false, true); 088 this.add(MSA.class, true, false); 089 this.add(ERR.class, false, true); 090 this.add(RFI.class, true, false); 091 this.add(CTD.class, false, true); 092 this.add(IVC.class, true, false); 093 this.add(PSS.class, true, false); 094 this.add(PSG.class, true, false); 095 this.add(PID.class, false, false); 096 this.add(PSL.class, false, false); 097 this.add(EHC_E13_REQUEST.class, true, true); 098 } catch(HL7Exception e) { 099 log.error("Unexpected error creating EHC_E13 - this is probably a bug in the source code generator.", e); 100 } 101 } 102 103 /** 104 * Returns "2.6" 105 */ 106 public String getVersion() { 107 return "2.6"; 108 } 109 110 111 112 /** 113 * Returns 114 * MSH (Message Header) - creates it if necessary 115 */ 116 public MSH getMSH() { 117 return getTyped("MSH", MSH.class); 118 } 119 120 121 122 123 /** 124 * Returns 125 * the first repetition of 126 * SFT (Software Segment) - creates it if necessary 127 */ 128 public SFT getSFT() { 129 return getTyped("SFT", SFT.class); 130 } 131 132 133 /** 134 * Returns a specific repetition of 135 * SFT (Software Segment) - creates it if necessary 136 * 137 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 138 * @throws HL7Exception if the repetition requested is more than one 139 * greater than the number of existing repetitions. 140 */ 141 public SFT getSFT(int rep) { 142 return getTyped("SFT", rep, SFT.class); 143 } 144 145 /** 146 * Returns the number of existing repetitions of SFT 147 */ 148 public int getSFTReps() { 149 return getReps("SFT"); 150 } 151 152 /** 153 * <p> 154 * Returns a non-modifiable List containing all current existing repetitions of SFT. 155 * <p> 156 * <p> 157 * Note that unlike {@link #getSFT()}, this method will not create any reps 158 * if none are already present, so an empty list may be returned. 159 * </p> 160 */ 161 public List<SFT> getSFTAll() throws HL7Exception { 162 return getAllAsList("SFT", SFT.class); 163 } 164 165 /** 166 * Inserts a specific repetition of SFT (Software Segment) 167 * @see AbstractGroup#insertRepetition(Structure, int) 168 */ 169 public void insertSFT(SFT structure, int rep) throws HL7Exception { 170 super.insertRepetition( "SFT", structure, rep); 171 } 172 173 174 /** 175 * Inserts a specific repetition of SFT (Software Segment) 176 * @see AbstractGroup#insertRepetition(Structure, int) 177 */ 178 public SFT insertSFT(int rep) throws HL7Exception { 179 return (SFT)super.insertRepetition("SFT", rep); 180 } 181 182 183 /** 184 * Removes a specific repetition of SFT (Software Segment) 185 * @see AbstractGroup#removeRepetition(String, int) 186 */ 187 public SFT removeSFT(int rep) throws HL7Exception { 188 return (SFT)super.removeRepetition("SFT", rep); 189 } 190 191 192 193 /** 194 * Returns 195 * the first repetition of 196 * UAC (User Authentication Credential Segment) - creates it if necessary 197 */ 198 public UAC getUAC() { 199 return getTyped("UAC", UAC.class); 200 } 201 202 203 /** 204 * Returns a specific repetition of 205 * UAC (User Authentication Credential Segment) - creates it if necessary 206 * 207 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 208 * @throws HL7Exception if the repetition requested is more than one 209 * greater than the number of existing repetitions. 210 */ 211 public UAC getUAC(int rep) { 212 return getTyped("UAC", rep, UAC.class); 213 } 214 215 /** 216 * Returns the number of existing repetitions of UAC 217 */ 218 public int getUACReps() { 219 return getReps("UAC"); 220 } 221 222 /** 223 * <p> 224 * Returns a non-modifiable List containing all current existing repetitions of UAC. 225 * <p> 226 * <p> 227 * Note that unlike {@link #getUAC()}, this method will not create any reps 228 * if none are already present, so an empty list may be returned. 229 * </p> 230 */ 231 public List<UAC> getUACAll() throws HL7Exception { 232 return getAllAsList("UAC", UAC.class); 233 } 234 235 /** 236 * Inserts a specific repetition of UAC (User Authentication Credential Segment) 237 * @see AbstractGroup#insertRepetition(Structure, int) 238 */ 239 public void insertUAC(UAC structure, int rep) throws HL7Exception { 240 super.insertRepetition( "UAC", structure, rep); 241 } 242 243 244 /** 245 * Inserts a specific repetition of UAC (User Authentication Credential Segment) 246 * @see AbstractGroup#insertRepetition(Structure, int) 247 */ 248 public UAC insertUAC(int rep) throws HL7Exception { 249 return (UAC)super.insertRepetition("UAC", rep); 250 } 251 252 253 /** 254 * Removes a specific repetition of UAC (User Authentication Credential Segment) 255 * @see AbstractGroup#removeRepetition(String, int) 256 */ 257 public UAC removeUAC(int rep) throws HL7Exception { 258 return (UAC)super.removeRepetition("UAC", rep); 259 } 260 261 262 263 /** 264 * Returns 265 * MSA (Message Acknowledgment) - creates it if necessary 266 */ 267 public MSA getMSA() { 268 return getTyped("MSA", MSA.class); 269 } 270 271 272 273 274 /** 275 * Returns 276 * the first repetition of 277 * ERR (Error) - creates it if necessary 278 */ 279 public ERR getERR() { 280 return getTyped("ERR", ERR.class); 281 } 282 283 284 /** 285 * Returns a specific repetition of 286 * ERR (Error) - creates it if necessary 287 * 288 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 289 * @throws HL7Exception if the repetition requested is more than one 290 * greater than the number of existing repetitions. 291 */ 292 public ERR getERR(int rep) { 293 return getTyped("ERR", rep, ERR.class); 294 } 295 296 /** 297 * Returns the number of existing repetitions of ERR 298 */ 299 public int getERRReps() { 300 return getReps("ERR"); 301 } 302 303 /** 304 * <p> 305 * Returns a non-modifiable List containing all current existing repetitions of ERR. 306 * <p> 307 * <p> 308 * Note that unlike {@link #getERR()}, this method will not create any reps 309 * if none are already present, so an empty list may be returned. 310 * </p> 311 */ 312 public List<ERR> getERRAll() throws HL7Exception { 313 return getAllAsList("ERR", ERR.class); 314 } 315 316 /** 317 * Inserts a specific repetition of ERR (Error) 318 * @see AbstractGroup#insertRepetition(Structure, int) 319 */ 320 public void insertERR(ERR structure, int rep) throws HL7Exception { 321 super.insertRepetition( "ERR", structure, rep); 322 } 323 324 325 /** 326 * Inserts a specific repetition of ERR (Error) 327 * @see AbstractGroup#insertRepetition(Structure, int) 328 */ 329 public ERR insertERR(int rep) throws HL7Exception { 330 return (ERR)super.insertRepetition("ERR", rep); 331 } 332 333 334 /** 335 * Removes a specific repetition of ERR (Error) 336 * @see AbstractGroup#removeRepetition(String, int) 337 */ 338 public ERR removeERR(int rep) throws HL7Exception { 339 return (ERR)super.removeRepetition("ERR", rep); 340 } 341 342 343 344 /** 345 * Returns 346 * RFI (Request for Information) - creates it if necessary 347 */ 348 public RFI getRFI() { 349 return getTyped("RFI", RFI.class); 350 } 351 352 353 354 355 /** 356 * Returns 357 * the first repetition of 358 * CTD (Contact Data) - creates it if necessary 359 */ 360 public CTD getCTD() { 361 return getTyped("CTD", CTD.class); 362 } 363 364 365 /** 366 * Returns a specific repetition of 367 * CTD (Contact Data) - creates it if necessary 368 * 369 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 370 * @throws HL7Exception if the repetition requested is more than one 371 * greater than the number of existing repetitions. 372 */ 373 public CTD getCTD(int rep) { 374 return getTyped("CTD", rep, CTD.class); 375 } 376 377 /** 378 * Returns the number of existing repetitions of CTD 379 */ 380 public int getCTDReps() { 381 return getReps("CTD"); 382 } 383 384 /** 385 * <p> 386 * Returns a non-modifiable List containing all current existing repetitions of CTD. 387 * <p> 388 * <p> 389 * Note that unlike {@link #getCTD()}, this method will not create any reps 390 * if none are already present, so an empty list may be returned. 391 * </p> 392 */ 393 public List<CTD> getCTDAll() throws HL7Exception { 394 return getAllAsList("CTD", CTD.class); 395 } 396 397 /** 398 * Inserts a specific repetition of CTD (Contact Data) 399 * @see AbstractGroup#insertRepetition(Structure, int) 400 */ 401 public void insertCTD(CTD structure, int rep) throws HL7Exception { 402 super.insertRepetition( "CTD", structure, rep); 403 } 404 405 406 /** 407 * Inserts a specific repetition of CTD (Contact Data) 408 * @see AbstractGroup#insertRepetition(Structure, int) 409 */ 410 public CTD insertCTD(int rep) throws HL7Exception { 411 return (CTD)super.insertRepetition("CTD", rep); 412 } 413 414 415 /** 416 * Removes a specific repetition of CTD (Contact Data) 417 * @see AbstractGroup#removeRepetition(String, int) 418 */ 419 public CTD removeCTD(int rep) throws HL7Exception { 420 return (CTD)super.removeRepetition("CTD", rep); 421 } 422 423 424 425 /** 426 * Returns 427 * IVC (Invoice Segment) - creates it if necessary 428 */ 429 public IVC getIVC() { 430 return getTyped("IVC", IVC.class); 431 } 432 433 434 435 436 /** 437 * Returns 438 * PSS (Product/Service Section) - creates it if necessary 439 */ 440 public PSS getPSS() { 441 return getTyped("PSS", PSS.class); 442 } 443 444 445 446 447 /** 448 * Returns 449 * PSG (Product/Service Group) - creates it if necessary 450 */ 451 public PSG getPSG() { 452 return getTyped("PSG", PSG.class); 453 } 454 455 456 457 458 /** 459 * Returns 460 * PID (Patient Identification) - creates it if necessary 461 */ 462 public PID getPID() { 463 return getTyped("PID", PID.class); 464 } 465 466 467 468 469 /** 470 * Returns 471 * PSL (Product/Service Line Item) - creates it if necessary 472 */ 473 public PSL getPSL() { 474 return getTyped("PSL", PSL.class); 475 } 476 477 478 479 480 /** 481 * Returns 482 * the first repetition of 483 * REQUEST (a Group object) - creates it if necessary 484 */ 485 public EHC_E13_REQUEST getREQUEST() { 486 return getTyped("REQUEST", EHC_E13_REQUEST.class); 487 } 488 489 490 /** 491 * Returns a specific repetition of 492 * REQUEST (a Group object) - creates it if necessary 493 * 494 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 495 * @throws HL7Exception if the repetition requested is more than one 496 * greater than the number of existing repetitions. 497 */ 498 public EHC_E13_REQUEST getREQUEST(int rep) { 499 return getTyped("REQUEST", rep, EHC_E13_REQUEST.class); 500 } 501 502 /** 503 * Returns the number of existing repetitions of REQUEST 504 */ 505 public int getREQUESTReps() { 506 return getReps("REQUEST"); 507 } 508 509 /** 510 * <p> 511 * Returns a non-modifiable List containing all current existing repetitions of REQUEST. 512 * <p> 513 * <p> 514 * Note that unlike {@link #getREQUEST()}, this method will not create any reps 515 * if none are already present, so an empty list may be returned. 516 * </p> 517 */ 518 public List<EHC_E13_REQUEST> getREQUESTAll() throws HL7Exception { 519 return getAllAsList("REQUEST", EHC_E13_REQUEST.class); 520 } 521 522 /** 523 * Inserts a specific repetition of REQUEST (a Group object) 524 * @see AbstractGroup#insertRepetition(Structure, int) 525 */ 526 public void insertREQUEST(EHC_E13_REQUEST structure, int rep) throws HL7Exception { 527 super.insertRepetition( "REQUEST", structure, rep); 528 } 529 530 531 /** 532 * Inserts a specific repetition of REQUEST (a Group object) 533 * @see AbstractGroup#insertRepetition(Structure, int) 534 */ 535 public EHC_E13_REQUEST insertREQUEST(int rep) throws HL7Exception { 536 return (EHC_E13_REQUEST)super.insertRepetition("REQUEST", rep); 537 } 538 539 540 /** 541 * Removes a specific repetition of REQUEST (a Group object) 542 * @see AbstractGroup#removeRepetition(String, int) 543 */ 544 public EHC_E13_REQUEST removeREQUEST(int rep) throws HL7Exception { 545 return (EHC_E13_REQUEST)super.removeRepetition("REQUEST", rep); 546 } 547 548 549 550} 551