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.segment; 035 036// import ca.uhn.hl7v2.model.v26.group.*; 037import ca.uhn.hl7v2.model.v26.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 *<p>Represents an HL7 MFE message segment (Master File Entry). 049 * This segment has the following fields:</p> 050 * <ul> 051 * <li>MFE-1: Record-Level Event Code (ID) <b> </b> 052 * <li>MFE-2: MFN Control ID (ST) <b>optional </b> 053 * <li>MFE-3: Effective Date/Time (DTM) <b>optional </b> 054 * <li>MFE-4: Primary Key Value - MFE (Varies) <b> repeating</b> 055 * <li>MFE-5: Primary Key Value Type (ID) <b> repeating</b> 056 * <li>MFE-6: Entered Date/Time (DTM) <b>optional </b> 057 * <li>MFE-7: Entered By (XCN) <b>optional </b> 058 * </ul> 059 */ 060@SuppressWarnings("unused") 061public class MFE extends AbstractSegment { 062 063 /** 064 * Creates a new MFE segment 065 */ 066 public MFE(Group parent, ModelClassFactory factory) { 067 super(parent, factory); 068 init(factory); 069 } 070 071 private void init(ModelClassFactory factory) { 072 try { 073 this.add(ID.class, true, 1, 3, new Object[]{ getMessage(), new Integer(180) }, "Record-Level Event Code"); 074 this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "MFN Control ID"); 075 this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Effective Date/Time"); 076 this.add(Varies.class, true, 0, 200, new Object[]{ getMessage() }, "Primary Key Value - MFE"); 077 this.add(ID.class, true, 0, 3, new Object[]{ getMessage(), new Integer(355) }, "Primary Key Value Type"); 078 this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Entered Date/Time"); 079 this.add(XCN.class, false, 1, 3220, new Object[]{ getMessage() }, "Entered By"); 080 } catch(HL7Exception e) { 081 log.error("Unexpected error creating MFE - this is probably a bug in the source code generator.", e); 082 } 083 } 084 085 086 087 /** 088 * Returns 089 * MFE-1: "Record-Level Event Code" - creates it if necessary 090 */ 091 public ID getRecordLevelEventCode() { 092 ID retVal = this.getTypedField(1, 0); 093 return retVal; 094 } 095 096 /** 097 * Returns 098 * MFE-1: "Record-Level Event Code" - creates it if necessary 099 */ 100 public ID getMfe1_RecordLevelEventCode() { 101 ID retVal = this.getTypedField(1, 0); 102 return retVal; 103 } 104 105 106 107 /** 108 * Returns 109 * MFE-2: "MFN Control ID" - creates it if necessary 110 */ 111 public ST getMFNControlID() { 112 ST retVal = this.getTypedField(2, 0); 113 return retVal; 114 } 115 116 /** 117 * Returns 118 * MFE-2: "MFN Control ID" - creates it if necessary 119 */ 120 public ST getMfe2_MFNControlID() { 121 ST retVal = this.getTypedField(2, 0); 122 return retVal; 123 } 124 125 126 127 /** 128 * Returns 129 * MFE-3: "Effective Date/Time" - creates it if necessary 130 */ 131 public DTM getEffectiveDateTime() { 132 DTM retVal = this.getTypedField(3, 0); 133 return retVal; 134 } 135 136 /** 137 * Returns 138 * MFE-3: "Effective Date/Time" - creates it if necessary 139 */ 140 public DTM getMfe3_EffectiveDateTime() { 141 DTM retVal = this.getTypedField(3, 0); 142 return retVal; 143 } 144 145 146 /** 147 * Returns all repetitions of Primary Key Value - MFE (MFE-4). 148 */ 149 public Varies[] getPrimaryKeyValueMFE() { 150 Varies[] retVal = this.getTypedField(4, new Varies[0]); 151 return retVal; 152 } 153 154 155 /** 156 * Returns all repetitions of Primary Key Value - MFE (MFE-4). 157 */ 158 public Varies[] getMfe4_PrimaryKeyValueMFE() { 159 Varies[] retVal = this.getTypedField(4, new Varies[0]); 160 return retVal; 161 } 162 163 164 /** 165 * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4). 166 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 167 * it will return zero. 168 */ 169 public int getPrimaryKeyValueMFEReps() { 170 return this.getReps(4); 171 } 172 173 174 /** 175 * Returns a specific repetition of 176 * MFE-4: "Primary Key Value - MFE" - creates it if necessary 177 * 178 * @param rep The repetition index (0-indexed) 179 */ 180 public Varies getPrimaryKeyValueMFE(int rep) { 181 Varies retVal = this.getTypedField(4, rep); 182 return retVal; 183 } 184 185 /** 186 * Returns a specific repetition of 187 * MFE-4: "Primary Key Value - MFE" - creates it if necessary 188 * 189 * @param rep The repetition index (0-indexed) 190 */ 191 public Varies getMfe4_PrimaryKeyValueMFE(int rep) { 192 Varies retVal = this.getTypedField(4, rep); 193 return retVal; 194 } 195 196 /** 197 * Returns a count of the current number of repetitions of Primary Key Value - MFE (MFE-4). 198 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 199 * it will return zero. 200 */ 201 public int getMfe4_PrimaryKeyValueMFEReps() { 202 return this.getReps(4); 203 } 204 205 206 /** 207 * Inserts a repetition of 208 * MFE-4: "Primary Key Value - MFE" at a specific index 209 * 210 * @param rep The repetition index (0-indexed) 211 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 212 */ 213 public Varies insertPrimaryKeyValueMFE(int rep) throws HL7Exception { 214 return (Varies) super.insertRepetition(4, rep); 215 } 216 217 218 /** 219 * Inserts a repetition of 220 * MFE-4: "Primary Key Value - MFE" at a specific index 221 * 222 * @param rep The repetition index (0-indexed) 223 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 224 */ 225 public Varies insertMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 226 return (Varies) super.insertRepetition(4, rep); 227 } 228 229 230 /** 231 * Removes a repetition of 232 * MFE-4: "Primary Key Value - MFE" at a specific index 233 * 234 * @param rep The repetition index (0-indexed) 235 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 236 */ 237 public Varies removePrimaryKeyValueMFE(int rep) throws HL7Exception { 238 return (Varies) super.removeRepetition(4, rep); 239 } 240 241 242 /** 243 * Removes a repetition of 244 * MFE-4: "Primary Key Value - MFE" at a specific index 245 * 246 * @param rep The repetition index (0-indexed) 247 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 248 */ 249 public Varies removeMfe4_PrimaryKeyValueMFE(int rep) throws HL7Exception { 250 return (Varies) super.removeRepetition(4, rep); 251 } 252 253 254 255 /** 256 * Returns all repetitions of Primary Key Value Type (MFE-5). 257 */ 258 public ID[] getPrimaryKeyValueType() { 259 ID[] retVal = this.getTypedField(5, new ID[0]); 260 return retVal; 261 } 262 263 264 /** 265 * Returns all repetitions of Primary Key Value Type (MFE-5). 266 */ 267 public ID[] getMfe5_PrimaryKeyValueType() { 268 ID[] retVal = this.getTypedField(5, new ID[0]); 269 return retVal; 270 } 271 272 273 /** 274 * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5). 275 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 276 * it will return zero. 277 */ 278 public int getPrimaryKeyValueTypeReps() { 279 return this.getReps(5); 280 } 281 282 283 /** 284 * Returns a specific repetition of 285 * MFE-5: "Primary Key Value Type" - creates it if necessary 286 * 287 * @param rep The repetition index (0-indexed) 288 */ 289 public ID getPrimaryKeyValueType(int rep) { 290 ID retVal = this.getTypedField(5, rep); 291 return retVal; 292 } 293 294 /** 295 * Returns a specific repetition of 296 * MFE-5: "Primary Key Value Type" - creates it if necessary 297 * 298 * @param rep The repetition index (0-indexed) 299 */ 300 public ID getMfe5_PrimaryKeyValueType(int rep) { 301 ID retVal = this.getTypedField(5, rep); 302 return retVal; 303 } 304 305 /** 306 * Returns a count of the current number of repetitions of Primary Key Value Type (MFE-5). 307 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 308 * it will return zero. 309 */ 310 public int getMfe5_PrimaryKeyValueTypeReps() { 311 return this.getReps(5); 312 } 313 314 315 /** 316 * Inserts a repetition of 317 * MFE-5: "Primary Key Value Type" at a specific index 318 * 319 * @param rep The repetition index (0-indexed) 320 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 321 */ 322 public ID insertPrimaryKeyValueType(int rep) throws HL7Exception { 323 return (ID) super.insertRepetition(5, rep); 324 } 325 326 327 /** 328 * Inserts a repetition of 329 * MFE-5: "Primary Key Value Type" at a specific index 330 * 331 * @param rep The repetition index (0-indexed) 332 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 333 */ 334 public ID insertMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 335 return (ID) super.insertRepetition(5, rep); 336 } 337 338 339 /** 340 * Removes a repetition of 341 * MFE-5: "Primary Key Value Type" at a specific index 342 * 343 * @param rep The repetition index (0-indexed) 344 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 345 */ 346 public ID removePrimaryKeyValueType(int rep) throws HL7Exception { 347 return (ID) super.removeRepetition(5, rep); 348 } 349 350 351 /** 352 * Removes a repetition of 353 * MFE-5: "Primary Key Value Type" at a specific index 354 * 355 * @param rep The repetition index (0-indexed) 356 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 357 */ 358 public ID removeMfe5_PrimaryKeyValueType(int rep) throws HL7Exception { 359 return (ID) super.removeRepetition(5, rep); 360 } 361 362 363 364 365 /** 366 * Returns 367 * MFE-6: "Entered Date/Time" - creates it if necessary 368 */ 369 public DTM getEnteredDateTime() { 370 DTM retVal = this.getTypedField(6, 0); 371 return retVal; 372 } 373 374 /** 375 * Returns 376 * MFE-6: "Entered Date/Time" - creates it if necessary 377 */ 378 public DTM getMfe6_EnteredDateTime() { 379 DTM retVal = this.getTypedField(6, 0); 380 return retVal; 381 } 382 383 384 385 /** 386 * Returns 387 * MFE-7: "Entered By" - creates it if necessary 388 */ 389 public XCN getEnteredBy() { 390 XCN retVal = this.getTypedField(7, 0); 391 return retVal; 392 } 393 394 /** 395 * Returns 396 * MFE-7: "Entered By" - creates it if necessary 397 */ 398 public XCN getMfe7_EnteredBy() { 399 XCN retVal = this.getTypedField(7, 0); 400 return retVal; 401 } 402 403 404 405 406 407 /** {@inheritDoc} */ 408 protected Type createNewTypeWithoutReflection(int field) { 409 switch (field) { 410 case 0: return new ID(getMessage(), new Integer( 180 )); 411 case 1: return new ST(getMessage()); 412 case 2: return new DTM(getMessage()); 413 case 3: return new Varies(getMessage()); 414 case 4: return new ID(getMessage(), new Integer( 355 )); 415 case 5: return new DTM(getMessage()); 416 case 6: return new XCN(getMessage()); 417 default: return null; 418 } 419 } 420 421 422} 423