View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v24.segment;
35  
36  // import ca.uhn.hl7v2.model.v24.group.*;
37  import ca.uhn.hl7v2.model.v24.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 PSH message segment (Product Summary Header). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>PSH-1: Report Type (ST) <b> </b>
53       * <li>PSH-2: Report Form Identifier (ST) <b>optional </b>
54       * <li>PSH-3: Report Date (TS) <b> </b>
55       * <li>PSH-4: Report Interval Start Date (TS) <b>optional </b>
56       * <li>PSH-5: Report Interval End Date (TS) <b>optional </b>
57       * <li>PSH-6: Quantity Manufactured (CQ) <b>optional </b>
58       * <li>PSH-7: Quantity Distributed (CQ) <b>optional </b>
59       * <li>PSH-8: Quantity Distributed Method (ID) <b>optional </b>
60       * <li>PSH-9: Quantity Distributed Comment (FT) <b>optional </b>
61       * <li>PSH-10: Quantity in Use (CQ) <b>optional </b>
62       * <li>PSH-11: Quantity in Use Method (ID) <b>optional </b>
63       * <li>PSH-12: Quantity in Use Comment (FT) <b>optional </b>
64       * <li>PSH-13: Number of Product Experience Reports Filed by Facility (NM) <b>optional repeating</b>
65       * <li>PSH-14: Number of Product Experience Reports Filed by Distributor (NM) <b>optional repeating</b>
66   * </ul>
67   */
68  @SuppressWarnings("unused")
69  public class PSH extends AbstractSegment {
70  
71      /** 
72       * Creates a new PSH segment
73       */
74      public PSH(Group parent, ModelClassFactory factory) {
75         super(parent, factory);
76         init(factory);
77      }
78  
79      private void init(ModelClassFactory factory) {
80         try {
81                                    this.add(ST.class, true, 1, 60, new Object[]{ getMessage() }, "Report Type");
82                                    this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Report Form Identifier");
83                                    this.add(TS.class, true, 1, 26, new Object[]{ getMessage() }, "Report Date");
84                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Report Interval Start Date");
85                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Report Interval End Date");
86                                    this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Quantity Manufactured");
87                                    this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Quantity Distributed");
88                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(329) }, "Quantity Distributed Method");
89                                    this.add(FT.class, false, 1, 600, new Object[]{ getMessage() }, "Quantity Distributed Comment");
90                                    this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Quantity in Use");
91                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(329) }, "Quantity in Use Method");
92                                    this.add(FT.class, false, 1, 600, new Object[]{ getMessage() }, "Quantity in Use Comment");
93                                    this.add(NM.class, false, 8, 2, new Object[]{ getMessage() }, "Number of Product Experience Reports Filed by Facility");
94                                    this.add(NM.class, false, 8, 2, new Object[]{ getMessage() }, "Number of Product Experience Reports Filed by Distributor");
95         } catch(HL7Exception e) {
96            log.error("Unexpected error creating PSH - this is probably a bug in the source code generator.", e);
97         }
98      }
99  
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