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 QBP_Qnn message structure (see chapter 5.3.2.3). 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: QPD (Query Parameter Definition) <b> </b></li> 054 * <li>5: RDF (Table Row Definition) <b>optional </b></li> 055 * <li>6: RCP (Response Control Parameter) <b> </b></li> 056 * <li>7: DSC (Continuation Pointer) <b>optional </b></li> 057 * <li>8: MSH (Message Header) <b> </b></li> 058 * <li>9: SFT (Software Segment) <b>optional repeating</b></li> 059 * <li>10: UAC (User Authentication Credential Segment) <b>optional </b></li> 060 * <li>11: MSA (Message Acknowledgment) <b> </b></li> 061 * <li>12: ERR (Error) <b>optional </b></li> 062 * <li>13: QAK (Query Acknowledgment) <b> </b></li> 063 * <li>14: QPD (Query Parameter Definition) <b> </b></li> 064 * <li>15: Hxx (any HL7 segment) <b> </b></li> 065 * <li>16: DSC (Continuation Pointer) <b>optional </b></li> 066 * </ul> 067 */ 068@SuppressWarnings("unused") 069public class QBP_Qnn extends AbstractMessage { 070 071 /** 072 * Creates a new QBP_Qnn message with DefaultModelClassFactory. 073 */ 074 public QBP_Qnn() { 075 this(new DefaultModelClassFactory()); 076 } 077 078 /** 079 * Creates a new QBP_Qnn message with custom ModelClassFactory. 080 */ 081 public QBP_Qnn(ModelClassFactory factory) { 082 super(factory); 083 init(factory); 084 } 085 086 private void init(ModelClassFactory factory) { 087 try { 088 this.add(MSH.class, true, false); 089 this.add(SFT.class, false, true); 090 this.add(UAC.class, false, false); 091 this.add(QPD.class, true, false); 092 this.add(RDF.class, false, false); 093 this.add(RCP.class, true, false); 094 this.add(DSC.class, false, false); 095 this.add(MSH.class, true, false); 096 this.add(SFT.class, false, true); 097 this.add(UAC.class, false, false); 098 this.add(MSA.class, true, false); 099 this.add(ERR.class, false, false); 100 this.add(QAK.class, true, false); 101 this.add(QPD.class, true, false); 102 this.add(Hxx.class, true, false); 103 this.add(DSC.class, false, false); 104 } catch(HL7Exception e) { 105 log.error("Unexpected error creating QBP_Qnn - this is probably a bug in the source code generator.", e); 106 } 107 } 108 109 /** 110 * Returns "2.6" 111 */ 112 public String getVersion() { 113 return "2.6"; 114 } 115 116 117 118 /** 119 * Returns 120 * MSH (Message Header) - creates it if necessary 121 */ 122 public MSH getMSH() { 123 return getTyped("MSH", MSH.class); 124 } 125 126 127 128 129 /** 130 * Returns 131 * the first repetition of 132 * SFT (Software Segment) - creates it if necessary 133 */ 134 public SFT getSFT() { 135 return getTyped("SFT", SFT.class); 136 } 137 138 139 /** 140 * Returns a specific repetition of 141 * SFT (Software Segment) - creates it if necessary 142 * 143 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 144 * @throws HL7Exception if the repetition requested is more than one 145 * greater than the number of existing repetitions. 146 */ 147 public SFT getSFT(int rep) { 148 return getTyped("SFT", rep, SFT.class); 149 } 150 151 /** 152 * Returns the number of existing repetitions of SFT 153 */ 154 public int getSFTReps() { 155 return getReps("SFT"); 156 } 157 158 /** 159 * <p> 160 * Returns a non-modifiable List containing all current existing repetitions of SFT. 161 * <p> 162 * <p> 163 * Note that unlike {@link #getSFT()}, this method will not create any reps 164 * if none are already present, so an empty list may be returned. 165 * </p> 166 */ 167 public List<SFT> getSFTAll() throws HL7Exception { 168 return getAllAsList("SFT", SFT.class); 169 } 170 171 /** 172 * Inserts a specific repetition of SFT (Software Segment) 173 * @see AbstractGroup#insertRepetition(Structure, int) 174 */ 175 public void insertSFT(SFT structure, int rep) throws HL7Exception { 176 super.insertRepetition( "SFT", structure, rep); 177 } 178 179 180 /** 181 * Inserts a specific repetition of SFT (Software Segment) 182 * @see AbstractGroup#insertRepetition(Structure, int) 183 */ 184 public SFT insertSFT(int rep) throws HL7Exception { 185 return (SFT)super.insertRepetition("SFT", rep); 186 } 187 188 189 /** 190 * Removes a specific repetition of SFT (Software Segment) 191 * @see AbstractGroup#removeRepetition(String, int) 192 */ 193 public SFT removeSFT(int rep) throws HL7Exception { 194 return (SFT)super.removeRepetition("SFT", rep); 195 } 196 197 198 199 /** 200 * Returns 201 * UAC (User Authentication Credential Segment) - creates it if necessary 202 */ 203 public UAC getUAC() { 204 return getTyped("UAC", UAC.class); 205 } 206 207 208 209 210 /** 211 * Returns 212 * QPD (Query Parameter Definition) - creates it if necessary 213 */ 214 public QPD getQPD() { 215 return getTyped("QPD", QPD.class); 216 } 217 218 219 220 221 /** 222 * Returns 223 * RDF (Table Row Definition) - creates it if necessary 224 */ 225 public RDF getRDF() { 226 return getTyped("RDF", RDF.class); 227 } 228 229 230 231 232 /** 233 * Returns 234 * RCP (Response Control Parameter) - creates it if necessary 235 */ 236 public RCP getRCP() { 237 return getTyped("RCP", RCP.class); 238 } 239 240 241 242 243 /** 244 * Returns 245 * DSC (Continuation Pointer) - creates it if necessary 246 */ 247 public DSC getDSC() { 248 return getTyped("DSC", DSC.class); 249 } 250 251 252 253 254 /** 255 * Returns 256 * MSH2 (Message Header) - creates it if necessary 257 */ 258 public MSH getMSH2() { 259 return getTyped("MSH2", MSH.class); 260 } 261 262 263 264 265 /** 266 * Returns 267 * the first repetition of 268 * SFT2 (Software Segment) - creates it if necessary 269 */ 270 public SFT getSFT2() { 271 return getTyped("SFT2", SFT.class); 272 } 273 274 275 /** 276 * Returns a specific repetition of 277 * SFT2 (Software Segment) - creates it if necessary 278 * 279 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 280 * @throws HL7Exception if the repetition requested is more than one 281 * greater than the number of existing repetitions. 282 */ 283 public SFT getSFT2(int rep) { 284 return getTyped("SFT2", rep, SFT.class); 285 } 286 287 /** 288 * Returns the number of existing repetitions of SFT2 289 */ 290 public int getSFT2Reps() { 291 return getReps("SFT2"); 292 } 293 294 /** 295 * <p> 296 * Returns a non-modifiable List containing all current existing repetitions of SFT2. 297 * <p> 298 * <p> 299 * Note that unlike {@link #getSFT2()}, this method will not create any reps 300 * if none are already present, so an empty list may be returned. 301 * </p> 302 */ 303 public List<SFT> getSFT2All() throws HL7Exception { 304 return getAllAsList("SFT2", SFT.class); 305 } 306 307 /** 308 * Inserts a specific repetition of SFT2 (Software Segment) 309 * @see AbstractGroup#insertRepetition(Structure, int) 310 */ 311 public void insertSFT2(SFT structure, int rep) throws HL7Exception { 312 super.insertRepetition( "SFT2", structure, rep); 313 } 314 315 316 /** 317 * Inserts a specific repetition of SFT2 (Software Segment) 318 * @see AbstractGroup#insertRepetition(Structure, int) 319 */ 320 public SFT insertSFT2(int rep) throws HL7Exception { 321 return (SFT)super.insertRepetition("SFT2", rep); 322 } 323 324 325 /** 326 * Removes a specific repetition of SFT2 (Software Segment) 327 * @see AbstractGroup#removeRepetition(String, int) 328 */ 329 public SFT removeSFT2(int rep) throws HL7Exception { 330 return (SFT)super.removeRepetition("SFT2", rep); 331 } 332 333 334 335 /** 336 * Returns 337 * UAC2 (User Authentication Credential Segment) - creates it if necessary 338 */ 339 public UAC getUAC2() { 340 return getTyped("UAC2", UAC.class); 341 } 342 343 344 345 346 /** 347 * Returns 348 * MSA (Message Acknowledgment) - creates it if necessary 349 */ 350 public MSA getMSA() { 351 return getTyped("MSA", MSA.class); 352 } 353 354 355 356 357 /** 358 * Returns 359 * ERR (Error) - creates it if necessary 360 */ 361 public ERR getERR() { 362 return getTyped("ERR", ERR.class); 363 } 364 365 366 367 368 /** 369 * Returns 370 * QAK (Query Acknowledgment) - creates it if necessary 371 */ 372 public QAK getQAK() { 373 return getTyped("QAK", QAK.class); 374 } 375 376 377 378 379 /** 380 * Returns 381 * QPD2 (Query Parameter Definition) - creates it if necessary 382 */ 383 public QPD getQPD2() { 384 return getTyped("QPD2", QPD.class); 385 } 386 387 388 389 390 /** 391 * Returns 392 * Hxx (any HL7 segment) - creates it if necessary 393 */ 394 public Hxx getHxx() { 395 return getTyped("Hxx", Hxx.class); 396 } 397 398 399 400 401 /** 402 * Returns 403 * DSC2 (Continuation Pointer) - creates it if necessary 404 */ 405 public DSC getDSC2() { 406 return getTyped("DSC2", DSC.class); 407 } 408 409 410 411 412} 413