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