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 PSH message segment (Product Summary Header). 049 * This segment has the following fields:</p> 050 * <ul> 051 * <li>PSH-1: Report Type (ST) <b> </b> 052 * <li>PSH-2: Report Form Identifier (ST) <b>optional </b> 053 * <li>PSH-3: Report Date (DTM) <b> </b> 054 * <li>PSH-4: Report Interval Start Date (DTM) <b>optional </b> 055 * <li>PSH-5: Report Interval End Date (DTM) <b>optional </b> 056 * <li>PSH-6: Quantity Manufactured (CQ) <b>optional </b> 057 * <li>PSH-7: Quantity Distributed (CQ) <b>optional </b> 058 * <li>PSH-8: Quantity Distributed Method (ID) <b>optional </b> 059 * <li>PSH-9: Quantity Distributed Comment (FT) <b>optional </b> 060 * <li>PSH-10: Quantity in Use (CQ) <b>optional </b> 061 * <li>PSH-11: Quantity in Use Method (ID) <b>optional </b> 062 * <li>PSH-12: Quantity in Use Comment (FT) <b>optional </b> 063 * <li>PSH-13: Number of Product Experience Reports Filed by Facility (NM) <b>optional repeating</b> 064 * <li>PSH-14: Number of Product Experience Reports Filed by Distributor (NM) <b>optional repeating</b> 065 * </ul> 066 */ 067@SuppressWarnings("unused") 068public class PSH extends AbstractSegment { 069 070 /** 071 * Creates a new PSH segment 072 */ 073 public PSH(Group parent, ModelClassFactory factory) { 074 super(parent, factory); 075 init(factory); 076 } 077 078 private void init(ModelClassFactory factory) { 079 try { 080 this.add(ST.class, true, 1, 60, new Object[]{ getMessage() }, "Report Type"); 081 this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Report Form Identifier"); 082 this.add(DTM.class, true, 1, 24, new Object[]{ getMessage() }, "Report Date"); 083 this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Report Interval Start Date"); 084 this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Report Interval End Date"); 085 this.add(CQ.class, false, 1, 722, new Object[]{ getMessage() }, "Quantity Manufactured"); 086 this.add(CQ.class, false, 1, 722, new Object[]{ getMessage() }, "Quantity Distributed"); 087 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(329) }, "Quantity Distributed Method"); 088 this.add(FT.class, false, 1, 600, new Object[]{ getMessage() }, "Quantity Distributed Comment"); 089 this.add(CQ.class, false, 1, 722, new Object[]{ getMessage() }, "Quantity in Use"); 090 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(329) }, "Quantity in Use Method"); 091 this.add(FT.class, false, 1, 600, new Object[]{ getMessage() }, "Quantity in Use Comment"); 092 this.add(NM.class, false, 8, 16, new Object[]{ getMessage() }, "Number of Product Experience Reports Filed by Facility"); 093 this.add(NM.class, false, 8, 16, new Object[]{ getMessage() }, "Number of Product Experience Reports Filed by Distributor"); 094 } catch(HL7Exception e) { 095 log.error("Unexpected error creating PSH - this is probably a bug in the source code generator.", e); 096 } 097 } 098 099 100 101 /** 102 * Returns 103 * PSH-1: "Report Type" - creates it if necessary 104 */ 105 public ST getReportType() { 106 ST retVal = this.getTypedField(1, 0); 107 return retVal; 108 } 109 110 /** 111 * Returns 112 * PSH-1: "Report Type" - creates it if necessary 113 */ 114 public ST getPsh1_ReportType() { 115 ST retVal = this.getTypedField(1, 0); 116 return retVal; 117 } 118 119 120 121 /** 122 * Returns 123 * PSH-2: "Report Form Identifier" - creates it if necessary 124 */ 125 public ST getReportFormIdentifier() { 126 ST retVal = this.getTypedField(2, 0); 127 return retVal; 128 } 129 130 /** 131 * Returns 132 * PSH-2: "Report Form Identifier" - creates it if necessary 133 */ 134 public ST getPsh2_ReportFormIdentifier() { 135 ST retVal = this.getTypedField(2, 0); 136 return retVal; 137 } 138 139 140 141 /** 142 * Returns 143 * PSH-3: "Report Date" - creates it if necessary 144 */ 145 public DTM getReportDate() { 146 DTM retVal = this.getTypedField(3, 0); 147 return retVal; 148 } 149 150 /** 151 * Returns 152 * PSH-3: "Report Date" - creates it if necessary 153 */ 154 public DTM getPsh3_ReportDate() { 155 DTM retVal = this.getTypedField(3, 0); 156 return retVal; 157 } 158 159 160 161 /** 162 * Returns 163 * PSH-4: "Report Interval Start Date" - creates it if necessary 164 */ 165 public DTM getReportIntervalStartDate() { 166 DTM retVal = this.getTypedField(4, 0); 167 return retVal; 168 } 169 170 /** 171 * Returns 172 * PSH-4: "Report Interval Start Date" - creates it if necessary 173 */ 174 public DTM getPsh4_ReportIntervalStartDate() { 175 DTM retVal = this.getTypedField(4, 0); 176 return retVal; 177 } 178 179 180 181 /** 182 * Returns 183 * PSH-5: "Report Interval End Date" - creates it if necessary 184 */ 185 public DTM getReportIntervalEndDate() { 186 DTM retVal = this.getTypedField(5, 0); 187 return retVal; 188 } 189 190 /** 191 * Returns 192 * PSH-5: "Report Interval End Date" - creates it if necessary 193 */ 194 public DTM getPsh5_ReportIntervalEndDate() { 195 DTM retVal = this.getTypedField(5, 0); 196 return retVal; 197 } 198 199 200 201 /** 202 * Returns 203 * PSH-6: "Quantity Manufactured" - creates it if necessary 204 */ 205 public CQ getQuantityManufactured() { 206 CQ retVal = this.getTypedField(6, 0); 207 return retVal; 208 } 209 210 /** 211 * Returns 212 * PSH-6: "Quantity Manufactured" - creates it if necessary 213 */ 214 public CQ getPsh6_QuantityManufactured() { 215 CQ retVal = this.getTypedField(6, 0); 216 return retVal; 217 } 218 219 220 221 /** 222 * Returns 223 * PSH-7: "Quantity Distributed" - creates it if necessary 224 */ 225 public CQ getQuantityDistributed() { 226 CQ retVal = this.getTypedField(7, 0); 227 return retVal; 228 } 229 230 /** 231 * Returns 232 * PSH-7: "Quantity Distributed" - creates it if necessary 233 */ 234 public CQ getPsh7_QuantityDistributed() { 235 CQ retVal = this.getTypedField(7, 0); 236 return retVal; 237 } 238 239 240 241 /** 242 * Returns 243 * PSH-8: "Quantity Distributed Method" - creates it if necessary 244 */ 245 public ID getQuantityDistributedMethod() { 246 ID retVal = this.getTypedField(8, 0); 247 return retVal; 248 } 249 250 /** 251 * Returns 252 * PSH-8: "Quantity Distributed Method" - creates it if necessary 253 */ 254 public ID getPsh8_QuantityDistributedMethod() { 255 ID retVal = this.getTypedField(8, 0); 256 return retVal; 257 } 258 259 260 261 /** 262 * Returns 263 * PSH-9: "Quantity Distributed Comment" - creates it if necessary 264 */ 265 public FT getQuantityDistributedComment() { 266 FT retVal = this.getTypedField(9, 0); 267 return retVal; 268 } 269 270 /** 271 * Returns 272 * PSH-9: "Quantity Distributed Comment" - creates it if necessary 273 */ 274 public FT getPsh9_QuantityDistributedComment() { 275 FT retVal = this.getTypedField(9, 0); 276 return retVal; 277 } 278 279 280 281 /** 282 * Returns 283 * PSH-10: "Quantity in Use" - creates it if necessary 284 */ 285 public CQ getQuantityInUse() { 286 CQ retVal = this.getTypedField(10, 0); 287 return retVal; 288 } 289 290 /** 291 * Returns 292 * PSH-10: "Quantity in Use" - creates it if necessary 293 */ 294 public CQ getPsh10_QuantityInUse() { 295 CQ retVal = this.getTypedField(10, 0); 296 return retVal; 297 } 298 299 300 301 /** 302 * Returns 303 * PSH-11: "Quantity in Use Method" - creates it if necessary 304 */ 305 public ID getQuantityInUseMethod() { 306 ID retVal = this.getTypedField(11, 0); 307 return retVal; 308 } 309 310 /** 311 * Returns 312 * PSH-11: "Quantity in Use Method" - creates it if necessary 313 */ 314 public ID getPsh11_QuantityInUseMethod() { 315 ID retVal = this.getTypedField(11, 0); 316 return retVal; 317 } 318 319 320 321 /** 322 * Returns 323 * PSH-12: "Quantity in Use Comment" - creates it if necessary 324 */ 325 public FT getQuantityInUseComment() { 326 FT retVal = this.getTypedField(12, 0); 327 return retVal; 328 } 329 330 /** 331 * Returns 332 * PSH-12: "Quantity in Use Comment" - creates it if necessary 333 */ 334 public FT getPsh12_QuantityInUseComment() { 335 FT retVal = this.getTypedField(12, 0); 336 return retVal; 337 } 338 339 340 /** 341 * Returns all repetitions of Number of Product Experience Reports Filed by Facility (PSH-13). 342 */ 343 public NM[] getNumberOfProductExperienceReportsFiledByFacility() { 344 NM[] retVal = this.getTypedField(13, new NM[0]); 345 return retVal; 346 } 347 348 349 /** 350 * Returns all repetitions of Number of Product Experience Reports Filed by Facility (PSH-13). 351 */ 352 public NM[] getPsh13_NumberOfProductExperienceReportsFiledByFacility() { 353 NM[] retVal = this.getTypedField(13, new NM[0]); 354 return retVal; 355 } 356 357 358 /** 359 * Returns a count of the current number of repetitions of Number of Product Experience Reports Filed by Facility (PSH-13). 360 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 361 * it will return zero. 362 */ 363 public int getNumberOfProductExperienceReportsFiledByFacilityReps() { 364 return this.getReps(13); 365 } 366 367 368 /** 369 * Returns a specific repetition of 370 * PSH-13: "Number of Product Experience Reports Filed by Facility" - creates it if necessary 371 * 372 * @param rep The repetition index (0-indexed) 373 */ 374 public NM getNumberOfProductExperienceReportsFiledByFacility(int rep) { 375 NM retVal = this.getTypedField(13, rep); 376 return retVal; 377 } 378 379 /** 380 * Returns a specific repetition of 381 * PSH-13: "Number of Product Experience Reports Filed by Facility" - creates it if necessary 382 * 383 * @param rep The repetition index (0-indexed) 384 */ 385 public NM getPsh13_NumberOfProductExperienceReportsFiledByFacility(int rep) { 386 NM retVal = this.getTypedField(13, rep); 387 return retVal; 388 } 389 390 /** 391 * Returns a count of the current number of repetitions of Number of Product Experience Reports Filed by Facility (PSH-13). 392 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 393 * it will return zero. 394 */ 395 public int getPsh13_NumberOfProductExperienceReportsFiledByFacilityReps() { 396 return this.getReps(13); 397 } 398 399 400 /** 401 * Inserts a repetition of 402 * PSH-13: "Number of Product Experience Reports Filed by Facility" at a specific index 403 * 404 * @param rep The repetition index (0-indexed) 405 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 406 */ 407 public NM insertNumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception { 408 return (NM) super.insertRepetition(13, rep); 409 } 410 411 412 /** 413 * Inserts a repetition of 414 * PSH-13: "Number of Product Experience Reports Filed by Facility" at a specific index 415 * 416 * @param rep The repetition index (0-indexed) 417 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 418 */ 419 public NM insertPsh13_NumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception { 420 return (NM) super.insertRepetition(13, rep); 421 } 422 423 424 /** 425 * Removes a repetition of 426 * PSH-13: "Number of Product Experience Reports Filed by Facility" at a specific index 427 * 428 * @param rep The repetition index (0-indexed) 429 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 430 */ 431 public NM removeNumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception { 432 return (NM) super.removeRepetition(13, rep); 433 } 434 435 436 /** 437 * Removes a repetition of 438 * PSH-13: "Number of Product Experience Reports Filed by Facility" at a specific index 439 * 440 * @param rep The repetition index (0-indexed) 441 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 442 */ 443 public NM removePsh13_NumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception { 444 return (NM) super.removeRepetition(13, rep); 445 } 446 447 448 449 /** 450 * Returns all repetitions of Number of Product Experience Reports Filed by Distributor (PSH-14). 451 */ 452 public NM[] getNumberOfProductExperienceReportsFiledByDistributor() { 453 NM[] retVal = this.getTypedField(14, new NM[0]); 454 return retVal; 455 } 456 457 458 /** 459 * Returns all repetitions of Number of Product Experience Reports Filed by Distributor (PSH-14). 460 */ 461 public NM[] getPsh14_NumberOfProductExperienceReportsFiledByDistributor() { 462 NM[] retVal = this.getTypedField(14, new NM[0]); 463 return retVal; 464 } 465 466 467 /** 468 * Returns a count of the current number of repetitions of Number of Product Experience Reports Filed by Distributor (PSH-14). 469 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 470 * it will return zero. 471 */ 472 public int getNumberOfProductExperienceReportsFiledByDistributorReps() { 473 return this.getReps(14); 474 } 475 476 477 /** 478 * Returns a specific repetition of 479 * PSH-14: "Number of Product Experience Reports Filed by Distributor" - creates it if necessary 480 * 481 * @param rep The repetition index (0-indexed) 482 */ 483 public NM getNumberOfProductExperienceReportsFiledByDistributor(int rep) { 484 NM retVal = this.getTypedField(14, rep); 485 return retVal; 486 } 487 488 /** 489 * Returns a specific repetition of 490 * PSH-14: "Number of Product Experience Reports Filed by Distributor" - creates it if necessary 491 * 492 * @param rep The repetition index (0-indexed) 493 */ 494 public NM getPsh14_NumberOfProductExperienceReportsFiledByDistributor(int rep) { 495 NM retVal = this.getTypedField(14, rep); 496 return retVal; 497 } 498 499 /** 500 * Returns a count of the current number of repetitions of Number of Product Experience Reports Filed by Distributor (PSH-14). 501 * This method does not create a repetition, so if no repetitions have currently been defined or accessed, 502 * it will return zero. 503 */ 504 public int getPsh14_NumberOfProductExperienceReportsFiledByDistributorReps() { 505 return this.getReps(14); 506 } 507 508 509 /** 510 * Inserts a repetition of 511 * PSH-14: "Number of Product Experience Reports Filed by Distributor" at a specific index 512 * 513 * @param rep The repetition index (0-indexed) 514 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 515 */ 516 public NM insertNumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception { 517 return (NM) super.insertRepetition(14, rep); 518 } 519 520 521 /** 522 * Inserts a repetition of 523 * PSH-14: "Number of Product Experience Reports Filed by Distributor" at a specific index 524 * 525 * @param rep The repetition index (0-indexed) 526 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 527 */ 528 public NM insertPsh14_NumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception { 529 return (NM) super.insertRepetition(14, rep); 530 } 531 532 533 /** 534 * Removes a repetition of 535 * PSH-14: "Number of Product Experience Reports Filed by Distributor" at a specific index 536 * 537 * @param rep The repetition index (0-indexed) 538 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 539 */ 540 public NM removeNumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception { 541 return (NM) super.removeRepetition(14, rep); 542 } 543 544 545 /** 546 * Removes a repetition of 547 * PSH-14: "Number of Product Experience Reports Filed by Distributor" at a specific index 548 * 549 * @param rep The repetition index (0-indexed) 550 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) 551 */ 552 public NM removePsh14_NumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception { 553 return (NM) super.removeRepetition(14, rep); 554 } 555 556 557 558 559 560 561 /** {@inheritDoc} */ 562 protected Type createNewTypeWithoutReflection(int field) { 563 switch (field) { 564 case 0: return new ST(getMessage()); 565 case 1: return new ST(getMessage()); 566 case 2: return new DTM(getMessage()); 567 case 3: return new DTM(getMessage()); 568 case 4: return new DTM(getMessage()); 569 case 5: return new CQ(getMessage()); 570 case 6: return new CQ(getMessage()); 571 case 7: return new ID(getMessage(), new Integer( 329 )); 572 case 8: return new FT(getMessage()); 573 case 9: return new CQ(getMessage()); 574 case 10: return new ID(getMessage(), new Integer( 329 )); 575 case 11: return new FT(getMessage()); 576 case 12: return new NM(getMessage()); 577 case 13: return new NM(getMessage()); 578 default: return null; 579 } 580 } 581 582 583} 584