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.v231.segment; 035 036// import ca.uhn.hl7v2.model.v231.group.*; 037import ca.uhn.hl7v2.model.v231.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/** 049 *<p>Represents an HL7 AIP message segment (AIP - appointment information - personnel resource segment). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>AIP-1: Set ID - AIP (SI) <b> </b> 053 * <li>AIP-2: Segment Action Code (ID) <b>optional </b> 054 * <li>AIP-3: Personnel Resource ID (XCN) <b>optional repeating</b> 055 * <li>AIP-4: Resource Role (CE) <b> </b> 056 * <li>AIP-5: Resource Group (CE) <b>optional </b> 057 * <li>AIP-6: Start Date/Time (TS) <b>optional </b> 058 * <li>AIP-7: Start Date/Time Offset (NM) <b>optional </b> 059 * <li>AIP-8: Start Date/Time Offset Units (CE) <b>optional </b> 060 * <li>AIP-9: Duration (NM) <b>optional </b> 061 * <li>AIP-10: Duration Units (CE) <b>optional </b> 062 * <li>AIP-11: Allow Substitution Code (IS) <b>optional </b> 063 * <li>AIP-12: Filler Status Code (CE) <b>optional </b> 064 * </ul> 065 */ 066@SuppressWarnings("unused") 067public class AIP extends AbstractSegment { 068 069 /** 070 * Creates a new AIP segment 071 */ 072 public AIP(Group parent, ModelClassFactory factory) { 073 super(parent, factory); 074 init(factory); 075 } 076 077 private void init(ModelClassFactory factory) { 078 try { 079 this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - AIP"); 080 this.add(ID.class, false, 1, 3, new Object[]{ getMessage(), new Integer(206) }, "Segment Action Code"); 081 this.add(XCN.class, false, 0, 80, new Object[]{ getMessage() }, "Personnel Resource ID"); 082 this.add(CE.class, true, 1, 200, new Object[]{ getMessage() }, "Resource Role"); 083 this.add(CE.class, false, 1, 200, new Object[]{ getMessage() }, "Resource Group"); 084 this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Start Date/Time"); 085 this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Start Date/Time Offset"); 086 this.add(CE.class, false, 1, 200, new Object[]{ getMessage() }, "Start Date/Time Offset Units"); 087 this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Duration"); 088 this.add(CE.class, false, 1, 200, new Object[]{ getMessage() }, "Duration Units"); 089 this.add(IS.class, false, 1, 10, new Object[]{ getMessage(), new Integer(279) }, "Allow Substitution Code"); 090 this.add(CE.class, false, 1, 200, new Object[]{ getMessage() }, "Filler Status Code"); 091 } catch(HL7Exception e) { 092 log.error("Unexpected error creating AIP - this is probably a bug in the source code generator.", e); 093 } 094 } 095 096 097 098 /** 099 * Returns 100 * AIP-1: "Set ID - AIP" - creates it if necessary 101 */ 102 public SI getSetIDAIP() { 103 SI retVal = this.getTypedField(1, 0); 104 return retVal; 105 } 106 107 /** 108 * Returns 109 * AIP-1: "Set ID - AIP" - creates it if necessary 110 */ 111 public SI getAip1_SetIDAIP() { 112 SI retVal = this.getTypedField(1, 0); 113 return retVal; 114 } 115 116 117 118 /** 119 * Returns 120 * AIP-2: "Segment Action Code" - creates it if necessary 121 */ 122 public ID getSegmentActionCode() { 123 ID retVal = this.getTypedField(2, 0); 124 return retVal; 125 } 126 127 /** 128 * Returns 129 * AIP-2: "Segment Action Code" - creates it if necessary 130 */ 131 public ID getAip2_SegmentActionCode() { 132 ID retVal = this.getTypedField(2, 0); 133 return retVal; 134 } 135 136 137 /** 138 * Returns all repetitions of Personnel Resource ID (AIP-3). 139 */ 140 public XCN[] getPersonnelResourceID() { 141 XCN[] retVal = this.getTypedField(3, new XCN[0]); 142 return retVal; 143 } 144 145 146 /** 147 * Returns all repetitions of Personnel Resource ID (AIP-3). 148 */ 149 public XCN[] getAip3_PersonnelResourceID() { 150 XCN[] retVal = this.getTypedField(3, new XCN[0]); 151 return retVal; 152 } 153 154 155 /** 156 * Returns a count of the current number of repetitions of Personnel Resource ID (AIP-3). 157 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 158 * it will return zero. 159 */ 160 public int getPersonnelResourceIDReps() { 161 return this.getReps(3); 162 } 163 164 165 /** 166 * Returns a specific repetition of 167 * AIP-3: "Personnel Resource ID" - creates it if necessary 168 * 169 * @param rep The repetition index (0-indexed) 170 */ 171 public XCN getPersonnelResourceID(int rep) { 172 XCN retVal = this.getTypedField(3, rep); 173 return retVal; 174 } 175 176 /** 177 * Returns a specific repetition of 178 * AIP-3: "Personnel Resource ID" - creates it if necessary 179 * 180 * @param rep The repetition index (0-indexed) 181 */ 182 public XCN getAip3_PersonnelResourceID(int rep) { 183 XCN retVal = this.getTypedField(3, rep); 184 return retVal; 185 } 186 187 /** 188 * Returns a count of the current number of repetitions of Personnel Resource ID (AIP-3). 189 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 190 * it will return zero. 191 */ 192 public int getAip3_PersonnelResourceIDReps() { 193 return this.getReps(3); 194 } 195 196 197 /** 198 * Inserts a repetition of 199 * AIP-3: "Personnel Resource ID" at a specific index 200 * 201 * @param rep The repetition index (0-indexed) 202 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 203 */ 204 public XCN insertPersonnelResourceID(int rep) throws HL7Exception { 205 return (XCN) super.insertRepetition(3, rep); 206 } 207 208 209 /** 210 * Inserts a repetition of 211 * AIP-3: "Personnel Resource ID" at a specific index 212 * 213 * @param rep The repetition index (0-indexed) 214 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 215 */ 216 public XCN insertAip3_PersonnelResourceID(int rep) throws HL7Exception { 217 return (XCN) super.insertRepetition(3, rep); 218 } 219 220 221 /** 222 * Removes a repetition of 223 * AIP-3: "Personnel Resource ID" at a specific index 224 * 225 * @param rep The repetition index (0-indexed) 226 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 227 */ 228 public XCN removePersonnelResourceID(int rep) throws HL7Exception { 229 return (XCN) super.removeRepetition(3, rep); 230 } 231 232 233 /** 234 * Removes a repetition of 235 * AIP-3: "Personnel Resource ID" at a specific index 236 * 237 * @param rep The repetition index (0-indexed) 238 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 239 */ 240 public XCN removeAip3_PersonnelResourceID(int rep) throws HL7Exception { 241 return (XCN) super.removeRepetition(3, rep); 242 } 243 244 245 246 247 /** 248 * Returns 249 * AIP-4: "Resource Role" - creates it if necessary 250 */ 251 public CE getResourceRole() { 252 CE retVal = this.getTypedField(4, 0); 253 return retVal; 254 } 255 256 /** 257 * Returns 258 * AIP-4: "Resource Role" - creates it if necessary 259 */ 260 public CE getAip4_ResourceRole() { 261 CE retVal = this.getTypedField(4, 0); 262 return retVal; 263 } 264 265 266 267 /** 268 * Returns 269 * AIP-5: "Resource Group" - creates it if necessary 270 */ 271 public CE getResourceGroup() { 272 CE retVal = this.getTypedField(5, 0); 273 return retVal; 274 } 275 276 /** 277 * Returns 278 * AIP-5: "Resource Group" - creates it if necessary 279 */ 280 public CE getAip5_ResourceGroup() { 281 CE retVal = this.getTypedField(5, 0); 282 return retVal; 283 } 284 285 286 287 /** 288 * Returns 289 * AIP-6: "Start Date/Time" - creates it if necessary 290 */ 291 public TS getStartDateTime() { 292 TS retVal = this.getTypedField(6, 0); 293 return retVal; 294 } 295 296 /** 297 * Returns 298 * AIP-6: "Start Date/Time" - creates it if necessary 299 */ 300 public TS getAip6_StartDateTime() { 301 TS retVal = this.getTypedField(6, 0); 302 return retVal; 303 } 304 305 306 307 /** 308 * Returns 309 * AIP-7: "Start Date/Time Offset" - creates it if necessary 310 */ 311 public NM getStartDateTimeOffset() { 312 NM retVal = this.getTypedField(7, 0); 313 return retVal; 314 } 315 316 /** 317 * Returns 318 * AIP-7: "Start Date/Time Offset" - creates it if necessary 319 */ 320 public NM getAip7_StartDateTimeOffset() { 321 NM retVal = this.getTypedField(7, 0); 322 return retVal; 323 } 324 325 326 327 /** 328 * Returns 329 * AIP-8: "Start Date/Time Offset Units" - creates it if necessary 330 */ 331 public CE getStartDateTimeOffsetUnits() { 332 CE retVal = this.getTypedField(8, 0); 333 return retVal; 334 } 335 336 /** 337 * Returns 338 * AIP-8: "Start Date/Time Offset Units" - creates it if necessary 339 */ 340 public CE getAip8_StartDateTimeOffsetUnits() { 341 CE retVal = this.getTypedField(8, 0); 342 return retVal; 343 } 344 345 346 347 /** 348 * Returns 349 * AIP-9: "Duration" - creates it if necessary 350 */ 351 public NM getDuration() { 352 NM retVal = this.getTypedField(9, 0); 353 return retVal; 354 } 355 356 /** 357 * Returns 358 * AIP-9: "Duration" - creates it if necessary 359 */ 360 public NM getAip9_Duration() { 361 NM retVal = this.getTypedField(9, 0); 362 return retVal; 363 } 364 365 366 367 /** 368 * Returns 369 * AIP-10: "Duration Units" - creates it if necessary 370 */ 371 public CE getDurationUnits() { 372 CE retVal = this.getTypedField(10, 0); 373 return retVal; 374 } 375 376 /** 377 * Returns 378 * AIP-10: "Duration Units" - creates it if necessary 379 */ 380 public CE getAip10_DurationUnits() { 381 CE retVal = this.getTypedField(10, 0); 382 return retVal; 383 } 384 385 386 387 /** 388 * Returns 389 * AIP-11: "Allow Substitution Code" - creates it if necessary 390 */ 391 public IS getAllowSubstitutionCode() { 392 IS retVal = this.getTypedField(11, 0); 393 return retVal; 394 } 395 396 /** 397 * Returns 398 * AIP-11: "Allow Substitution Code" - creates it if necessary 399 */ 400 public IS getAip11_AllowSubstitutionCode() { 401 IS retVal = this.getTypedField(11, 0); 402 return retVal; 403 } 404 405 406 407 /** 408 * Returns 409 * AIP-12: "Filler Status Code" - creates it if necessary 410 */ 411 public CE getFillerStatusCode() { 412 CE retVal = this.getTypedField(12, 0); 413 return retVal; 414 } 415 416 /** 417 * Returns 418 * AIP-12: "Filler Status Code" - creates it if necessary 419 */ 420 public CE getAip12_FillerStatusCode() { 421 CE retVal = this.getTypedField(12, 0); 422 return retVal; 423 } 424 425 426 427 428 429 /** {@inheritDoc} */ 430 protected Type createNewTypeWithoutReflection(int field) { 431 switch (field) { 432 case 0: return new SI(getMessage()); 433 case 1: return new ID(getMessage(), new Integer( 206 )); 434 case 2: return new XCN(getMessage()); 435 case 3: return new CE(getMessage()); 436 case 4: return new CE(getMessage()); 437 case 5: return new TS(getMessage()); 438 case 6: return new NM(getMessage()); 439 case 7: return new CE(getMessage()); 440 case 8: return new NM(getMessage()); 441 case 9: return new CE(getMessage()); 442 case 10: return new IS(getMessage(), new Integer( 279 )); 443 case 11: return new CE(getMessage()); 444 default: return null; 445 } 446 } 447 448 449} 450