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