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 PMU_B01 message structure (see chapter 15). 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: STF (Staff Identification) <b> </b></li> 053 * <li>4: PRA (Practitioner Detail) <b>optional repeating</b></li> 054 * <li>5: ORG (Practitioner Organization Unit) <b>optional repeating</b></li> 055 * <li>6: AFF (Professional Affiliation) <b>optional repeating</b></li> 056 * <li>7: LAN (Language Detail) <b>optional repeating</b></li> 057 * <li>8: EDU (Educational Detail) <b>optional repeating</b></li> 058 * </ul> 059 */ 060@SuppressWarnings("unused") 061public class PMU_B01 extends AbstractMessage { 062 063 /** 064 * Creates a new PMU_B01 message with DefaultModelClassFactory. 065 */ 066 public PMU_B01() { 067 this(new DefaultModelClassFactory()); 068 } 069 070 /** 071 * Creates a new PMU_B01 message with custom ModelClassFactory. 072 */ 073 public PMU_B01(ModelClassFactory factory) { 074 super(factory); 075 init(factory); 076 } 077 078 private void init(ModelClassFactory factory) { 079 try { 080 this.add(MSH.class, true, false); 081 this.add(EVN.class, true, false); 082 this.add(STF.class, true, false); 083 this.add(PRA.class, false, true); 084 this.add(ORG.class, false, true); 085 this.add(AFF.class, false, true); 086 this.add(LAN.class, false, true); 087 this.add(EDU.class, false, true); 088 } catch(HL7Exception e) { 089 log.error("Unexpected error creating PMU_B01 - this is probably a bug in the source code generator.", e); 090 } 091 } 092 093 /** 094 * Returns "2.4" 095 */ 096 public String getVersion() { 097 return "2.4"; 098 } 099 100 101 102 /** 103 * Returns 104 * MSH (Message Header) - creates it if necessary 105 */ 106 public MSH getMSH() { 107 return getTyped("MSH", MSH.class); 108 } 109 110 111 112 113 /** 114 * Returns 115 * EVN (Event Type) - creates it if necessary 116 */ 117 public EVN getEVN() { 118 return getTyped("EVN", EVN.class); 119 } 120 121 122 123 124 /** 125 * Returns 126 * STF (Staff Identification) - creates it if necessary 127 */ 128 public STF getSTF() { 129 return getTyped("STF", STF.class); 130 } 131 132 133 134 135 /** 136 * Returns 137 * the first repetition of 138 * PRA (Practitioner Detail) - creates it if necessary 139 */ 140 public PRA getPRA() { 141 return getTyped("PRA", PRA.class); 142 } 143 144 145 /** 146 * Returns a specific repetition of 147 * PRA (Practitioner Detail) - creates it if necessary 148 * 149 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 150 * @throws HL7Exception if the repetition requested is more than one 151 * greater than the number of existing repetitions. 152 */ 153 public PRA getPRA(int rep) { 154 return getTyped("PRA", rep, PRA.class); 155 } 156 157 /** 158 * Returns the number of existing repetitions of PRA 159 */ 160 public int getPRAReps() { 161 return getReps("PRA"); 162 } 163 164 /** 165 * <p> 166 * Returns a non-modifiable List containing all current existing repetitions of PRA. 167 * <p> 168 * <p> 169 * Note that unlike {@link #getPRA()}, this method will not create any reps 170 * if none are already present, so an empty list may be returned. 171 * </p> 172 */ 173 public List<PRA> getPRAAll() throws HL7Exception { 174 return getAllAsList("PRA", PRA.class); 175 } 176 177 /** 178 * Inserts a specific repetition of PRA (Practitioner Detail) 179 * @see AbstractGroup#insertRepetition(Structure, int) 180 */ 181 public void insertPRA(PRA structure, int rep) throws HL7Exception { 182 super.insertRepetition( "PRA", structure, rep); 183 } 184 185 186 /** 187 * Inserts a specific repetition of PRA (Practitioner Detail) 188 * @see AbstractGroup#insertRepetition(Structure, int) 189 */ 190 public PRA insertPRA(int rep) throws HL7Exception { 191 return (PRA)super.insertRepetition("PRA", rep); 192 } 193 194 195 /** 196 * Removes a specific repetition of PRA (Practitioner Detail) 197 * @see AbstractGroup#removeRepetition(String, int) 198 */ 199 public PRA removePRA(int rep) throws HL7Exception { 200 return (PRA)super.removeRepetition("PRA", rep); 201 } 202 203 204 205 /** 206 * Returns 207 * the first repetition of 208 * ORG (Practitioner Organization Unit) - creates it if necessary 209 */ 210 public ORG getORG() { 211 return getTyped("ORG", ORG.class); 212 } 213 214 215 /** 216 * Returns a specific repetition of 217 * ORG (Practitioner Organization Unit) - creates it if necessary 218 * 219 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 220 * @throws HL7Exception if the repetition requested is more than one 221 * greater than the number of existing repetitions. 222 */ 223 public ORG getORG(int rep) { 224 return getTyped("ORG", rep, ORG.class); 225 } 226 227 /** 228 * Returns the number of existing repetitions of ORG 229 */ 230 public int getORGReps() { 231 return getReps("ORG"); 232 } 233 234 /** 235 * <p> 236 * Returns a non-modifiable List containing all current existing repetitions of ORG. 237 * <p> 238 * <p> 239 * Note that unlike {@link #getORG()}, this method will not create any reps 240 * if none are already present, so an empty list may be returned. 241 * </p> 242 */ 243 public List<ORG> getORGAll() throws HL7Exception { 244 return getAllAsList("ORG", ORG.class); 245 } 246 247 /** 248 * Inserts a specific repetition of ORG (Practitioner Organization Unit) 249 * @see AbstractGroup#insertRepetition(Structure, int) 250 */ 251 public void insertORG(ORG structure, int rep) throws HL7Exception { 252 super.insertRepetition( "ORG", structure, rep); 253 } 254 255 256 /** 257 * Inserts a specific repetition of ORG (Practitioner Organization Unit) 258 * @see AbstractGroup#insertRepetition(Structure, int) 259 */ 260 public ORG insertORG(int rep) throws HL7Exception { 261 return (ORG)super.insertRepetition("ORG", rep); 262 } 263 264 265 /** 266 * Removes a specific repetition of ORG (Practitioner Organization Unit) 267 * @see AbstractGroup#removeRepetition(String, int) 268 */ 269 public ORG removeORG(int rep) throws HL7Exception { 270 return (ORG)super.removeRepetition("ORG", rep); 271 } 272 273 274 275 /** 276 * Returns 277 * the first repetition of 278 * AFF (Professional Affiliation) - creates it if necessary 279 */ 280 public AFF getAFF() { 281 return getTyped("AFF", AFF.class); 282 } 283 284 285 /** 286 * Returns a specific repetition of 287 * AFF (Professional Affiliation) - creates it if necessary 288 * 289 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 290 * @throws HL7Exception if the repetition requested is more than one 291 * greater than the number of existing repetitions. 292 */ 293 public AFF getAFF(int rep) { 294 return getTyped("AFF", rep, AFF.class); 295 } 296 297 /** 298 * Returns the number of existing repetitions of AFF 299 */ 300 public int getAFFReps() { 301 return getReps("AFF"); 302 } 303 304 /** 305 * <p> 306 * Returns a non-modifiable List containing all current existing repetitions of AFF. 307 * <p> 308 * <p> 309 * Note that unlike {@link #getAFF()}, this method will not create any reps 310 * if none are already present, so an empty list may be returned. 311 * </p> 312 */ 313 public List<AFF> getAFFAll() throws HL7Exception { 314 return getAllAsList("AFF", AFF.class); 315 } 316 317 /** 318 * Inserts a specific repetition of AFF (Professional Affiliation) 319 * @see AbstractGroup#insertRepetition(Structure, int) 320 */ 321 public void insertAFF(AFF structure, int rep) throws HL7Exception { 322 super.insertRepetition( "AFF", structure, rep); 323 } 324 325 326 /** 327 * Inserts a specific repetition of AFF (Professional Affiliation) 328 * @see AbstractGroup#insertRepetition(Structure, int) 329 */ 330 public AFF insertAFF(int rep) throws HL7Exception { 331 return (AFF)super.insertRepetition("AFF", rep); 332 } 333 334 335 /** 336 * Removes a specific repetition of AFF (Professional Affiliation) 337 * @see AbstractGroup#removeRepetition(String, int) 338 */ 339 public AFF removeAFF(int rep) throws HL7Exception { 340 return (AFF)super.removeRepetition("AFF", rep); 341 } 342 343 344 345 /** 346 * Returns 347 * the first repetition of 348 * LAN (Language Detail) - creates it if necessary 349 */ 350 public LAN getLAN() { 351 return getTyped("LAN", LAN.class); 352 } 353 354 355 /** 356 * Returns a specific repetition of 357 * LAN (Language Detail) - creates it if necessary 358 * 359 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 360 * @throws HL7Exception if the repetition requested is more than one 361 * greater than the number of existing repetitions. 362 */ 363 public LAN getLAN(int rep) { 364 return getTyped("LAN", rep, LAN.class); 365 } 366 367 /** 368 * Returns the number of existing repetitions of LAN 369 */ 370 public int getLANReps() { 371 return getReps("LAN"); 372 } 373 374 /** 375 * <p> 376 * Returns a non-modifiable List containing all current existing repetitions of LAN. 377 * <p> 378 * <p> 379 * Note that unlike {@link #getLAN()}, this method will not create any reps 380 * if none are already present, so an empty list may be returned. 381 * </p> 382 */ 383 public List<LAN> getLANAll() throws HL7Exception { 384 return getAllAsList("LAN", LAN.class); 385 } 386 387 /** 388 * Inserts a specific repetition of LAN (Language Detail) 389 * @see AbstractGroup#insertRepetition(Structure, int) 390 */ 391 public void insertLAN(LAN structure, int rep) throws HL7Exception { 392 super.insertRepetition( "LAN", structure, rep); 393 } 394 395 396 /** 397 * Inserts a specific repetition of LAN (Language Detail) 398 * @see AbstractGroup#insertRepetition(Structure, int) 399 */ 400 public LAN insertLAN(int rep) throws HL7Exception { 401 return (LAN)super.insertRepetition("LAN", rep); 402 } 403 404 405 /** 406 * Removes a specific repetition of LAN (Language Detail) 407 * @see AbstractGroup#removeRepetition(String, int) 408 */ 409 public LAN removeLAN(int rep) throws HL7Exception { 410 return (LAN)super.removeRepetition("LAN", rep); 411 } 412 413 414 415 /** 416 * Returns 417 * the first repetition of 418 * EDU (Educational Detail) - creates it if necessary 419 */ 420 public EDU getEDU() { 421 return getTyped("EDU", EDU.class); 422 } 423 424 425 /** 426 * Returns a specific repetition of 427 * EDU (Educational Detail) - creates it if necessary 428 * 429 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 430 * @throws HL7Exception if the repetition requested is more than one 431 * greater than the number of existing repetitions. 432 */ 433 public EDU getEDU(int rep) { 434 return getTyped("EDU", rep, EDU.class); 435 } 436 437 /** 438 * Returns the number of existing repetitions of EDU 439 */ 440 public int getEDUReps() { 441 return getReps("EDU"); 442 } 443 444 /** 445 * <p> 446 * Returns a non-modifiable List containing all current existing repetitions of EDU. 447 * <p> 448 * <p> 449 * Note that unlike {@link #getEDU()}, this method will not create any reps 450 * if none are already present, so an empty list may be returned. 451 * </p> 452 */ 453 public List<EDU> getEDUAll() throws HL7Exception { 454 return getAllAsList("EDU", EDU.class); 455 } 456 457 /** 458 * Inserts a specific repetition of EDU (Educational Detail) 459 * @see AbstractGroup#insertRepetition(Structure, int) 460 */ 461 public void insertEDU(EDU structure, int rep) throws HL7Exception { 462 super.insertRepetition( "EDU", structure, rep); 463 } 464 465 466 /** 467 * Inserts a specific repetition of EDU (Educational Detail) 468 * @see AbstractGroup#insertRepetition(Structure, int) 469 */ 470 public EDU insertEDU(int rep) throws HL7Exception { 471 return (EDU)super.insertRepetition("EDU", rep); 472 } 473 474 475 /** 476 * Removes a specific repetition of EDU (Educational Detail) 477 * @see AbstractGroup#removeRepetition(String, int) 478 */ 479 public EDU removeEDU(int rep) throws HL7Exception { 480 return (EDU)super.removeRepetition("EDU", rep); 481 } 482 483 484 485} 486