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.v27.segment; 035 036// import ca.uhn.hl7v2.model.v27.group.*; 037import ca.uhn.hl7v2.model.v27.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 ORG message segment (Practitioner Organization Unit s). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>ORG-1: Set ID - ORG (SI) <b> </b> 053 * <li>ORG-2: Organization Unit Code (CWE) <b>optional </b> 054 * <li>ORG-3: Organization Unit Type Code (CWE) <b>optional </b> 055 * <li>ORG-4: Primary Org Unit Indicator (ID) <b>optional </b> 056 * <li>ORG-5: Practitioner Org Unit Identifier (CX) <b>optional </b> 057 * <li>ORG-6: Health Care Provider Type Code (CWE) <b>optional </b> 058 * <li>ORG-7: Health Care Provider Classification Code (CWE) <b>optional </b> 059 * <li>ORG-8: Health Care Provider Area of Specialization Code (CWE) <b>optional </b> 060 * <li>ORG-9: Effective Date Range (DR) <b>optional </b> 061 * <li>ORG-10: Employment Status Code (CWE) <b>optional </b> 062 * <li>ORG-11: Board Approval Indicator (ID) <b>optional </b> 063 * <li>ORG-12: Primary Care Physician Indicator (ID) <b>optional </b> 064 * <li>ORG-13: Cost Center Code (CWE) <b>optional repeating</b> 065 * </ul> 066 */ 067@SuppressWarnings("unused") 068public class ORG extends AbstractSegment { 069 070 /** 071 * Creates a new ORG segment 072 */ 073 public ORG(Group parent, ModelClassFactory factory) { 074 super(parent, factory); 075 init(factory); 076 } 077 078 private void init(ModelClassFactory factory) { 079 try { 080 this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - ORG"); 081 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Organization Unit Code"); 082 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Organization Unit Type Code"); 083 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Primary Org Unit Indicator"); 084 this.add(CX.class, false, 1, 0, new Object[]{ getMessage() }, "Practitioner Org Unit Identifier"); 085 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Health Care Provider Type Code"); 086 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Health Care Provider Classification Code"); 087 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Health Care Provider Area of Specialization Code"); 088 this.add(DR.class, false, 1, 0, new Object[]{ getMessage() }, "Effective Date Range"); 089 this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Employment Status Code"); 090 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Board Approval Indicator"); 091 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Primary Care Physician Indicator"); 092 this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "Cost Center Code"); 093 } catch(HL7Exception e) { 094 log.error("Unexpected error creating ORG - this is probably a bug in the source code generator.", e); 095 } 096 } 097 098 099 100 /** 101 * Returns 102 * ORG-1: "Set ID - ORG" - creates it if necessary 103 */ 104 public SI getSetIDORG() { 105 SI retVal = this.getTypedField(1, 0); 106 return retVal; 107 } 108 109 /** 110 * Returns 111 * ORG-1: "Set ID - ORG" - creates it if necessary 112 */ 113 public SI getOrg1_SetIDORG() { 114 SI retVal = this.getTypedField(1, 0); 115 return retVal; 116 } 117 118 119 120 /** 121 * Returns 122 * ORG-2: "Organization Unit Code" - creates it if necessary 123 */ 124 public CWE getOrganizationUnitCode() { 125 CWE retVal = this.getTypedField(2, 0); 126 return retVal; 127 } 128 129 /** 130 * Returns 131 * ORG-2: "Organization Unit Code" - creates it if necessary 132 */ 133 public CWE getOrg2_OrganizationUnitCode() { 134 CWE retVal = this.getTypedField(2, 0); 135 return retVal; 136 } 137 138 139 140 /** 141 * Returns 142 * ORG-3: "Organization Unit Type Code" - creates it if necessary 143 */ 144 public CWE getOrganizationUnitTypeCode() { 145 CWE retVal = this.getTypedField(3, 0); 146 return retVal; 147 } 148 149 /** 150 * Returns 151 * ORG-3: "Organization Unit Type Code" - creates it if necessary 152 */ 153 public CWE getOrg3_OrganizationUnitTypeCode() { 154 CWE retVal = this.getTypedField(3, 0); 155 return retVal; 156 } 157 158 159 160 /** 161 * Returns 162 * ORG-4: "Primary Org Unit Indicator" - creates it if necessary 163 */ 164 public ID getPrimaryOrgUnitIndicator() { 165 ID retVal = this.getTypedField(4, 0); 166 return retVal; 167 } 168 169 /** 170 * Returns 171 * ORG-4: "Primary Org Unit Indicator" - creates it if necessary 172 */ 173 public ID getOrg4_PrimaryOrgUnitIndicator() { 174 ID retVal = this.getTypedField(4, 0); 175 return retVal; 176 } 177 178 179 180 /** 181 * Returns 182 * ORG-5: "Practitioner Org Unit Identifier" - creates it if necessary 183 */ 184 public CX getPractitionerOrgUnitIdentifier() { 185 CX retVal = this.getTypedField(5, 0); 186 return retVal; 187 } 188 189 /** 190 * Returns 191 * ORG-5: "Practitioner Org Unit Identifier" - creates it if necessary 192 */ 193 public CX getOrg5_PractitionerOrgUnitIdentifier() { 194 CX retVal = this.getTypedField(5, 0); 195 return retVal; 196 } 197 198 199 200 /** 201 * Returns 202 * ORG-6: "Health Care Provider Type Code" - creates it if necessary 203 */ 204 public CWE getHealthCareProviderTypeCode() { 205 CWE retVal = this.getTypedField(6, 0); 206 return retVal; 207 } 208 209 /** 210 * Returns 211 * ORG-6: "Health Care Provider Type Code" - creates it if necessary 212 */ 213 public CWE getOrg6_HealthCareProviderTypeCode() { 214 CWE retVal = this.getTypedField(6, 0); 215 return retVal; 216 } 217 218 219 220 /** 221 * Returns 222 * ORG-7: "Health Care Provider Classification Code" - creates it if necessary 223 */ 224 public CWE getHealthCareProviderClassificationCode() { 225 CWE retVal = this.getTypedField(7, 0); 226 return retVal; 227 } 228 229 /** 230 * Returns 231 * ORG-7: "Health Care Provider Classification Code" - creates it if necessary 232 */ 233 public CWE getOrg7_HealthCareProviderClassificationCode() { 234 CWE retVal = this.getTypedField(7, 0); 235 return retVal; 236 } 237 238 239 240 /** 241 * Returns 242 * ORG-8: "Health Care Provider Area of Specialization Code" - creates it if necessary 243 */ 244 public CWE getHealthCareProviderAreaOfSpecializationCode() { 245 CWE retVal = this.getTypedField(8, 0); 246 return retVal; 247 } 248 249 /** 250 * Returns 251 * ORG-8: "Health Care Provider Area of Specialization Code" - creates it if necessary 252 */ 253 public CWE getOrg8_HealthCareProviderAreaOfSpecializationCode() { 254 CWE retVal = this.getTypedField(8, 0); 255 return retVal; 256 } 257 258 259 260 /** 261 * Returns 262 * ORG-9: "Effective Date Range" - creates it if necessary 263 */ 264 public DR getEffectiveDateRange() { 265 DR retVal = this.getTypedField(9, 0); 266 return retVal; 267 } 268 269 /** 270 * Returns 271 * ORG-9: "Effective Date Range" - creates it if necessary 272 */ 273 public DR getOrg9_EffectiveDateRange() { 274 DR retVal = this.getTypedField(9, 0); 275 return retVal; 276 } 277 278 279 280 /** 281 * Returns 282 * ORG-10: "Employment Status Code" - creates it if necessary 283 */ 284 public CWE getEmploymentStatusCode() { 285 CWE retVal = this.getTypedField(10, 0); 286 return retVal; 287 } 288 289 /** 290 * Returns 291 * ORG-10: "Employment Status Code" - creates it if necessary 292 */ 293 public CWE getOrg10_EmploymentStatusCode() { 294 CWE retVal = this.getTypedField(10, 0); 295 return retVal; 296 } 297 298 299 300 /** 301 * Returns 302 * ORG-11: "Board Approval Indicator" - creates it if necessary 303 */ 304 public ID getBoardApprovalIndicator() { 305 ID retVal = this.getTypedField(11, 0); 306 return retVal; 307 } 308 309 /** 310 * Returns 311 * ORG-11: "Board Approval Indicator" - creates it if necessary 312 */ 313 public ID getOrg11_BoardApprovalIndicator() { 314 ID retVal = this.getTypedField(11, 0); 315 return retVal; 316 } 317 318 319 320 /** 321 * Returns 322 * ORG-12: "Primary Care Physician Indicator" - creates it if necessary 323 */ 324 public ID getPrimaryCarePhysicianIndicator() { 325 ID retVal = this.getTypedField(12, 0); 326 return retVal; 327 } 328 329 /** 330 * Returns 331 * ORG-12: "Primary Care Physician Indicator" - creates it if necessary 332 */ 333 public ID getOrg12_PrimaryCarePhysicianIndicator() { 334 ID retVal = this.getTypedField(12, 0); 335 return retVal; 336 } 337 338 339 /** 340 * Returns all repetitions of Cost Center Code (ORG-13). 341 */ 342 public CWE[] getCostCenterCode() { 343 CWE[] retVal = this.getTypedField(13, new CWE[0]); 344 return retVal; 345 } 346 347 348 /** 349 * Returns all repetitions of Cost Center Code (ORG-13). 350 */ 351 public CWE[] getOrg13_CostCenterCode() { 352 CWE[] retVal = this.getTypedField(13, new CWE[0]); 353 return retVal; 354 } 355 356 357 /** 358 * Returns a count of the current number of repetitions of Cost Center Code (ORG-13). 359 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 360 * it will return zero. 361 */ 362 public int getCostCenterCodeReps() { 363 return this.getReps(13); 364 } 365 366 367 /** 368 * Returns a specific repetition of 369 * ORG-13: "Cost Center Code" - creates it if necessary 370 * 371 * @param rep The repetition index (0-indexed) 372 */ 373 public CWE getCostCenterCode(int rep) { 374 CWE retVal = this.getTypedField(13, rep); 375 return retVal; 376 } 377 378 /** 379 * Returns a specific repetition of 380 * ORG-13: "Cost Center Code" - creates it if necessary 381 * 382 * @param rep The repetition index (0-indexed) 383 */ 384 public CWE getOrg13_CostCenterCode(int rep) { 385 CWE retVal = this.getTypedField(13, rep); 386 return retVal; 387 } 388 389 /** 390 * Returns a count of the current number of repetitions of Cost Center Code (ORG-13). 391 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 392 * it will return zero. 393 */ 394 public int getOrg13_CostCenterCodeReps() { 395 return this.getReps(13); 396 } 397 398 399 /** 400 * Inserts a repetition of 401 * ORG-13: "Cost Center Code" at a specific index 402 * 403 * @param rep The repetition index (0-indexed) 404 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 405 */ 406 public CWE insertCostCenterCode(int rep) throws HL7Exception { 407 return (CWE) super.insertRepetition(13, rep); 408 } 409 410 411 /** 412 * Inserts a repetition of 413 * ORG-13: "Cost Center Code" at a specific index 414 * 415 * @param rep The repetition index (0-indexed) 416 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 417 */ 418 public CWE insertOrg13_CostCenterCode(int rep) throws HL7Exception { 419 return (CWE) super.insertRepetition(13, rep); 420 } 421 422 423 /** 424 * Removes a repetition of 425 * ORG-13: "Cost Center Code" at a specific index 426 * 427 * @param rep The repetition index (0-indexed) 428 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 429 */ 430 public CWE removeCostCenterCode(int rep) throws HL7Exception { 431 return (CWE) super.removeRepetition(13, rep); 432 } 433 434 435 /** 436 * Removes a repetition of 437 * ORG-13: "Cost Center Code" at a specific index 438 * 439 * @param rep The repetition index (0-indexed) 440 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 441 */ 442 public CWE removeOrg13_CostCenterCode(int rep) throws HL7Exception { 443 return (CWE) super.removeRepetition(13, rep); 444 } 445 446 447 448 449 450 451 /** {@inheritDoc} */ 452 protected Type createNewTypeWithoutReflection(int field) { 453 switch (field) { 454 case 0: return new SI(getMessage()); 455 case 1: return new CWE(getMessage()); 456 case 2: return new CWE(getMessage()); 457 case 3: return new ID(getMessage(), new Integer( 136 )); 458 case 4: return new CX(getMessage()); 459 case 5: return new CWE(getMessage()); 460 case 6: return new CWE(getMessage()); 461 case 7: return new CWE(getMessage()); 462 case 8: return new DR(getMessage()); 463 case 9: return new CWE(getMessage()); 464 case 10: return new ID(getMessage(), new Integer( 136 )); 465 case 11: return new ID(getMessage(), new Integer( 136 )); 466 case 12: return new CWE(getMessage()); 467 default: return null; 468 } 469 } 470 471 472} 473