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