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 MFI message segment (Master File Identification). 049 * This segment has the following fields:</p> 050 * <ul> 051 * <li>MFI-1: Master File Identifier (CWE) <b> </b> 052 * <li>MFI-2: Master File Application Identifier (HD) <b>optional repeating</b> 053 * <li>MFI-3: File-Level Event Code (ID) <b> </b> 054 * <li>MFI-4: Entered Date/Time (DTM) <b>optional </b> 055 * <li>MFI-5: Effective Date/Time (DTM) <b>optional </b> 056 * <li>MFI-6: Response Level Code (ID) <b> </b> 057 * </ul> 058 */ 059@SuppressWarnings("unused") 060public class MFI extends AbstractSegment { 061 062 /** 063 * Creates a new MFI segment 064 */ 065 public MFI(Group parent, ModelClassFactory factory) { 066 super(parent, factory); 067 init(factory); 068 } 069 070 private void init(ModelClassFactory factory) { 071 try { 072 this.add(CWE.class, true, 1, 250, new Object[]{ getMessage() }, "Master File Identifier"); 073 this.add(HD.class, false, 0, 180, new Object[]{ getMessage() }, "Master File Application Identifier"); 074 this.add(ID.class, true, 1, 3, new Object[]{ getMessage(), new Integer(178) }, "File-Level Event Code"); 075 this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Entered Date/Time"); 076 this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Effective Date/Time"); 077 this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(179) }, "Response Level Code"); 078 } catch(HL7Exception e) { 079 log.error("Unexpected error creating MFI - this is probably a bug in the source code generator.", e); 080 } 081 } 082 083 084 085 /** 086 * Returns 087 * MFI-1: "Master File Identifier" - creates it if necessary 088 */ 089 public CWE getMasterFileIdentifier() { 090 CWE retVal = this.getTypedField(1, 0); 091 return retVal; 092 } 093 094 /** 095 * Returns 096 * MFI-1: "Master File Identifier" - creates it if necessary 097 */ 098 public CWE getMfi1_MasterFileIdentifier() { 099 CWE retVal = this.getTypedField(1, 0); 100 return retVal; 101 } 102 103 104 /** 105 * Returns all repetitions of Master File Application Identifier (MFI-2). 106 */ 107 public HD[] getMasterFileApplicationIdentifier() { 108 HD[] retVal = this.getTypedField(2, new HD[0]); 109 return retVal; 110 } 111 112 113 /** 114 * Returns all repetitions of Master File Application Identifier (MFI-2). 115 */ 116 public HD[] getMfi2_MasterFileApplicationIdentifier() { 117 HD[] retVal = this.getTypedField(2, new HD[0]); 118 return retVal; 119 } 120 121 122 /** 123 * Returns a count of the current number of repetitions of Master File Application Identifier (MFI-2). 124 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 125 * it will return zero. 126 */ 127 public int getMasterFileApplicationIdentifierReps() { 128 return this.getReps(2); 129 } 130 131 132 /** 133 * Returns a specific repetition of 134 * MFI-2: "Master File Application Identifier" - creates it if necessary 135 * 136 * @param rep The repetition index (0-indexed) 137 */ 138 public HD getMasterFileApplicationIdentifier(int rep) { 139 HD retVal = this.getTypedField(2, rep); 140 return retVal; 141 } 142 143 /** 144 * Returns a specific repetition of 145 * MFI-2: "Master File Application Identifier" - creates it if necessary 146 * 147 * @param rep The repetition index (0-indexed) 148 */ 149 public HD getMfi2_MasterFileApplicationIdentifier(int rep) { 150 HD retVal = this.getTypedField(2, rep); 151 return retVal; 152 } 153 154 /** 155 * Returns a count of the current number of repetitions of Master File Application Identifier (MFI-2). 156 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 157 * it will return zero. 158 */ 159 public int getMfi2_MasterFileApplicationIdentifierReps() { 160 return this.getReps(2); 161 } 162 163 164 /** 165 * Inserts a repetition of 166 * MFI-2: "Master File Application Identifier" at a specific index 167 * 168 * @param rep The repetition index (0-indexed) 169 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 170 */ 171 public HD insertMasterFileApplicationIdentifier(int rep) throws HL7Exception { 172 return (HD) super.insertRepetition(2, rep); 173 } 174 175 176 /** 177 * Inserts a repetition of 178 * MFI-2: "Master File Application Identifier" at a specific index 179 * 180 * @param rep The repetition index (0-indexed) 181 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 182 */ 183 public HD insertMfi2_MasterFileApplicationIdentifier(int rep) throws HL7Exception { 184 return (HD) super.insertRepetition(2, rep); 185 } 186 187 188 /** 189 * Removes a repetition of 190 * MFI-2: "Master File Application Identifier" at a specific index 191 * 192 * @param rep The repetition index (0-indexed) 193 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 194 */ 195 public HD removeMasterFileApplicationIdentifier(int rep) throws HL7Exception { 196 return (HD) super.removeRepetition(2, rep); 197 } 198 199 200 /** 201 * Removes a repetition of 202 * MFI-2: "Master File Application Identifier" at a specific index 203 * 204 * @param rep The repetition index (0-indexed) 205 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 206 */ 207 public HD removeMfi2_MasterFileApplicationIdentifier(int rep) throws HL7Exception { 208 return (HD) super.removeRepetition(2, rep); 209 } 210 211 212 213 214 /** 215 * Returns 216 * MFI-3: "File-Level Event Code" - creates it if necessary 217 */ 218 public ID getFileLevelEventCode() { 219 ID retVal = this.getTypedField(3, 0); 220 return retVal; 221 } 222 223 /** 224 * Returns 225 * MFI-3: "File-Level Event Code" - creates it if necessary 226 */ 227 public ID getMfi3_FileLevelEventCode() { 228 ID retVal = this.getTypedField(3, 0); 229 return retVal; 230 } 231 232 233 234 /** 235 * Returns 236 * MFI-4: "Entered Date/Time" - creates it if necessary 237 */ 238 public DTM getEnteredDateTime() { 239 DTM retVal = this.getTypedField(4, 0); 240 return retVal; 241 } 242 243 /** 244 * Returns 245 * MFI-4: "Entered Date/Time" - creates it if necessary 246 */ 247 public DTM getMfi4_EnteredDateTime() { 248 DTM retVal = this.getTypedField(4, 0); 249 return retVal; 250 } 251 252 253 254 /** 255 * Returns 256 * MFI-5: "Effective Date/Time" - creates it if necessary 257 */ 258 public DTM getEffectiveDateTime() { 259 DTM retVal = this.getTypedField(5, 0); 260 return retVal; 261 } 262 263 /** 264 * Returns 265 * MFI-5: "Effective Date/Time" - creates it if necessary 266 */ 267 public DTM getMfi5_EffectiveDateTime() { 268 DTM retVal = this.getTypedField(5, 0); 269 return retVal; 270 } 271 272 273 274 /** 275 * Returns 276 * MFI-6: "Response Level Code" - creates it if necessary 277 */ 278 public ID getResponseLevelCode() { 279 ID retVal = this.getTypedField(6, 0); 280 return retVal; 281 } 282 283 /** 284 * Returns 285 * MFI-6: "Response Level Code" - creates it if necessary 286 */ 287 public ID getMfi6_ResponseLevelCode() { 288 ID retVal = this.getTypedField(6, 0); 289 return retVal; 290 } 291 292 293 294 295 296 /** {@inheritDoc} */ 297 protected Type createNewTypeWithoutReflection(int field) { 298 switch (field) { 299 case 0: return new CWE(getMessage()); 300 case 1: return new HD(getMessage()); 301 case 2: return new ID(getMessage(), new Integer( 178 )); 302 case 3: return new DTM(getMessage()); 303 case 4: return new DTM(getMessage()); 304 case 5: return new ID(getMessage(), new Integer( 179 )); 305 default: return null; 306 } 307 } 308 309 310} 311