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 MFE message segment (Master File Entry). 50 * This segment has the following fields:</p> 51 * <ul> 52 * <li>MFE-1: Record-Level Event Code (ID) <b> </b> 53 * <li>MFE-2: MFN Control ID (ST) <b>optional </b> 54 * <li>MFE-3: Effective Date/Time (TS) <b>optional </b> 55 * <li>MFE-4: Primary Key Value - MFE (Varies) <b> repeating</b> 56 * <li>MFE-5: Primary Key Value Type (ID) <b> repeating</b> 57 * </ul> 58 */ 59 @SuppressWarnings("unused") 60 public class MFE extends AbstractSegment { 61 62 /** 63 * Creates a new MFE segment 64 */ 65 public MFE(Group parent, ModelClassFactory factory) { 66 super(parent, factory); 67 init(factory); 68 } 69 70 private void init(ModelClassFactory factory) { 71 try { 72 this.add(ID.class, true, 1, 3, new Object[]{ getMessage(), new Integer(180) }, "Record-Level Event Code"); 73 this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "MFN Control ID"); 74 this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Effective Date/Time"); 75 this.add(Varies.class, true, 0, 200, new Object[]{ getMessage() }, "Primary Key Value - MFE"); 76 this.add(ID.class, true, 0, 3, new Object[]{ getMessage(), new Integer(355) }, "Primary Key Value Type"); 77 } catch(HL7Exception e) { 78 log.error("Unexpected error creating MFE - this is probably a bug in the source code generator.", e); 79 } 80 } 81 82 83 84 /** 85 * Returns 86 * MFE-1: "Record-Level Event Code" - creates it if necessary 87 */ 88 public ID getRecordLevelEventCode() { 89 ID retVal = this.getTypedField(1, 0); 90 return retVal; 91 } 92 93 /** 94 * Returns 95 * MFE-1: "Record-Level Event Code" - creates it if necessary 96 */ 97 public ID getMfe1_RecordLevelEventCode() { 98 ID retVal = this.getTypedField(1, 0); 99 return retVal; 100 } 101 102 103 104 /** 105 * Returns 106 * MFE-2: "MFN Control ID" - creates it if necessary 107 */ 108 public ST getMFNControlID() { 109 ST retVal = this.getTypedField(2, 0); 110 return retVal; 111 } 112 113 /** 114 * Returns 115 * MFE-2: "MFN Control ID" - creates it if necessary 116 */ 117 public ST getMfe2_MFNControlID() { 118 ST retVal = this.getTypedField(2, 0); 119 return retVal; 120 } 121 122 123 124 /** 125 * Returns 126 * MFE-3: "Effective Date/Time" - creates it if necessary 127 */ 128 public TS getEffectiveDateTime() { 129 TS retVal = this.getTypedField(3, 0); 130 return retVal; 131 } 132 133 /** 134 * Returns 135 * MFE-3: "Effective Date/Time" - creates it if necessary 136 */ 137 public TS getMfe3_EffectiveDateTime() { 138 TS retVal = this.getTypedField(3, 0); 139 return retVal; 140 } 141 142 143 /** 144 * Returns all repetitions of Primary Key Value - MFE (MFE-4). 145 */ 146 public Varies[] getPrimaryKeyValueMFE() { 147 Varies[] retVal = this.getTypedField(4, new Varies[0]); 148 return retVal; 149 } 150 151 152 /** 153 * Returns all repetitions of Primary Key Value - MFE (MFE-4). 154 */ 155 public Varies[] getMfe4_PrimaryKeyValueMFE() { 156 Varies[] retVal = this.getTypedField(4, new Varies[0]); 157 return retVal; 158 } 159 160 161 /** 162 * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4). 163 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 164 * it will return zero. 165 */ 166 public int getPrimaryKeyValueMFEReps() { 167 return this.getReps(4); 168 } 169 170 171 /** 172 * Returns a specific repetition of 173 * MFE-4: "Primary Key Value - MFE" - creates it if necessary 174 * 175 * @param rep The repetition index (0-indexed) 176 */ 177 public Varies getPrimaryKeyValueMFE(int rep) { 178 Varies retVal = this.getTypedField(4, rep); 179 return retVal; 180 } 181 182 /** 183 * Returns a specific repetition of 184 * MFE-4: "Primary Key Value - MFE" - creates it if necessary 185 * 186 * @param rep The repetition index (0-indexed) 187 */ 188 public Varies getMfe4_PrimaryKeyValueMFE(int rep) { 189 Varies retVal = this.getTypedField(4, rep); 190 return retVal; 191 } 192 193 /** 194 * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4). 195 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 196 * it will return zero. 197 */ 198 public int getMfe4_PrimaryKeyValueMFEReps() { 199 return this.getReps(4); 200 } 201 202 203 /** 204 * Inserts a repetition of 205 * MFE-4: "Primary Key Value - MFE" at a specific index 206 * 207 * @param rep The repetition index (0-indexed) 208 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 209 */ 210 public Varies insertPrimaryKeyValueMFE(int rep) throws HL7Exception { 211 return (Varies) super.insertRepetition(4, rep); 212 } 213 214 215 /** 216 * Inserts a repetition of 217 * MFE-4: "Primary Key Value - MFE" at a specific index 218 * 219 * @param rep The repetition index (0-indexed) 220 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 221 */ 222 public Varies insertMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 223 return (Varies) super.insertRepetition(4, rep); 224 } 225 226 227 /** 228 * Removes a repetition of 229 * MFE-4: "Primary Key Value - MFE" at a specific index 230 * 231 * @param rep The repetition index (0-indexed) 232 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 233 */ 234 public Varies removePrimaryKeyValueMFE(int rep) throws HL7Exception { 235 return (Varies) super.removeRepetition(4, rep); 236 } 237 238 239 /** 240 * Removes a repetition of 241 * MFE-4: "Primary Key Value - MFE" at a specific index 242 * 243 * @param rep The repetition index (0-indexed) 244 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 245 */ 246 public Varies removeMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 247 return (Varies) super.removeRepetition(4, rep); 248 } 249 250 251 252 /** 253 * Returns all repetitions of Primary Key Value Type (MFE-5). 254 */ 255 public ID[] getPrimaryKeyValueType() { 256 ID[] retVal = this.getTypedField(5, new ID[0]); 257 return retVal; 258 } 259 260 261 /** 262 * Returns all repetitions of Primary Key Value Type (MFE-5). 263 */ 264 public ID[] getMfe5_PrimaryKeyValueType() { 265 ID[] retVal = this.getTypedField(5, new ID[0]); 266 return retVal; 267 } 268 269 270 /** 271 * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5). 272 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 273 * it will return zero. 274 */ 275 public int getPrimaryKeyValueTypeReps() { 276 return this.getReps(5); 277 } 278 279 280 /** 281 * Returns a specific repetition of 282 * MFE-5: "Primary Key Value Type" - creates it if necessary 283 * 284 * @param rep The repetition index (0-indexed) 285 */ 286 public ID getPrimaryKeyValueType(int rep) { 287 ID retVal = this.getTypedField(5, rep); 288 return retVal; 289 } 290 291 /** 292 * Returns a specific repetition of 293 * MFE-5: "Primary Key Value Type" - creates it if necessary 294 * 295 * @param rep The repetition index (0-indexed) 296 */ 297 public ID getMfe5_PrimaryKeyValueType(int rep) { 298 ID retVal = this.getTypedField(5, rep); 299 return retVal; 300 } 301 302 /** 303 * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5). 304 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 305 * it will return zero. 306 */ 307 public int getMfe5_PrimaryKeyValueTypeReps() { 308 return this.getReps(5); 309 } 310 311 312 /** 313 * Inserts a repetition of 314 * MFE-5: "Primary Key Value Type" at a specific index 315 * 316 * @param rep The repetition index (0-indexed) 317 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 318 */ 319 public ID insertPrimaryKeyValueType(int rep) throws HL7Exception { 320 return (ID) super.insertRepetition(5, rep); 321 } 322 323 324 /** 325 * Inserts a repetition of 326 * MFE-5: "Primary Key Value Type" at a specific index 327 * 328 * @param rep The repetition index (0-indexed) 329 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 330 */ 331 public ID insertMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 332 return (ID) super.insertRepetition(5, rep); 333 } 334 335 336 /** 337 * Removes a repetition of 338 * MFE-5: "Primary Key Value Type" at a specific index 339 * 340 * @param rep The repetition index (0-indexed) 341 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 342 */ 343 public ID removePrimaryKeyValueType(int rep) throws HL7Exception { 344 return (ID) super.removeRepetition(5, rep); 345 } 346 347 348 /** 349 * Removes a repetition of 350 * MFE-5: "Primary Key Value Type" at a specific index 351 * 352 * @param rep The repetition index (0-indexed) 353 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 354 */ 355 public ID removeMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 356 return (ID) super.removeRepetition(5, rep); 357 } 358 359 360 361 362 363 364 /** {@inheritDoc} */ 365 protected Type createNewTypeWithoutReflection(int field) { 366 switch (field) { 367 case 0: return new ID(getMessage(), new Integer( 180 )); 368 case 1: return new ST(getMessage()); 369 case 2: return new TS(getMessage()); 370 case 3: return new Varies(getMessage()); 371 case 4: return new ID(getMessage(), new Integer( 355 )); 372 default: return null; 373 } 374 } 375 376 377 } 378