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.v25.message; 035 036import ca.uhn.hl7v2.model.v25.group.*; 037import ca.uhn.hl7v2.model.v25.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_A24 message structure (see chapter 3.3.24). 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: EVN (Event Type) <b> </b></li> 053 * <li>4: PID (Patient Identification) <b> </b></li> 054 * <li>5: PD1 (Patient Additional Demographic) <b>optional </b></li> 055 * <li>6: PV1 (Patient Visit) <b>optional </b></li> 056 * <li>7: DB1 (Disability) <b>optional repeating</b></li> 057 * <li>8: PID (Patient Identification) <b> </b></li> 058 * <li>9: PD1 (Patient Additional Demographic) <b>optional </b></li> 059 * <li>10: PV1 (Patient Visit) <b>optional </b></li> 060 * <li>11: DB1 (Disability) <b>optional repeating</b></li> 061 * </ul> 062 */ 063@SuppressWarnings("unused") 064public class ADT_A24 extends AbstractMessage { 065 066 /** 067 * Creates a new ADT_A24 message with DefaultModelClassFactory. 068 */ 069 public ADT_A24() { 070 this(new DefaultModelClassFactory()); 071 } 072 073 /** 074 * Creates a new ADT_A24 message with custom ModelClassFactory. 075 */ 076 public ADT_A24(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(EVN.class, true, false); 086 this.add(PID.class, true, false); 087 this.add(PD1.class, false, false); 088 this.add(PV1.class, false, false); 089 this.add(DB1.class, false, true); 090 this.add(PID.class, true, false); 091 this.add(PD1.class, false, false); 092 this.add(PV1.class, false, false); 093 this.add(DB1.class, false, true); 094 } catch(HL7Exception e) { 095 log.error("Unexpected error creating ADT_A24 - this is probably a bug in the source code generator.", e); 096 } 097 } 098 099 /** 100 * Returns "2.5" 101 */ 102 public String getVersion() { 103 return "2.5"; 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 * EVN (Event Type) - creates it if necessary 192 */ 193 public EVN getEVN() { 194 return getTyped("EVN", EVN.class); 195 } 196 197 198 199 200 /** 201 * Returns 202 * PID (Patient Identification) - creates it if necessary 203 */ 204 public PID getPID() { 205 return getTyped("PID", PID.class); 206 } 207 208 209 210 211 /** 212 * Returns 213 * PD1 (Patient Additional Demographic) - creates it if necessary 214 */ 215 public PD1 getPD1() { 216 return getTyped("PD1", PD1.class); 217 } 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 * the first repetition of 236 * DB1 (Disability) - creates it if necessary 237 */ 238 public DB1 getDB1() { 239 return getTyped("DB1", DB1.class); 240 } 241 242 243 /** 244 * Returns a specific repetition of 245 * DB1 (Disability) - creates it if necessary 246 * 247 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 248 * @throws HL7Exception if the repetition requested is more than one 249 * greater than the number of existing repetitions. 250 */ 251 public DB1 getDB1(int rep) { 252 return getTyped("DB1", rep, DB1.class); 253 } 254 255 /** 256 * Returns the number of existing repetitions of DB1 257 */ 258 public int getDB1Reps() { 259 return getReps("DB1"); 260 } 261 262 /** 263 * <p> 264 * Returns a non-modifiable List containing all current existing repetitions of DB1. 265 * <p> 266 * <p> 267 * Note that unlike {@link #getDB1()}, this method will not create any reps 268 * if none are already present, so an empty list may be returned. 269 * </p> 270 */ 271 public List<DB1> getDB1All() throws HL7Exception { 272 return getAllAsList("DB1", DB1.class); 273 } 274 275 /** 276 * Inserts a specific repetition of DB1 (Disability) 277 * @see AbstractGroup#insertRepetition(Structure, int) 278 */ 279 public void insertDB1(DB1 structure, int rep) throws HL7Exception { 280 super.insertRepetition( "DB1", structure, rep); 281 } 282 283 284 /** 285 * Inserts a specific repetition of DB1 (Disability) 286 * @see AbstractGroup#insertRepetition(Structure, int) 287 */ 288 public DB1 insertDB1(int rep) throws HL7Exception { 289 return (DB1)super.insertRepetition("DB1", rep); 290 } 291 292 293 /** 294 * Removes a specific repetition of DB1 (Disability) 295 * @see AbstractGroup#removeRepetition(String, int) 296 */ 297 public DB1 removeDB1(int rep) throws HL7Exception { 298 return (DB1)super.removeRepetition("DB1", rep); 299 } 300 301 302 303 /** 304 * Returns 305 * PID2 (Patient Identification) - creates it if necessary 306 */ 307 public PID getPID2() { 308 return getTyped("PID2", PID.class); 309 } 310 311 312 313 314 /** 315 * Returns 316 * PD12 (Patient Additional Demographic) - creates it if necessary 317 */ 318 public PD1 getPD12() { 319 return getTyped("PD12", PD1.class); 320 } 321 322 323 324 325 /** 326 * Returns 327 * PV12 (Patient Visit) - creates it if necessary 328 */ 329 public PV1 getPV12() { 330 return getTyped("PV12", PV1.class); 331 } 332 333 334 335 336 /** 337 * Returns 338 * the first repetition of 339 * DB12 (Disability) - creates it if necessary 340 */ 341 public DB1 getDB12() { 342 return getTyped("DB12", DB1.class); 343 } 344 345 346 /** 347 * Returns a specific repetition of 348 * DB12 (Disability) - creates it if necessary 349 * 350 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 351 * @throws HL7Exception if the repetition requested is more than one 352 * greater than the number of existing repetitions. 353 */ 354 public DB1 getDB12(int rep) { 355 return getTyped("DB12", rep, DB1.class); 356 } 357 358 /** 359 * Returns the number of existing repetitions of DB12 360 */ 361 public int getDB12Reps() { 362 return getReps("DB12"); 363 } 364 365 /** 366 * <p> 367 * Returns a non-modifiable List containing all current existing repetitions of DB12. 368 * <p> 369 * <p> 370 * Note that unlike {@link #getDB12()}, this method will not create any reps 371 * if none are already present, so an empty list may be returned. 372 * </p> 373 */ 374 public List<DB1> getDB12All() throws HL7Exception { 375 return getAllAsList("DB12", DB1.class); 376 } 377 378 /** 379 * Inserts a specific repetition of DB12 (Disability) 380 * @see AbstractGroup#insertRepetition(Structure, int) 381 */ 382 public void insertDB12(DB1 structure, int rep) throws HL7Exception { 383 super.insertRepetition( "DB12", structure, rep); 384 } 385 386 387 /** 388 * Inserts a specific repetition of DB12 (Disability) 389 * @see AbstractGroup#insertRepetition(Structure, int) 390 */ 391 public DB1 insertDB12(int rep) throws HL7Exception { 392 return (DB1)super.insertRepetition("DB12", rep); 393 } 394 395 396 /** 397 * Removes a specific repetition of DB12 (Disability) 398 * @see AbstractGroup#removeRepetition(String, int) 399 */ 400 public DB1 removeDB12(int rep) throws HL7Exception { 401 return (DB1)super.removeRepetition("DB12", rep); 402 } 403 404 405 406} 407