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