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