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.v23.segment; 035 036// import ca.uhn.hl7v2.model.v23.group.*; 037import ca.uhn.hl7v2.model.v23.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 DG1 message segment (Diagnosis). 050 * This segment has the following fields:</p> 051 * <ul> 052 * <li>DG1-1: Set ID - Diagnosis (SI) <b> </b> 053 * <li>DG1-2: Diagnosis Coding Method (ID) <b>optional </b> 054 * <li>DG1-3: Diagnosis Code (CE) <b>optional </b> 055 * <li>DG1-4: Diagnosis Description (ST) <b>optional </b> 056 * <li>DG1-5: Diagnosis Date/Time (TS) <b>optional </b> 057 * <li>DG1-6: Diagnosis Type (IS) <b> </b> 058 * <li>DG1-7: Major Diagnostic Category (CE) <b>optional </b> 059 * <li>DG1-8: Diagnostic Related Group (CE) <b>optional </b> 060 * <li>DG1-9: DRG Approval Indicator (ID) <b>optional </b> 061 * <li>DG1-10: DRG Grouper Review Code (IS) <b>optional </b> 062 * <li>DG1-11: Outlier Type (CE) <b>optional </b> 063 * <li>DG1-12: Outlier Days (NM) <b>optional </b> 064 * <li>DG1-13: Outlier Cost (CP) <b>optional </b> 065 * <li>DG1-14: Grouper Version and Type (ST) <b>optional </b> 066 * <li>DG1-15: Diagnosis Priority (NM) <b>optional </b> 067 * <li>DG1-16: Diagnosing Clinician (XCN) <b>optional repeating</b> 068 * <li>DG1-17: Diagnosis Classification (IS) <b>optional </b> 069 * <li>DG1-18: Confidential Indicator (ID) <b>optional </b> 070 * <li>DG1-19: Attestation Date/Time (TS) <b>optional </b> 071 * </ul> 072 */ 073@SuppressWarnings("unused") 074public class DG1 extends AbstractSegment { 075 076 /** 077 * Creates a new DG1 segment 078 */ 079 public DG1(Group parent, ModelClassFactory factory) { 080 super(parent, factory); 081 init(factory); 082 } 083 084 private void init(ModelClassFactory factory) { 085 try { 086 this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - Diagnosis"); 087 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(53) }, "Diagnosis Coding Method"); 088 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Diagnosis Code"); 089 this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Diagnosis Description"); 090 this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Diagnosis Date/Time"); 091 this.add(IS.class, true, 1, 2, new Object[]{ getMessage(), new Integer(52) }, "Diagnosis Type"); 092 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Major Diagnostic Category"); 093 this.add(CE.class, false, 1, 4, new Object[]{ getMessage() }, "Diagnostic Related Group"); 094 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(136) }, "DRG Approval Indicator"); 095 this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(56) }, "DRG Grouper Review Code"); 096 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Outlier Type"); 097 this.add(NM.class, false, 1, 3, new Object[]{ getMessage() }, "Outlier Days"); 098 this.add(CP.class, false, 1, 12, new Object[]{ getMessage() }, "Outlier Cost"); 099 this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "Grouper Version and Type"); 100 this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "Diagnosis Priority"); 101 this.add(XCN.class, false, 0, 60, new Object[]{ getMessage() }, "Diagnosing Clinician"); 102 this.add(IS.class, false, 1, 3, new Object[]{ getMessage(), new Integer(228) }, "Diagnosis Classification"); 103 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Confidential Indicator"); 104 this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Attestation Date/Time"); 105 } catch(HL7Exception e) { 106 log.error("Unexpected error creating DG1 - this is probably a bug in the source code generator.", e); 107 } 108 } 109 110 111 112 /** 113 * Returns 114 * DG1-1: "Set ID - Diagnosis" - creates it if necessary 115 */ 116 public SI getSetIDDiagnosis() { 117 SI retVal = this.getTypedField(1, 0); 118 return retVal; 119 } 120 121 /** 122 * Returns 123 * DG1-1: "Set ID - Diagnosis" - creates it if necessary 124 */ 125 public SI getDg11_SetIDDiagnosis() { 126 SI retVal = this.getTypedField(1, 0); 127 return retVal; 128 } 129 130 131 132 /** 133 * Returns 134 * DG1-2: "Diagnosis Coding Method" - creates it if necessary 135 */ 136 public ID getDiagnosisCodingMethod() { 137 ID retVal = this.getTypedField(2, 0); 138 return retVal; 139 } 140 141 /** 142 * Returns 143 * DG1-2: "Diagnosis Coding Method" - creates it if necessary 144 */ 145 public ID getDg12_DiagnosisCodingMethod() { 146 ID retVal = this.getTypedField(2, 0); 147 return retVal; 148 } 149 150 151 152 /** 153 * Returns 154 * DG1-3: "Diagnosis Code" - creates it if necessary 155 */ 156 public CE getDiagnosisCode() { 157 CE retVal = this.getTypedField(3, 0); 158 return retVal; 159 } 160 161 /** 162 * Returns 163 * DG1-3: "Diagnosis Code" - creates it if necessary 164 */ 165 public CE getDg13_DiagnosisCode() { 166 CE retVal = this.getTypedField(3, 0); 167 return retVal; 168 } 169 170 171 172 /** 173 * Returns 174 * DG1-4: "Diagnosis Description" - creates it if necessary 175 */ 176 public ST getDiagnosisDescription() { 177 ST retVal = this.getTypedField(4, 0); 178 return retVal; 179 } 180 181 /** 182 * Returns 183 * DG1-4: "Diagnosis Description" - creates it if necessary 184 */ 185 public ST getDg14_DiagnosisDescription() { 186 ST retVal = this.getTypedField(4, 0); 187 return retVal; 188 } 189 190 191 192 /** 193 * Returns 194 * DG1-5: "Diagnosis Date/Time" - creates it if necessary 195 */ 196 public TS getDiagnosisDateTime() { 197 TS retVal = this.getTypedField(5, 0); 198 return retVal; 199 } 200 201 /** 202 * Returns 203 * DG1-5: "Diagnosis Date/Time" - creates it if necessary 204 */ 205 public TS getDg15_DiagnosisDateTime() { 206 TS retVal = this.getTypedField(5, 0); 207 return retVal; 208 } 209 210 211 212 /** 213 * Returns 214 * DG1-6: "Diagnosis Type" - creates it if necessary 215 */ 216 public IS getDiagnosisType() { 217 IS retVal = this.getTypedField(6, 0); 218 return retVal; 219 } 220 221 /** 222 * Returns 223 * DG1-6: "Diagnosis Type" - creates it if necessary 224 */ 225 public IS getDg16_DiagnosisType() { 226 IS retVal = this.getTypedField(6, 0); 227 return retVal; 228 } 229 230 231 232 /** 233 * Returns 234 * DG1-7: "Major Diagnostic Category" - creates it if necessary 235 */ 236 public CE getMajorDiagnosticCategory() { 237 CE retVal = this.getTypedField(7, 0); 238 return retVal; 239 } 240 241 /** 242 * Returns 243 * DG1-7: "Major Diagnostic Category" - creates it if necessary 244 */ 245 public CE getDg17_MajorDiagnosticCategory() { 246 CE retVal = this.getTypedField(7, 0); 247 return retVal; 248 } 249 250 251 252 /** 253 * Returns 254 * DG1-8: "Diagnostic Related Group" - creates it if necessary 255 */ 256 public CE getDiagnosticRelatedGroup() { 257 CE retVal = this.getTypedField(8, 0); 258 return retVal; 259 } 260 261 /** 262 * Returns 263 * DG1-8: "Diagnostic Related Group" - creates it if necessary 264 */ 265 public CE getDg18_DiagnosticRelatedGroup() { 266 CE retVal = this.getTypedField(8, 0); 267 return retVal; 268 } 269 270 271 272 /** 273 * Returns 274 * DG1-9: "DRG Approval Indicator" - creates it if necessary 275 */ 276 public ID getDRGApprovalIndicator() { 277 ID retVal = this.getTypedField(9, 0); 278 return retVal; 279 } 280 281 /** 282 * Returns 283 * DG1-9: "DRG Approval Indicator" - creates it if necessary 284 */ 285 public ID getDg19_DRGApprovalIndicator() { 286 ID retVal = this.getTypedField(9, 0); 287 return retVal; 288 } 289 290 291 292 /** 293 * Returns 294 * DG1-10: "DRG Grouper Review Code" - creates it if necessary 295 */ 296 public IS getDRGGrouperReviewCode() { 297 IS retVal = this.getTypedField(10, 0); 298 return retVal; 299 } 300 301 /** 302 * Returns 303 * DG1-10: "DRG Grouper Review Code" - creates it if necessary 304 */ 305 public IS getDg110_DRGGrouperReviewCode() { 306 IS retVal = this.getTypedField(10, 0); 307 return retVal; 308 } 309 310 311 312 /** 313 * Returns 314 * DG1-11: "Outlier Type" - creates it if necessary 315 */ 316 public CE getOutlierType() { 317 CE retVal = this.getTypedField(11, 0); 318 return retVal; 319 } 320 321 /** 322 * Returns 323 * DG1-11: "Outlier Type" - creates it if necessary 324 */ 325 public CE getDg111_OutlierType() { 326 CE retVal = this.getTypedField(11, 0); 327 return retVal; 328 } 329 330 331 332 /** 333 * Returns 334 * DG1-12: "Outlier Days" - creates it if necessary 335 */ 336 public NM getOutlierDays() { 337 NM retVal = this.getTypedField(12, 0); 338 return retVal; 339 } 340 341 /** 342 * Returns 343 * DG1-12: "Outlier Days" - creates it if necessary 344 */ 345 public NM getDg112_OutlierDays() { 346 NM retVal = this.getTypedField(12, 0); 347 return retVal; 348 } 349 350 351 352 /** 353 * Returns 354 * DG1-13: "Outlier Cost" - creates it if necessary 355 */ 356 public CP getOutlierCost() { 357 CP retVal = this.getTypedField(13, 0); 358 return retVal; 359 } 360 361 /** 362 * Returns 363 * DG1-13: "Outlier Cost" - creates it if necessary 364 */ 365 public CP getDg113_OutlierCost() { 366 CP retVal = this.getTypedField(13, 0); 367 return retVal; 368 } 369 370 371 372 /** 373 * Returns 374 * DG1-14: "Grouper Version and Type" - creates it if necessary 375 */ 376 public ST getGrouperVersionAndType() { 377 ST retVal = this.getTypedField(14, 0); 378 return retVal; 379 } 380 381 /** 382 * Returns 383 * DG1-14: "Grouper Version and Type" - creates it if necessary 384 */ 385 public ST getDg114_GrouperVersionAndType() { 386 ST retVal = this.getTypedField(14, 0); 387 return retVal; 388 } 389 390 391 392 /** 393 * Returns 394 * DG1-15: "Diagnosis Priority" - creates it if necessary 395 */ 396 public NM getDiagnosisPriority() { 397 NM retVal = this.getTypedField(15, 0); 398 return retVal; 399 } 400 401 /** 402 * Returns 403 * DG1-15: "Diagnosis Priority" - creates it if necessary 404 */ 405 public NM getDg115_DiagnosisPriority() { 406 NM retVal = this.getTypedField(15, 0); 407 return retVal; 408 } 409 410 411 /** 412 * Returns all repetitions of Diagnosing Clinician (DG1-16). 413 */ 414 public XCN[] getDiagnosingClinician() { 415 XCN[] retVal = this.getTypedField(16, new XCN[0]); 416 return retVal; 417 } 418 419 420 /** 421 * Returns all repetitions of Diagnosing Clinician (DG1-16). 422 */ 423 public XCN[] getDg116_DiagnosingClinician() { 424 XCN[] retVal = this.getTypedField(16, new XCN[0]); 425 return retVal; 426 } 427 428 429 /** 430 * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16). 431 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 432 * it will return zero. 433 */ 434 public int getDiagnosingClinicianReps() { 435 return this.getReps(16); 436 } 437 438 439 /** 440 * Returns a specific repetition of 441 * DG1-16: "Diagnosing Clinician" - creates it if necessary 442 * 443 * @param rep The repetition index (0-indexed) 444 */ 445 public XCN getDiagnosingClinician(int rep) { 446 XCN retVal = this.getTypedField(16, rep); 447 return retVal; 448 } 449 450 /** 451 * Returns a specific repetition of 452 * DG1-16: "Diagnosing Clinician" - creates it if necessary 453 * 454 * @param rep The repetition index (0-indexed) 455 */ 456 public XCN getDg116_DiagnosingClinician(int rep) { 457 XCN retVal = this.getTypedField(16, rep); 458 return retVal; 459 } 460 461 /** 462 * Returns a count of the current number of repetitions of Diagnosing Clinician (DG1-16). 463 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 464 * it will return zero. 465 */ 466 public int getDg116_DiagnosingClinicianReps() { 467 return this.getReps(16); 468 } 469 470 471 /** 472 * Inserts a repetition of 473 * DG1-16: "Diagnosing Clinician" at a specific index 474 * 475 * @param rep The repetition index (0-indexed) 476 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 477 */ 478 public XCN insertDiagnosingClinician(int rep) throws HL7Exception { 479 return (XCN) super.insertRepetition(16, rep); 480 } 481 482 483 /** 484 * Inserts a repetition of 485 * DG1-16: "Diagnosing Clinician" at a specific index 486 * 487 * @param rep The repetition index (0-indexed) 488 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 489 */ 490 public XCN insertDg116_DiagnosingClinician(int rep) throws HL7Exception { 491 return (XCN) super.insertRepetition(16, rep); 492 } 493 494 495 /** 496 * Removes a repetition of 497 * DG1-16: "Diagnosing Clinician" at a specific index 498 * 499 * @param rep The repetition index (0-indexed) 500 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 501 */ 502 public XCN removeDiagnosingClinician(int rep) throws HL7Exception { 503 return (XCN) super.removeRepetition(16, rep); 504 } 505 506 507 /** 508 * Removes a repetition of 509 * DG1-16: "Diagnosing Clinician" at a specific index 510 * 511 * @param rep The repetition index (0-indexed) 512 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 513 */ 514 public XCN removeDg116_DiagnosingClinician(int rep) throws HL7Exception { 515 return (XCN) super.removeRepetition(16, rep); 516 } 517 518 519 520 521 /** 522 * Returns 523 * DG1-17: "Diagnosis Classification" - creates it if necessary 524 */ 525 public IS getDiagnosisClassification() { 526 IS retVal = this.getTypedField(17, 0); 527 return retVal; 528 } 529 530 /** 531 * Returns 532 * DG1-17: "Diagnosis Classification" - creates it if necessary 533 */ 534 public IS getDg117_DiagnosisClassification() { 535 IS retVal = this.getTypedField(17, 0); 536 return retVal; 537 } 538 539 540 541 /** 542 * Returns 543 * DG1-18: "Confidential Indicator" - creates it if necessary 544 */ 545 public ID getConfidentialIndicator() { 546 ID retVal = this.getTypedField(18, 0); 547 return retVal; 548 } 549 550 /** 551 * Returns 552 * DG1-18: "Confidential Indicator" - creates it if necessary 553 */ 554 public ID getDg118_ConfidentialIndicator() { 555 ID retVal = this.getTypedField(18, 0); 556 return retVal; 557 } 558 559 560 561 /** 562 * Returns 563 * DG1-19: "Attestation Date/Time" - creates it if necessary 564 */ 565 public TS getAttestationDateTime() { 566 TS retVal = this.getTypedField(19, 0); 567 return retVal; 568 } 569 570 /** 571 * Returns 572 * DG1-19: "Attestation Date/Time" - creates it if necessary 573 */ 574 public TS getDg119_AttestationDateTime() { 575 TS retVal = this.getTypedField(19, 0); 576 return retVal; 577 } 578 579 580 581 582 583 /** {@inheritDoc} */ 584 protected Type createNewTypeWithoutReflection(int field) { 585 switch (field) { 586 case 0: return new SI(getMessage()); 587 case 1: return new ID(getMessage(), new Integer( 53 )); 588 case 2: return new CE(getMessage()); 589 case 3: return new ST(getMessage()); 590 case 4: return new TS(getMessage()); 591 case 5: return new IS(getMessage(), new Integer( 52 )); 592 case 6: return new CE(getMessage()); 593 case 7: return new CE(getMessage()); 594 case 8: return new ID(getMessage(), new Integer( 136 )); 595 case 9: return new IS(getMessage(), new Integer( 56 )); 596 case 10: return new CE(getMessage()); 597 case 11: return new NM(getMessage()); 598 case 12: return new CP(getMessage()); 599 case 13: return new ST(getMessage()); 600 case 14: return new NM(getMessage()); 601 case 15: return new XCN(getMessage()); 602 case 16: return new IS(getMessage(), new Integer( 228 )); 603 case 17: return new ID(getMessage(), new Integer( 136 )); 604 case 18: return new TS(getMessage()); 605 default: return null; 606 } 607 } 608 609 610} 611