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.v21.segment; 035 036// import ca.uhn.hl7v2.model.v21.group.*; 037import ca.uhn.hl7v2.model.v21.datatype.*; 038import ca.uhn.hl7v2.HL7Exception; 039import ca.uhn.hl7v2.parser.ModelClassFactory; 040import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 041import ca.uhn.hl7v2.model.AbstractMessage; 042import ca.uhn.hl7v2.model.Group; 043import ca.uhn.hl7v2.model.Type; 044import ca.uhn.hl7v2.model.AbstractSegment; 045import ca.uhn.hl7v2.model.Varies; 046 047 048/** 049 *<p>Represents an HL7 QRF message segment (QUERY FILTER). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>QRF-1: WHERE SUBJECT FILTER (ST) <b> repeating</b> 053 * <li>QRF-2: WHEN DATA START DATE/TIME (TS) <b>optional </b> 054 * <li>QRF-3: WHEN DATA END DATE/TIME (TS) <b>optional </b> 055 * <li>QRF-4: WHAT USER QUALIFIER (ST) <b>optional repeating</b> 056 * <li>QRF-5: OTHER QRY SUBJECT FILTER (ST) <b>optional repeating</b> 057 * </ul> 058 */ 059@SuppressWarnings("unused") 060public class QRF extends AbstractSegment { 061 062 /** 063 * Creates a new QRF segment 064 */ 065 public QRF(Group parent, ModelClassFactory factory) { 066 super(parent, factory); 067 init(factory); 068 } 069 070 private void init(ModelClassFactory factory) { 071 try { 072 this.add(ST.class, true, 0, 20, new Object[]{ getMessage() }, "WHERE SUBJECT FILTER"); 073 this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "WHEN DATA START DATE/TIME"); 074 this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "WHEN DATA END DATE/TIME"); 075 this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "WHAT USER QUALIFIER"); 076 this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "OTHER QRY SUBJECT FILTER"); 077 } catch(HL7Exception e) { 078 log.error("Unexpected error creating QRF - this is probably a bug in the source code generator.", e); 079 } 080 } 081 082 083 /** 084 * Returns all repetitions of WHERE SUBJECT FILTER (QRF-1). 085 */ 086 public ST[] getWHERESUBJECTFILTER() { 087 ST[] retVal = this.getTypedField(1, new ST[0]); 088 return retVal; 089 } 090 091 092 /** 093 * Returns all repetitions of WHERE SUBJECT FILTER (QRF-1). 094 */ 095 public ST[] getQrf1_WHERESUBJECTFILTER() { 096 ST[] retVal = this.getTypedField(1, new ST[0]); 097 return retVal; 098 } 099 100 101 /** 102 * Returns a count of the current number of repetitions of WHERE SUBJECT FILTER (QRF-1). 103 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 104 * it will return zero. 105 */ 106 public int getWHERESUBJECTFILTERReps() { 107 return this.getReps(1); 108 } 109 110 111 /** 112 * Returns a specific repetition of 113 * QRF-1: "WHERE SUBJECT FILTER" - creates it if necessary 114 * 115 * @param rep The repetition index (0-indexed) 116 */ 117 public ST getWHERESUBJECTFILTER(int rep) { 118 ST retVal = this.getTypedField(1, rep); 119 return retVal; 120 } 121 122 /** 123 * Returns a specific repetition of 124 * QRF-1: "WHERE SUBJECT FILTER" - creates it if necessary 125 * 126 * @param rep The repetition index (0-indexed) 127 */ 128 public ST getQrf1_WHERESUBJECTFILTER(int rep) { 129 ST retVal = this.getTypedField(1, rep); 130 return retVal; 131 } 132 133 /** 134 * Returns a count of the current number of repetitions of WHERE SUBJECT FILTER (QRF-1). 135 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 136 * it will return zero. 137 */ 138 public int getQrf1_WHERESUBJECTFILTERReps() { 139 return this.getReps(1); 140 } 141 142 143 /** 144 * Inserts a repetition of 145 * QRF-1: "WHERE SUBJECT FILTER" at a specific index 146 * 147 * @param rep The repetition index (0-indexed) 148 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 149 */ 150 public ST insertWHERESUBJECTFILTER(int rep) throws HL7Exception { 151 return (ST) super.insertRepetition(1, rep); 152 } 153 154 155 /** 156 * Inserts a repetition of 157 * QRF-1: "WHERE SUBJECT FILTER" at a specific index 158 * 159 * @param rep The repetition index (0-indexed) 160 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 161 */ 162 public ST insertQrf1_WHERESUBJECTFILTER(int rep) throws HL7Exception { 163 return (ST) super.insertRepetition(1, rep); 164 } 165 166 167 /** 168 * Removes a repetition of 169 * QRF-1: "WHERE SUBJECT FILTER" at a specific index 170 * 171 * @param rep The repetition index (0-indexed) 172 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 173 */ 174 public ST removeWHERESUBJECTFILTER(int rep) throws HL7Exception { 175 return (ST) super.removeRepetition(1, rep); 176 } 177 178 179 /** 180 * Removes a repetition of 181 * QRF-1: "WHERE SUBJECT FILTER" at a specific index 182 * 183 * @param rep The repetition index (0-indexed) 184 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 185 */ 186 public ST removeQrf1_WHERESUBJECTFILTER(int rep) throws HL7Exception { 187 return (ST) super.removeRepetition(1, rep); 188 } 189 190 191 192 193 /** 194 * Returns 195 * QRF-2: "WHEN DATA START DATE/TIME" - creates it if necessary 196 */ 197 public TS getWHENDATASTARTDATETIME() { 198 TS retVal = this.getTypedField(2, 0); 199 return retVal; 200 } 201 202 /** 203 * Returns 204 * QRF-2: "WHEN DATA START DATE/TIME" - creates it if necessary 205 */ 206 public TS getQrf2_WHENDATASTARTDATETIME() { 207 TS retVal = this.getTypedField(2, 0); 208 return retVal; 209 } 210 211 212 213 /** 214 * Returns 215 * QRF-3: "WHEN DATA END DATE/TIME" - creates it if necessary 216 */ 217 public TS getWHENDATAENDDATETIME() { 218 TS retVal = this.getTypedField(3, 0); 219 return retVal; 220 } 221 222 /** 223 * Returns 224 * QRF-3: "WHEN DATA END DATE/TIME" - creates it if necessary 225 */ 226 public TS getQrf3_WHENDATAENDDATETIME() { 227 TS retVal = this.getTypedField(3, 0); 228 return retVal; 229 } 230 231 232 /** 233 * Returns all repetitions of WHAT USER QUALIFIER (QRF-4). 234 */ 235 public ST[] getWHATUSERQUALIFIER() { 236 ST[] retVal = this.getTypedField(4, new ST[0]); 237 return retVal; 238 } 239 240 241 /** 242 * Returns all repetitions of WHAT USER QUALIFIER (QRF-4). 243 */ 244 public ST[] getQrf4_WHATUSERQUALIFIER() { 245 ST[] retVal = this.getTypedField(4, new ST[0]); 246 return retVal; 247 } 248 249 250 /** 251 * Returns a count of the current number of repetitions of WHAT USER QUALIFIER (QRF-4). 252 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 253 * it will return zero. 254 */ 255 public int getWHATUSERQUALIFIERReps() { 256 return this.getReps(4); 257 } 258 259 260 /** 261 * Returns a specific repetition of 262 * QRF-4: "WHAT USER QUALIFIER" - creates it if necessary 263 * 264 * @param rep The repetition index (0-indexed) 265 */ 266 public ST getWHATUSERQUALIFIER(int rep) { 267 ST retVal = this.getTypedField(4, rep); 268 return retVal; 269 } 270 271 /** 272 * Returns a specific repetition of 273 * QRF-4: "WHAT USER QUALIFIER" - creates it if necessary 274 * 275 * @param rep The repetition index (0-indexed) 276 */ 277 public ST getQrf4_WHATUSERQUALIFIER(int rep) { 278 ST retVal = this.getTypedField(4, rep); 279 return retVal; 280 } 281 282 /** 283 * Returns a count of the current number of repetitions of WHAT USER QUALIFIER (QRF-4). 284 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 285 * it will return zero. 286 */ 287 public int getQrf4_WHATUSERQUALIFIERReps() { 288 return this.getReps(4); 289 } 290 291 292 /** 293 * Inserts a repetition of 294 * QRF-4: "WHAT USER QUALIFIER" at a specific index 295 * 296 * @param rep The repetition index (0-indexed) 297 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 298 */ 299 public ST insertWHATUSERQUALIFIER(int rep) throws HL7Exception { 300 return (ST) super.insertRepetition(4, rep); 301 } 302 303 304 /** 305 * Inserts a repetition of 306 * QRF-4: "WHAT USER QUALIFIER" at a specific index 307 * 308 * @param rep The repetition index (0-indexed) 309 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 310 */ 311 public ST insertQrf4_WHATUSERQUALIFIER(int rep) throws HL7Exception { 312 return (ST) super.insertRepetition(4, rep); 313 } 314 315 316 /** 317 * Removes a repetition of 318 * QRF-4: "WHAT USER QUALIFIER" at a specific index 319 * 320 * @param rep The repetition index (0-indexed) 321 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 322 */ 323 public ST removeWHATUSERQUALIFIER(int rep) throws HL7Exception { 324 return (ST) super.removeRepetition(4, rep); 325 } 326 327 328 /** 329 * Removes a repetition of 330 * QRF-4: "WHAT USER QUALIFIER" at a specific index 331 * 332 * @param rep The repetition index (0-indexed) 333 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 334 */ 335 public ST removeQrf4_WHATUSERQUALIFIER(int rep) throws HL7Exception { 336 return (ST) super.removeRepetition(4, rep); 337 } 338 339 340 341 /** 342 * Returns all repetitions of OTHER QRY SUBJECT FILTER (QRF-5). 343 */ 344 public ST[] getOTHERQRYSUBJECTFILTER() { 345 ST[] retVal = this.getTypedField(5, new ST[0]); 346 return retVal; 347 } 348 349 350 /** 351 * Returns all repetitions of OTHER QRY SUBJECT FILTER (QRF-5). 352 */ 353 public ST[] getQrf5_OTHERQRYSUBJECTFILTER() { 354 ST[] retVal = this.getTypedField(5, new ST[0]); 355 return retVal; 356 } 357 358 359 /** 360 * Returns a count of the current number of repetitions of OTHER QRY SUBJECT FILTER (QRF-5). 361 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 362 * it will return zero. 363 */ 364 public int getOTHERQRYSUBJECTFILTERReps() { 365 return this.getReps(5); 366 } 367 368 369 /** 370 * Returns a specific repetition of 371 * QRF-5: "OTHER QRY SUBJECT FILTER" - creates it if necessary 372 * 373 * @param rep The repetition index (0-indexed) 374 */ 375 public ST getOTHERQRYSUBJECTFILTER(int rep) { 376 ST retVal = this.getTypedField(5, rep); 377 return retVal; 378 } 379 380 /** 381 * Returns a specific repetition of 382 * QRF-5: "OTHER QRY SUBJECT FILTER" - creates it if necessary 383 * 384 * @param rep The repetition index (0-indexed) 385 */ 386 public ST getQrf5_OTHERQRYSUBJECTFILTER(int rep) { 387 ST retVal = this.getTypedField(5, rep); 388 return retVal; 389 } 390 391 /** 392 * Returns a count of the current number of repetitions of OTHER QRY SUBJECT FILTER (QRF-5). 393 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 394 * it will return zero. 395 */ 396 public int getQrf5_OTHERQRYSUBJECTFILTERReps() { 397 return this.getReps(5); 398 } 399 400 401 /** 402 * Inserts a repetition of 403 * QRF-5: "OTHER QRY SUBJECT FILTER" at a specific index 404 * 405 * @param rep The repetition index (0-indexed) 406 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 407 */ 408 public ST insertOTHERQRYSUBJECTFILTER(int rep) throws HL7Exception { 409 return (ST) super.insertRepetition(5, rep); 410 } 411 412 413 /** 414 * Inserts a repetition of 415 * QRF-5: "OTHER QRY SUBJECT FILTER" at a specific index 416 * 417 * @param rep The repetition index (0-indexed) 418 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 419 */ 420 public ST insertQrf5_OTHERQRYSUBJECTFILTER(int rep) throws HL7Exception { 421 return (ST) super.insertRepetition(5, rep); 422 } 423 424 425 /** 426 * Removes a repetition of 427 * QRF-5: "OTHER QRY SUBJECT FILTER" at a specific index 428 * 429 * @param rep The repetition index (0-indexed) 430 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 431 */ 432 public ST removeOTHERQRYSUBJECTFILTER(int rep) throws HL7Exception { 433 return (ST) super.removeRepetition(5, rep); 434 } 435 436 437 /** 438 * Removes a repetition of 439 * QRF-5: "OTHER QRY SUBJECT FILTER" at a specific index 440 * 441 * @param rep The repetition index (0-indexed) 442 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 443 */ 444 public ST removeQrf5_OTHERQRYSUBJECTFILTER(int rep) throws HL7Exception { 445 return (ST) super.removeRepetition(5, rep); 446 } 447 448 449 450 451 452 453 /** {@inheritDoc} */ 454 protected Type createNewTypeWithoutReflection(int field) { 455 switch (field) { 456 case 0: return new ST(getMessage()); 457 case 1: return new TS(getMessage()); 458 case 2: return new TS(getMessage()); 459 case 3: return new ST(getMessage()); 460 case 4: return new ST(getMessage()); 461 default: return null; 462 } 463 } 464 465 466} 467