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 MFR_M05 message structure (see chapter 8.9.1). 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: MSA (Message Acknowledgment) <b> </b></li> 054 * <li>5: ERR (Error) <b>optional repeating</b></li> 055 * <li>6: QAK (Query Acknowledgment) <b>optional </b></li> 056 * <li>7: QRD (Original-Style Query Definition) <b> </b></li> 057 * <li>8: QRF (Original style query filter) <b>optional </b></li> 058 * <li>9: MFI (Master File Identification) <b> </b></li> 059 * <li>10: MFR_M05_MF_QUERY (a Group object) <b> repeating</b></li> 060 * <li>11: DSC (Continuation Pointer) <b>optional </b></li> 061 * </ul> 062 */ 063@SuppressWarnings("unused") 064public class MFR_M05 extends AbstractMessage { 065 066 /** 067 * Creates a new MFR_M05 message with DefaultModelClassFactory. 068 */ 069 public MFR_M05() { 070 this(new DefaultModelClassFactory()); 071 } 072 073 /** 074 * Creates a new MFR_M05 message with custom ModelClassFactory. 075 */ 076 public MFR_M05(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(MSA.class, true, false); 087 this.add(ERR.class, false, true); 088 this.add(QAK.class, false, false); 089 this.add(QRD.class, true, false); 090 this.add(QRF.class, false, false); 091 this.add(MFI.class, true, false); 092 this.add(MFR_M05_MF_QUERY.class, true, true); 093 this.add(DSC.class, false, false); 094 } catch(HL7Exception e) { 095 log.error("Unexpected error creating MFR_M05 - 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 * MSA (Message Acknowledgment) - creates it if necessary 203 */ 204 public MSA getMSA() { 205 return getTyped("MSA", MSA.class); 206 } 207 208 209 210 211 /** 212 * Returns 213 * the first repetition of 214 * ERR (Error) - creates it if necessary 215 */ 216 public ERR getERR() { 217 return getTyped("ERR", ERR.class); 218 } 219 220 221 /** 222 * Returns a specific repetition of 223 * ERR (Error) - creates it if necessary 224 * 225 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 226 * @throws HL7Exception if the repetition requested is more than one 227 * greater than the number of existing repetitions. 228 */ 229 public ERR getERR(int rep) { 230 return getTyped("ERR", rep, ERR.class); 231 } 232 233 /** 234 * Returns the number of existing repetitions of ERR 235 */ 236 public int getERRReps() { 237 return getReps("ERR"); 238 } 239 240 /** 241 * <p> 242 * Returns a non-modifiable List containing all current existing repetitions of ERR. 243 * <p> 244 * <p> 245 * Note that unlike {@link #getERR()}, this method will not create any reps 246 * if none are already present, so an empty list may be returned. 247 * </p> 248 */ 249 public List<ERR> getERRAll() throws HL7Exception { 250 return getAllAsList("ERR", ERR.class); 251 } 252 253 /** 254 * Inserts a specific repetition of ERR (Error) 255 * @see AbstractGroup#insertRepetition(Structure, int) 256 */ 257 public void insertERR(ERR structure, int rep) throws HL7Exception { 258 super.insertRepetition( "ERR", structure, rep); 259 } 260 261 262 /** 263 * Inserts a specific repetition of ERR (Error) 264 * @see AbstractGroup#insertRepetition(Structure, int) 265 */ 266 public ERR insertERR(int rep) throws HL7Exception { 267 return (ERR)super.insertRepetition("ERR", rep); 268 } 269 270 271 /** 272 * Removes a specific repetition of ERR (Error) 273 * @see AbstractGroup#removeRepetition(String, int) 274 */ 275 public ERR removeERR(int rep) throws HL7Exception { 276 return (ERR)super.removeRepetition("ERR", rep); 277 } 278 279 280 281 /** 282 * Returns 283 * QAK (Query Acknowledgment) - creates it if necessary 284 */ 285 public QAK getQAK() { 286 return getTyped("QAK", QAK.class); 287 } 288 289 290 291 292 /** 293 * Returns 294 * QRD (Original-Style Query Definition) - creates it if necessary 295 */ 296 public QRD getQRD() { 297 return getTyped("QRD", QRD.class); 298 } 299 300 301 302 303 /** 304 * Returns 305 * QRF (Original style query filter) - creates it if necessary 306 */ 307 public QRF getQRF() { 308 return getTyped("QRF", QRF.class); 309 } 310 311 312 313 314 /** 315 * Returns 316 * MFI (Master File Identification) - creates it if necessary 317 */ 318 public MFI getMFI() { 319 return getTyped("MFI", MFI.class); 320 } 321 322 323 324 325 /** 326 * Returns 327 * the first repetition of 328 * MF_QUERY (a Group object) - creates it if necessary 329 */ 330 public MFR_M05_MF_QUERY getMF_QUERY() { 331 return getTyped("MF_QUERY", MFR_M05_MF_QUERY.class); 332 } 333 334 335 /** 336 * Returns a specific repetition of 337 * MF_QUERY (a Group object) - 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 MFR_M05_MF_QUERY getMF_QUERY(int rep) { 344 return getTyped("MF_QUERY", rep, MFR_M05_MF_QUERY.class); 345 } 346 347 /** 348 * Returns the number of existing repetitions of MF_QUERY 349 */ 350 public int getMF_QUERYReps() { 351 return getReps("MF_QUERY"); 352 } 353 354 /** 355 * <p> 356 * Returns a non-modifiable List containing all current existing repetitions of MF_QUERY. 357 * <p> 358 * <p> 359 * Note that unlike {@link #getMF_QUERY()}, 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<MFR_M05_MF_QUERY> getMF_QUERYAll() throws HL7Exception { 364 return getAllAsList("MF_QUERY", MFR_M05_MF_QUERY.class); 365 } 366 367 /** 368 * Inserts a specific repetition of MF_QUERY (a Group object) 369 * @see AbstractGroup#insertRepetition(Structure, int) 370 */ 371 public void insertMF_QUERY(MFR_M05_MF_QUERY structure, int rep) throws HL7Exception { 372 super.insertRepetition( "MF_QUERY", structure, rep); 373 } 374 375 376 /** 377 * Inserts a specific repetition of MF_QUERY (a Group object) 378 * @see AbstractGroup#insertRepetition(Structure, int) 379 */ 380 public MFR_M05_MF_QUERY insertMF_QUERY(int rep) throws HL7Exception { 381 return (MFR_M05_MF_QUERY)super.insertRepetition("MF_QUERY", rep); 382 } 383 384 385 /** 386 * Removes a specific repetition of MF_QUERY (a Group object) 387 * @see AbstractGroup#removeRepetition(String, int) 388 */ 389 public MFR_M05_MF_QUERY removeMF_QUERY(int rep) throws HL7Exception { 390 return (MFR_M05_MF_QUERY)super.removeRepetition("MF_QUERY", rep); 391 } 392 393 394 395 /** 396 * Returns 397 * DSC (Continuation Pointer) - creates it if necessary 398 */ 399 public DSC getDSC() { 400 return getTyped("DSC", DSC.class); 401 } 402 403 404 405 406} 407