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.v25.segment; 35 36 // import ca.uhn.hl7v2.model.v25.group.*; 37 import ca.uhn.hl7v2.model.v25.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 GP1 message segment (Grouping/Reimbursement - Visit). 50 * This segment has the following fields:</p> 51 * <ul> 52 * <li>GP1-1: Type of Bill Code (IS) <b> </b> 53 * <li>GP1-2: Revenue Code (IS) <b>optional repeating</b> 54 * <li>GP1-3: Overall Claim Disposition Code (IS) <b>optional </b> 55 * <li>GP1-4: OCE Edits per Visit Code (IS) <b>optional repeating</b> 56 * <li>GP1-5: Outlier Cost (CP) <b>optional </b> 57 * </ul> 58 */ 59 @SuppressWarnings("unused") 60 public class GP1 extends AbstractSegment { 61 62 /** 63 * Creates a new GP1 segment 64 */ 65 public GP1(Group parent, ModelClassFactory factory) { 66 super(parent, factory); 67 init(factory); 68 } 69 70 private void init(ModelClassFactory factory) { 71 try { 72 this.add(IS.class, true, 1, 3, new Object[]{ getMessage(), new Integer(455) }, "Type of Bill Code"); 73 this.add(IS.class, false, 0, 3, new Object[]{ getMessage(), new Integer(456) }, "Revenue Code"); 74 this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(457) }, "Overall Claim Disposition Code"); 75 this.add(IS.class, false, 0, 2, new Object[]{ getMessage(), new Integer(458) }, "OCE Edits per Visit Code"); 76 this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Outlier Cost"); 77 } catch(HL7Exception e) { 78 log.error("Unexpected error creating GP1 - this is probably a bug in the source code generator.", e); 79 } 80 } 81 82 83 84 /** 85 * Returns 86 * GP1-1: "Type of Bill Code" - creates it if necessary 87 */ 88 public IS getTypeOfBillCode() { 89 IS retVal = this.getTypedField(1, 0); 90 return retVal; 91 } 92 93 /** 94 * Returns 95 * GP1-1: "Type of Bill Code" - creates it if necessary 96 */ 97 public IS getGp11_TypeOfBillCode() { 98 IS retVal = this.getTypedField(1, 0); 99 return retVal; 100 } 101 102 103 /** 104 * Returns all repetitions of Revenue Code (GP1-2). 105 */ 106 public IS[] getRevenueCode() { 107 IS[] retVal = this.getTypedField(2, new IS[0]); 108 return retVal; 109 } 110 111 112 /** 113 * Returns all repetitions of Revenue Code (GP1-2). 114 */ 115 public IS[] getGp12_RevenueCode() { 116 IS[] retVal = this.getTypedField(2, new IS[0]); 117 return retVal; 118 } 119 120 121 /** 122 * Returns a count of the current number of repetitions of Revenue Code (GP1-2). 123 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 124 * it will return zero. 125 */ 126 public int getRevenueCodeReps() { 127 return this.getReps(2); 128 } 129 130 131 /** 132 * Returns a specific repetition of 133 * GP1-2: "Revenue Code" - creates it if necessary 134 * 135 * @param rep The repetition index (0-indexed) 136 */ 137 public IS getRevenueCode(int rep) { 138 IS retVal = this.getTypedField(2, rep); 139 return retVal; 140 } 141 142 /** 143 * Returns a specific repetition of 144 * GP1-2: "Revenue Code" - creates it if necessary 145 * 146 * @param rep The repetition index (0-indexed) 147 */ 148 public IS getGp12_RevenueCode(int rep) { 149 IS retVal = this.getTypedField(2, rep); 150 return retVal; 151 } 152 153 /** 154 * Returns a count of the current number of repetitions of Revenue Code (GP1-2). 155 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 156 * it will return zero. 157 */ 158 public int getGp12_RevenueCodeReps() { 159 return this.getReps(2); 160 } 161 162 163 /** 164 * Inserts a repetition of 165 * GP1-2: "Revenue Code" at a specific index 166 * 167 * @param rep The repetition index (0-indexed) 168 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 169 */ 170 public IS insertRevenueCode(int rep) throws HL7Exception { 171 return (IS) super.insertRepetition(2, rep); 172 } 173 174 175 /** 176 * Inserts a repetition of 177 * GP1-2: "Revenue Code" at a specific index 178 * 179 * @param rep The repetition index (0-indexed) 180 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 181 */ 182 public IS insertGp12_RevenueCode(int rep) throws HL7Exception { 183 return (IS) super.insertRepetition(2, rep); 184 } 185 186 187 /** 188 * Removes a repetition of 189 * GP1-2: "Revenue Code" at a specific index 190 * 191 * @param rep The repetition index (0-indexed) 192 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 193 */ 194 public IS removeRevenueCode(int rep) throws HL7Exception { 195 return (IS) super.removeRepetition(2, rep); 196 } 197 198 199 /** 200 * Removes a repetition of 201 * GP1-2: "Revenue Code" at a specific index 202 * 203 * @param rep The repetition index (0-indexed) 204 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 205 */ 206 public IS removeGp12_RevenueCode(int rep) throws HL7Exception { 207 return (IS) super.removeRepetition(2, rep); 208 } 209 210 211 212 213 /** 214 * Returns 215 * GP1-3: "Overall Claim Disposition Code" - creates it if necessary 216 */ 217 public IS getOverallClaimDispositionCode() { 218 IS retVal = this.getTypedField(3, 0); 219 return retVal; 220 } 221 222 /** 223 * Returns 224 * GP1-3: "Overall Claim Disposition Code" - creates it if necessary 225 */ 226 public IS getGp13_OverallClaimDispositionCode() { 227 IS retVal = this.getTypedField(3, 0); 228 return retVal; 229 } 230 231 232 /** 233 * Returns all repetitions of OCE Edits per Visit Code (GP1-4). 234 */ 235 public IS[] getOCEEditsPerVisitCode() { 236 IS[] retVal = this.getTypedField(4, new IS[0]); 237 return retVal; 238 } 239 240 241 /** 242 * Returns all repetitions of OCE Edits per Visit Code (GP1-4). 243 */ 244 public IS[] getGp14_OCEEditsPerVisitCode() { 245 IS[] retVal = this.getTypedField(4, new IS[0]); 246 return retVal; 247 } 248 249 250 /** 251 * Returns a count of the current number of repetitions of OCE Edits per Visit Code (GP1-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 getOCEEditsPerVisitCodeReps() { 256 return this.getReps(4); 257 } 258 259 260 /** 261 * Returns a specific repetition of 262 * GP1-4: "OCE Edits per Visit Code" - creates it if necessary 263 * 264 * @param rep The repetition index (0-indexed) 265 */ 266 public IS getOCEEditsPerVisitCode(int rep) { 267 IS retVal = this.getTypedField(4, rep); 268 return retVal; 269 } 270 271 /** 272 * Returns a specific repetition of 273 * GP1-4: "OCE Edits per Visit Code" - creates it if necessary 274 * 275 * @param rep The repetition index (0-indexed) 276 */ 277 public IS getGp14_OCEEditsPerVisitCode(int rep) { 278 IS retVal = this.getTypedField(4, rep); 279 return retVal; 280 } 281 282 /** 283 * Returns a count of the current number of repetitions of OCE Edits per Visit Code (GP1-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 getGp14_OCEEditsPerVisitCodeReps() { 288 return this.getReps(4); 289 } 290 291 292 /** 293 * Inserts a repetition of 294 * GP1-4: "OCE Edits per Visit Code" 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 IS insertOCEEditsPerVisitCode(int rep) throws HL7Exception { 300 return (IS) super.insertRepetition(4, rep); 301 } 302 303 304 /** 305 * Inserts a repetition of 306 * GP1-4: "OCE Edits per Visit Code" 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 IS insertGp14_OCEEditsPerVisitCode(int rep) throws HL7Exception { 312 return (IS) super.insertRepetition(4, rep); 313 } 314 315 316 /** 317 * Removes a repetition of 318 * GP1-4: "OCE Edits per Visit Code" 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 IS removeOCEEditsPerVisitCode(int rep) throws HL7Exception { 324 return (IS) super.removeRepetition(4, rep); 325 } 326 327 328 /** 329 * Removes a repetition of 330 * GP1-4: "OCE Edits per Visit Code" 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 IS removeGp14_OCEEditsPerVisitCode(int rep) throws HL7Exception { 336 return (IS) super.removeRepetition(4, rep); 337 } 338 339 340 341 342 /** 343 * Returns 344 * GP1-5: "Outlier Cost" - creates it if necessary 345 */ 346 public CP getOutlierCost() { 347 CP retVal = this.getTypedField(5, 0); 348 return retVal; 349 } 350 351 /** 352 * Returns 353 * GP1-5: "Outlier Cost" - creates it if necessary 354 */ 355 public CP getGp15_OutlierCost() { 356 CP retVal = this.getTypedField(5, 0); 357 return retVal; 358 } 359 360 361 362 363 364 /** {@inheritDoc} */ 365 protected Type createNewTypeWithoutReflection(int field) { 366 switch (field) { 367 case 0: return new IS(getMessage(), new Integer( 455 )); 368 case 1: return new IS(getMessage(), new Integer( 456 )); 369 case 2: return new IS(getMessage(), new Integer( 457 )); 370 case 3: return new IS(getMessage(), new Integer( 458 )); 371 case 4: return new CP(getMessage()); 372 default: return null; 373 } 374 } 375 376 377 } 378