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_A37 message structure (see chapter 3.3.37). 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>optional </b></li> 057 * <li>8: DB1 (Disability) <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>optional </b></li> 061 * <li>12: DB1 (Disability) <b>optional repeating</b></li> 062 * </ul> 063 */ 064@SuppressWarnings("unused") 065public class ADT_A37 extends AbstractMessage { 066 067 /** 068 * Creates a new ADT_A37 message with DefaultModelClassFactory. 069 */ 070 public ADT_A37() { 071 this(new DefaultModelClassFactory()); 072 } 073 074 /** 075 * Creates a new ADT_A37 message with custom ModelClassFactory. 076 */ 077 public ADT_A37(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, false, false); 091 this.add(DB1.class, false, true); 092 this.add(PID.class, true, false); 093 this.add(PD1.class, false, false); 094 this.add(PV1.class, false, false); 095 this.add(DB1.class, false, true); 096 } catch(HL7Exception e) { 097 log.error("Unexpected error creating ADT_A37 - 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 * the first repetition of 249 * DB1 (Disability) - creates it if necessary 250 */ 251 public DB1 getDB1() { 252 return getTyped("DB1", DB1.class); 253 } 254 255 256 /** 257 * Returns a specific repetition of 258 * DB1 (Disability) - creates it if necessary 259 * 260 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 261 * @throws HL7Exception if the repetition requested is more than one 262 * greater than the number of existing repetitions. 263 */ 264 public DB1 getDB1(int rep) { 265 return getTyped("DB1", rep, DB1.class); 266 } 267 268 /** 269 * Returns the number of existing repetitions of DB1 270 */ 271 public int getDB1Reps() { 272 return getReps("DB1"); 273 } 274 275 /** 276 * <p> 277 * Returns a non-modifiable List containing all current existing repetitions of DB1. 278 * <p> 279 * <p> 280 * Note that unlike {@link #getDB1()}, this method will not create any reps 281 * if none are already present, so an empty list may be returned. 282 * </p> 283 */ 284 public List<DB1> getDB1All() throws HL7Exception { 285 return getAllAsList("DB1", DB1.class); 286 } 287 288 /** 289 * Inserts a specific repetition of DB1 (Disability) 290 * @see AbstractGroup#insertRepetition(Structure, int) 291 */ 292 public void insertDB1(DB1 structure, int rep) throws HL7Exception { 293 super.insertRepetition( "DB1", structure, rep); 294 } 295 296 297 /** 298 * Inserts a specific repetition of DB1 (Disability) 299 * @see AbstractGroup#insertRepetition(Structure, int) 300 */ 301 public DB1 insertDB1(int rep) throws HL7Exception { 302 return (DB1)super.insertRepetition("DB1", rep); 303 } 304 305 306 /** 307 * Removes a specific repetition of DB1 (Disability) 308 * @see AbstractGroup#removeRepetition(String, int) 309 */ 310 public DB1 removeDB1(int rep) throws HL7Exception { 311 return (DB1)super.removeRepetition("DB1", rep); 312 } 313 314 315 316 /** 317 * Returns 318 * PID2 (Patient Identification) - creates it if necessary 319 */ 320 public PID getPID2() { 321 return getTyped("PID2", PID.class); 322 } 323 324 325 326 327 /** 328 * Returns 329 * PD12 (Patient Additional Demographic) - creates it if necessary 330 */ 331 public PD1 getPD12() { 332 return getTyped("PD12", PD1.class); 333 } 334 335 336 337 338 /** 339 * Returns 340 * PV12 (Patient Visit) - creates it if necessary 341 */ 342 public PV1 getPV12() { 343 return getTyped("PV12", PV1.class); 344 } 345 346 347 348 349 /** 350 * Returns 351 * the first repetition of 352 * DB12 (Disability) - creates it if necessary 353 */ 354 public DB1 getDB12() { 355 return getTyped("DB12", DB1.class); 356 } 357 358 359 /** 360 * Returns a specific repetition of 361 * DB12 (Disability) - creates it if necessary 362 * 363 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 364 * @throws HL7Exception if the repetition requested is more than one 365 * greater than the number of existing repetitions. 366 */ 367 public DB1 getDB12(int rep) { 368 return getTyped("DB12", rep, DB1.class); 369 } 370 371 /** 372 * Returns the number of existing repetitions of DB12 373 */ 374 public int getDB12Reps() { 375 return getReps("DB12"); 376 } 377 378 /** 379 * <p> 380 * Returns a non-modifiable List containing all current existing repetitions of DB12. 381 * <p> 382 * <p> 383 * Note that unlike {@link #getDB12()}, this method will not create any reps 384 * if none are already present, so an empty list may be returned. 385 * </p> 386 */ 387 public List<DB1> getDB12All() throws HL7Exception { 388 return getAllAsList("DB12", DB1.class); 389 } 390 391 /** 392 * Inserts a specific repetition of DB12 (Disability) 393 * @see AbstractGroup#insertRepetition(Structure, int) 394 */ 395 public void insertDB12(DB1 structure, int rep) throws HL7Exception { 396 super.insertRepetition( "DB12", structure, rep); 397 } 398 399 400 /** 401 * Inserts a specific repetition of DB12 (Disability) 402 * @see AbstractGroup#insertRepetition(Structure, int) 403 */ 404 public DB1 insertDB12(int rep) throws HL7Exception { 405 return (DB1)super.insertRepetition("DB12", rep); 406 } 407 408 409 /** 410 * Removes a specific repetition of DB12 (Disability) 411 * @see AbstractGroup#removeRepetition(String, int) 412 */ 413 public DB1 removeDB12(int rep) throws HL7Exception { 414 return (DB1)super.removeRepetition("DB12", rep); 415 } 416 417 418 419} 420