1 /* 2 * This class is an auto-generated source file for a HAPI 3 * HL7 v2.x standard structure class. 4 * 5 * For more information, visit: http://hl7api.sourceforge.net/ 6 * 7 * The contents of this file are subject to the Mozilla Public License Version 1.1 8 * (the "License"); you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 10 * Software distributed under the License is distributed on an "AS IS" basis, 11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 12 * specific language governing rights and limitations under the License. 13 * 14 * The Original Code is "[file_name]". Description: 15 * "[one_line_description]" 16 * 17 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 18 * 2012. All Rights Reserved. 19 * 20 * Contributor(s): ______________________________________. 21 * 22 * Alternatively, the contents of this file may be used under the terms of the 23 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are 24 * applicable instead of those above. If you wish to allow use of your version of this 25 * file only under the terms of the GPL and not to allow others to use your version 26 * of this file under the MPL, indicate your decision by deleting the provisions above 27 * and replace them with the notice and other provisions required by the GPL License. 28 * If you do not delete the provisions above, a recipient may use your version of 29 * this file under either the MPL or the GPL. 30 * 31 */ 32 33 34 package ca.uhn.hl7v2.model.v281.segment; 35 36 // import ca.uhn.hl7v2.model.v281.group.*; 37 import ca.uhn.hl7v2.model.v281.datatype.*; 38 import ca.uhn.hl7v2.HL7Exception; 39 import ca.uhn.hl7v2.parser.ModelClassFactory; 40 import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 41 import ca.uhn.hl7v2.model.AbstractMessage; 42 import ca.uhn.hl7v2.model.Group; 43 import ca.uhn.hl7v2.model.Type; 44 import ca.uhn.hl7v2.model.AbstractSegment; 45 import ca.uhn.hl7v2.model.Varies; 46 47 48 /** 49 *<p>Represents an HL7 RCP message segment (Response Control Parameter). 50 * This segment has the following fields:</p> 51 * <ul> 52 * <li>RCP-1: Query Priority (ID) <b>optional </b> 53 * <li>RCP-2: Quantity Limited Request (CQ) <b>optional </b> 54 * <li>RCP-3: Response Modality (CNE) <b>optional </b> 55 * <li>RCP-4: Execution and Delivery Time (DTM) <b>optional </b> 56 * <li>RCP-5: Modify Indicator (ID) <b>optional </b> 57 * <li>RCP-6: Sort-by Field (SRT) <b>optional repeating</b> 58 * <li>RCP-7: Segment group inclusion (ID) <b>optional repeating</b> 59 * </ul> 60 */ 61 @SuppressWarnings("unused") 62 public class RCP extends AbstractSegment { 63 64 /** 65 * Creates a new RCP segment 66 */ 67 public RCP(Group parent, ModelClassFactory factory) { 68 super(parent, factory); 69 init(factory); 70 } 71 72 private void init(ModelClassFactory factory) { 73 try { 74 this.add(ID.class, false, 1, 0, new Object[]{ getMessage(), new Integer(91) }, "Query Priority"); 75 this.add(CQ.class, false, 1, 0, new Object[]{ getMessage() }, "Quantity Limited Request"); 76 this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "Response Modality"); 77 this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Execution and Delivery Time"); 78 this.add(ID.class, false, 1, 0, new Object[]{ getMessage(), new Integer(395) }, "Modify Indicator"); 79 this.add(SRT.class, false, 0, 0, new Object[]{ getMessage() }, "Sort-by Field"); 80 this.add(ID.class, false, 0, 0, new Object[]{ getMessage(), new Integer(391) }, "Segment group inclusion"); 81 } catch(HL7Exception e) { 82 log.error("Unexpected error creating RCP - this is probably a bug in the source code generator.", e); 83 } 84 } 85 86 87 88 /** 89 * Returns 90 * RCP-1: "Query Priority" - creates it if necessary 91 */ 92 public ID getQueryPriority() { 93 ID retVal = this.getTypedField(1, 0); 94 return retVal; 95 } 96 97 /** 98 * Returns 99 * RCP-1: "Query Priority" - creates it if necessary 100 */ 101 public ID getRcp1_QueryPriority() { 102 ID retVal = this.getTypedField(1, 0); 103 return retVal; 104 } 105 106 107 108 /** 109 * Returns 110 * RCP-2: "Quantity Limited Request" - creates it if necessary 111 */ 112 public CQ getQuantityLimitedRequest() { 113 CQ retVal = this.getTypedField(2, 0); 114 return retVal; 115 } 116 117 /** 118 * Returns 119 * RCP-2: "Quantity Limited Request" - creates it if necessary 120 */ 121 public CQ getRcp2_QuantityLimitedRequest() { 122 CQ retVal = this.getTypedField(2, 0); 123 return retVal; 124 } 125 126 127 128 /** 129 * Returns 130 * RCP-3: "Response Modality" - creates it if necessary 131 */ 132 public CNE getResponseModality() { 133 CNE retVal = this.getTypedField(3, 0); 134 return retVal; 135 } 136 137 /** 138 * Returns 139 * RCP-3: "Response Modality" - creates it if necessary 140 */ 141 public CNE getRcp3_ResponseModality() { 142 CNE retVal = this.getTypedField(3, 0); 143 return retVal; 144 } 145 146 147 148 /** 149 * Returns 150 * RCP-4: "Execution and Delivery Time" - creates it if necessary 151 */ 152 public DTM getExecutionAndDeliveryTime() { 153 DTM retVal = this.getTypedField(4, 0); 154 return retVal; 155 } 156 157 /** 158 * Returns 159 * RCP-4: "Execution and Delivery Time" - creates it if necessary 160 */ 161 public DTM getRcp4_ExecutionAndDeliveryTime() { 162 DTM retVal = this.getTypedField(4, 0); 163 return retVal; 164 } 165 166 167 168 /** 169 * Returns 170 * RCP-5: "Modify Indicator" - creates it if necessary 171 */ 172 public ID getModifyIndicator() { 173 ID retVal = this.getTypedField(5, 0); 174 return retVal; 175 } 176 177 /** 178 * Returns 179 * RCP-5: "Modify Indicator" - creates it if necessary 180 */ 181 public ID getRcp5_ModifyIndicator() { 182 ID retVal = this.getTypedField(5, 0); 183 return retVal; 184 } 185 186 187 /** 188 * Returns all repetitions of Sort-by Field (RCP-6). 189 */ 190 public SRT[] getSortByField() { 191 SRT[] retVal = this.getTypedField(6, new SRT[0]); 192 return retVal; 193 } 194 195 196 /** 197 * Returns all repetitions of Sort-by Field (RCP-6). 198 */ 199 public SRT[] getRcp6_SortByField() { 200 SRT[] retVal = this.getTypedField(6, new SRT[0]); 201 return retVal; 202 } 203 204 205 /** 206 * Returns a count of the current number of repetitions of Sort-by Field (RCP-6). 207 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 208 * it will return zero. 209 */ 210 public int getSortByFieldReps() { 211 return this.getReps(6); 212 } 213 214 215 /** 216 * Returns a specific repetition of 217 * RCP-6: "Sort-by Field" - creates it if necessary 218 * 219 * @param rep The repetition index (0-indexed) 220 */ 221 public SRT getSortByField(int rep) { 222 SRT retVal = this.getTypedField(6, rep); 223 return retVal; 224 } 225 226 /** 227 * Returns a specific repetition of 228 * RCP-6: "Sort-by Field" - creates it if necessary 229 * 230 * @param rep The repetition index (0-indexed) 231 */ 232 public SRT getRcp6_SortByField(int rep) { 233 SRT retVal = this.getTypedField(6, rep); 234 return retVal; 235 } 236 237 /** 238 * Returns a count of the current number of repetitions of Sort-by Field (RCP-6). 239 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 240 * it will return zero. 241 */ 242 public int getRcp6_SortByFieldReps() { 243 return this.getReps(6); 244 } 245 246 247 /** 248 * Inserts a repetition of 249 * RCP-6: "Sort-by Field" at a specific index 250 * 251 * @param rep The repetition index (0-indexed) 252 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 253 */ 254 public SRT insertSortByField(int rep) throws HL7Exception { 255 return (SRT) super.insertRepetition(6, rep); 256 } 257 258 259 /** 260 * Inserts a repetition of 261 * RCP-6: "Sort-by Field" at a specific index 262 * 263 * @param rep The repetition index (0-indexed) 264 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 265 */ 266 public SRT insertRcp6_SortByField(int rep) throws HL7Exception { 267 return (SRT) super.insertRepetition(6, rep); 268 } 269 270 271 /** 272 * Removes a repetition of 273 * RCP-6: "Sort-by Field" at a specific index 274 * 275 * @param rep The repetition index (0-indexed) 276 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 277 */ 278 public SRT removeSortByField(int rep) throws HL7Exception { 279 return (SRT) super.removeRepetition(6, rep); 280 } 281 282 283 /** 284 * Removes a repetition of 285 * RCP-6: "Sort-by Field" at a specific index 286 * 287 * @param rep The repetition index (0-indexed) 288 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 289 */ 290 public SRT removeRcp6_SortByField(int rep) throws HL7Exception { 291 return (SRT) super.removeRepetition(6, rep); 292 } 293 294 295 296 /** 297 * Returns all repetitions of Segment group inclusion (RCP-7). 298 */ 299 public ID[] getSegmentGroupInclusion() { 300 ID[] retVal = this.getTypedField(7, new ID[0]); 301 return retVal; 302 } 303 304 305 /** 306 * Returns all repetitions of Segment group inclusion (RCP-7). 307 */ 308 public ID[] getRcp7_SegmentGroupInclusion() { 309 ID[] retVal = this.getTypedField(7, new ID[0]); 310 return retVal; 311 } 312 313 314 /** 315 * Returns a count of the current number of repetitions of Segment group inclusion (RCP-7). 316 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 317 * it will return zero. 318 */ 319 public int getSegmentGroupInclusionReps() { 320 return this.getReps(7); 321 } 322 323 324 /** 325 * Returns a specific repetition of 326 * RCP-7: "Segment group inclusion" - creates it if necessary 327 * 328 * @param rep The repetition index (0-indexed) 329 */ 330 public ID getSegmentGroupInclusion(int rep) { 331 ID retVal = this.getTypedField(7, rep); 332 return retVal; 333 } 334 335 /** 336 * Returns a specific repetition of 337 * RCP-7: "Segment group inclusion" - creates it if necessary 338 * 339 * @param rep The repetition index (0-indexed) 340 */ 341 public ID getRcp7_SegmentGroupInclusion(int rep) { 342 ID retVal = this.getTypedField(7, rep); 343 return retVal; 344 } 345 346 /** 347 * Returns a count of the current number of repetitions of Segment group inclusion (RCP-7). 348 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 349 * it will return zero. 350 */ 351 public int getRcp7_SegmentGroupInclusionReps() { 352 return this.getReps(7); 353 } 354 355 356 /** 357 * Inserts a repetition of 358 * RCP-7: "Segment group inclusion" at a specific index 359 * 360 * @param rep The repetition index (0-indexed) 361 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 362 */ 363 public ID insertSegmentGroupInclusion(int rep) throws HL7Exception { 364 return (ID) super.insertRepetition(7, rep); 365 } 366 367 368 /** 369 * Inserts a repetition of 370 * RCP-7: "Segment group inclusion" at a specific index 371 * 372 * @param rep The repetition index (0-indexed) 373 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 374 */ 375 public ID insertRcp7_SegmentGroupInclusion(int rep) throws HL7Exception { 376 return (ID) super.insertRepetition(7, rep); 377 } 378 379 380 /** 381 * Removes a repetition of 382 * RCP-7: "Segment group inclusion" at a specific index 383 * 384 * @param rep The repetition index (0-indexed) 385 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 386 */ 387 public ID removeSegmentGroupInclusion(int rep) throws HL7Exception { 388 return (ID) super.removeRepetition(7, rep); 389 } 390 391 392 /** 393 * Removes a repetition of 394 * RCP-7: "Segment group inclusion" at a specific index 395 * 396 * @param rep The repetition index (0-indexed) 397 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 398 */ 399 public ID removeRcp7_SegmentGroupInclusion(int rep) throws HL7Exception { 400 return (ID) super.removeRepetition(7, rep); 401 } 402 403 404 405 406 407 408 /** {@inheritDoc} */ 409 protected Type createNewTypeWithoutReflection(int field) { 410 switch (field) { 411 case 0: return new ID(getMessage(), new Integer( 91 )); 412 case 1: return new CQ(getMessage()); 413 case 2: return new CNE(getMessage()); 414 case 3: return new DTM(getMessage()); 415 case 4: return new ID(getMessage(), new Integer( 395 )); 416 case 5: return new SRT(getMessage()); 417 case 6: return new ID(getMessage(), new Integer( 391 )); 418 default: return null; 419 } 420 } 421 422 423 } 424