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.v23.segment;
35  
36  // import ca.uhn.hl7v2.model.v23.group.*;
37  import ca.uhn.hl7v2.model.v23.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 PDC message segment (Product Detail Country). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>PDC-1: Manufacturer/Distributor (XON) <b> </b>
53       * <li>PDC-2: Country (CE) <b> </b>
54       * <li>PDC-3: Brand Name (ST) <b> </b>
55       * <li>PDC-4: Device Family Name (ST) <b>optional </b>
56       * <li>PDC-5: Generic Name (CE) <b>optional </b>
57       * <li>PDC-6: Model Identifier (ST) <b>optional repeating</b>
58       * <li>PDC-7: Catalogue Identifier (ST) <b>optional </b>
59       * <li>PDC-8: Other Identifier (ST) <b>optional repeating</b>
60       * <li>PDC-9: Product Code (CE) <b>optional </b>
61       * <li>PDC-10: Marketing Basis (ID) <b>optional </b>
62       * <li>PDC-11: Marketing Approval Identifier (ST) <b>optional </b>
63       * <li>PDC-12: Labeled Shelf Life (CQ) <b>optional </b>
64       * <li>PDC-13: Expected Shelf Life (CQ) <b>optional </b>
65       * <li>PDC-14: Date First Marked (TS) <b>optional </b>
66       * <li>PDC-15: Date Last Marked (TS) <b>optional </b>
67   * </ul>
68   */
69  @SuppressWarnings("unused")
70  public class PDC extends AbstractSegment {
71  
72      /** 
73       * Creates a new PDC segment
74       */
75      public PDC(Group parent, ModelClassFactory factory) {
76         super(parent, factory);
77         init(factory);
78      }
79  
80      private void init(ModelClassFactory factory) {
81         try {
82                                    this.add(XON.class, true, 1, 80, new Object[]{ getMessage() }, "Manufacturer/Distributor");
83                                    this.add(CE.class, true, 1, 60, new Object[]{ getMessage() }, "Country");
84                                    this.add(ST.class, true, 1, 60, new Object[]{ getMessage() }, "Brand Name");
85                                    this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Device Family Name");
86                                    this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Generic Name");
87                                    this.add(ST.class, false, 0, 60, new Object[]{ getMessage() }, "Model Identifier");
88                                    this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Catalogue Identifier");
89                                    this.add(ST.class, false, 0, 60, new Object[]{ getMessage() }, "Other Identifier");
90                                    this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Product Code");
91                                                this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(330) }, "Marketing Basis");
92                                    this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Marketing Approval Identifier");
93                                    this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Labeled Shelf Life");
94                                    this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Expected Shelf Life");
95                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date First Marked");
96                                    this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date Last Marked");
97         } catch(HL7Exception e) {
98            log.error("Unexpected error creating PDC - this is probably a bug in the source code generator.", e);
99         }
100     }
101 
102 
103 
104     /**
105      * Returns
106      * PDC-1: "Manufacturer/Distributor" - creates it if necessary
107      */
108     public XON getManufacturerDistributor() { 
109 		XON retVal = this.getTypedField(1, 0);
110 		return retVal;
111     }
112     
113     /**
114      * Returns
115      * PDC-1: "Manufacturer/Distributor" - creates it if necessary
116      */
117     public XON getPdc1_ManufacturerDistributor() { 
118 		XON retVal = this.getTypedField(1, 0);
119 		return retVal;
120     }
121 
122 
123 
124     /**
125      * Returns
126      * PDC-2: "Country" - creates it if necessary
127      */
128     public CE getCountry() { 
129 		CE retVal = this.getTypedField(2, 0);
130 		return retVal;
131     }
132     
133     /**
134      * Returns
135      * PDC-2: "Country" - creates it if necessary
136      */
137     public CE getPdc2_Country() { 
138 		CE retVal = this.getTypedField(2, 0);
139 		return retVal;
140     }
141 
142 
143 
144     /**
145      * Returns
146      * PDC-3: "Brand Name" - creates it if necessary
147      */
148     public ST getBrandName() { 
149 		ST retVal = this.getTypedField(3, 0);
150 		return retVal;
151     }
152     
153     /**
154      * Returns
155      * PDC-3: "Brand Name" - creates it if necessary
156      */
157     public ST getPdc3_BrandName() { 
158 		ST retVal = this.getTypedField(3, 0);
159 		return retVal;
160     }
161 
162 
163 
164     /**
165      * Returns
166      * PDC-4: "Device Family Name" - creates it if necessary
167      */
168     public ST getDeviceFamilyName() { 
169 		ST retVal = this.getTypedField(4, 0);
170 		return retVal;
171     }
172     
173     /**
174      * Returns
175      * PDC-4: "Device Family Name" - creates it if necessary
176      */
177     public ST getPdc4_DeviceFamilyName() { 
178 		ST retVal = this.getTypedField(4, 0);
179 		return retVal;
180     }
181 
182 
183 
184     /**
185      * Returns
186      * PDC-5: "Generic Name" - creates it if necessary
187      */
188     public CE getGenericName() { 
189 		CE retVal = this.getTypedField(5, 0);
190 		return retVal;
191     }
192     
193     /**
194      * Returns
195      * PDC-5: "Generic Name" - creates it if necessary
196      */
197     public CE getPdc5_GenericName() { 
198 		CE retVal = this.getTypedField(5, 0);
199 		return retVal;
200     }
201 
202 
203     /**
204      * Returns all repetitions of Model Identifier (PDC-6).
205      */
206     public ST[] getModelIdentifier() {
207     	ST[] retVal = this.getTypedField(6, new ST[0]);
208     	return retVal;
209     }
210 
211 
212     /**
213      * Returns all repetitions of Model Identifier (PDC-6).
214      */
215     public ST[] getPdc6_ModelIdentifier() {
216     	ST[] retVal = this.getTypedField(6, new ST[0]);
217     	return retVal;
218     }
219 
220 
221     /**
222      * Returns a count of the current number of repetitions of Model Identifier (PDC-6).
223      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
224      * it will return zero.
225      */
226     public int getModelIdentifierReps() {
227     	return this.getReps(6);
228     }
229 
230 
231     /**
232      * Returns a specific repetition of
233      * PDC-6: "Model Identifier" - creates it if necessary
234      *
235      * @param rep The repetition index (0-indexed)
236      */
237     public ST getModelIdentifier(int rep) { 
238 		ST retVal = this.getTypedField(6, rep);
239 		return retVal;
240     }
241 
242     /**
243      * Returns a specific repetition of
244      * PDC-6: "Model Identifier" - creates it if necessary
245      *
246      * @param rep The repetition index (0-indexed)
247      */
248     public ST getPdc6_ModelIdentifier(int rep) { 
249 		ST retVal = this.getTypedField(6, rep);
250 		return retVal;
251     }
252 
253     /**
254      * Returns a count of the current number of repetitions of Model Identifier (PDC-6).
255      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
256      * it will return zero.
257      */
258     public int getPdc6_ModelIdentifierReps() {
259     	return this.getReps(6);
260     }
261 
262 
263     /**
264      * Inserts a repetition of
265      * PDC-6: "Model Identifier" at a specific index
266      *
267      * @param rep The repetition index (0-indexed)
268      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
269      */
270     public ST insertModelIdentifier(int rep) throws HL7Exception { 
271         return (ST) super.insertRepetition(6, rep);
272     }
273 
274 
275     /**
276      * Inserts a repetition of
277      * PDC-6: "Model Identifier" at a specific index
278      *
279      * @param rep The repetition index (0-indexed)
280      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
281      */
282     public ST insertPdc6_ModelIdentifier(int rep) throws HL7Exception { 
283         return (ST) super.insertRepetition(6, rep);
284     }
285 
286 
287     /**
288      * Removes a repetition of
289      * PDC-6: "Model Identifier" at a specific index
290      *
291      * @param rep The repetition index (0-indexed)
292      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
293      */
294     public ST removeModelIdentifier(int rep) throws HL7Exception { 
295         return (ST) super.removeRepetition(6, rep);
296     }
297 
298 
299     /**
300      * Removes a repetition of
301      * PDC-6: "Model Identifier" at a specific index
302      *
303      * @param rep The repetition index (0-indexed)
304      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
305      */
306     public ST removePdc6_ModelIdentifier(int rep) throws HL7Exception { 
307         return (ST) super.removeRepetition(6, rep);
308     }
309 
310 
311 
312 
313     /**
314      * Returns
315      * PDC-7: "Catalogue Identifier" - creates it if necessary
316      */
317     public ST getCatalogueIdentifier() { 
318 		ST retVal = this.getTypedField(7, 0);
319 		return retVal;
320     }
321     
322     /**
323      * Returns
324      * PDC-7: "Catalogue Identifier" - creates it if necessary
325      */
326     public ST getPdc7_CatalogueIdentifier() { 
327 		ST retVal = this.getTypedField(7, 0);
328 		return retVal;
329     }
330 
331 
332     /**
333      * Returns all repetitions of Other Identifier (PDC-8).
334      */
335     public ST[] getOtherIdentifier() {
336     	ST[] retVal = this.getTypedField(8, new ST[0]);
337     	return retVal;
338     }
339 
340 
341     /**
342      * Returns all repetitions of Other Identifier (PDC-8).
343      */
344     public ST[] getPdc8_OtherIdentifier() {
345     	ST[] retVal = this.getTypedField(8, new ST[0]);
346     	return retVal;
347     }
348 
349 
350     /**
351      * Returns a count of the current number of repetitions of Other Identifier (PDC-8).
352      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
353      * it will return zero.
354      */
355     public int getOtherIdentifierReps() {
356     	return this.getReps(8);
357     }
358 
359 
360     /**
361      * Returns a specific repetition of
362      * PDC-8: "Other Identifier" - creates it if necessary
363      *
364      * @param rep The repetition index (0-indexed)
365      */
366     public ST getOtherIdentifier(int rep) { 
367 		ST retVal = this.getTypedField(8, rep);
368 		return retVal;
369     }
370 
371     /**
372      * Returns a specific repetition of
373      * PDC-8: "Other Identifier" - creates it if necessary
374      *
375      * @param rep The repetition index (0-indexed)
376      */
377     public ST getPdc8_OtherIdentifier(int rep) { 
378 		ST retVal = this.getTypedField(8, rep);
379 		return retVal;
380     }
381 
382     /**
383      * Returns a count of the current number of repetitions of Other Identifier (PDC-8).
384      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
385      * it will return zero.
386      */
387     public int getPdc8_OtherIdentifierReps() {
388     	return this.getReps(8);
389     }
390 
391 
392     /**
393      * Inserts a repetition of
394      * PDC-8: "Other Identifier" at a specific index
395      *
396      * @param rep The repetition index (0-indexed)
397      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
398      */
399     public ST insertOtherIdentifier(int rep) throws HL7Exception { 
400         return (ST) super.insertRepetition(8, rep);
401     }
402 
403 
404     /**
405      * Inserts a repetition of
406      * PDC-8: "Other Identifier" at a specific index
407      *
408      * @param rep The repetition index (0-indexed)
409      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
410      */
411     public ST insertPdc8_OtherIdentifier(int rep) throws HL7Exception { 
412         return (ST) super.insertRepetition(8, rep);
413     }
414 
415 
416     /**
417      * Removes a repetition of
418      * PDC-8: "Other Identifier" at a specific index
419      *
420      * @param rep The repetition index (0-indexed)
421      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
422      */
423     public ST removeOtherIdentifier(int rep) throws HL7Exception { 
424         return (ST) super.removeRepetition(8, rep);
425     }
426 
427 
428     /**
429      * Removes a repetition of
430      * PDC-8: "Other Identifier" at a specific index
431      *
432      * @param rep The repetition index (0-indexed)
433      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
434      */
435     public ST removePdc8_OtherIdentifier(int rep) throws HL7Exception { 
436         return (ST) super.removeRepetition(8, rep);
437     }
438 
439 
440 
441 
442     /**
443      * Returns
444      * PDC-9: "Product Code" - creates it if necessary
445      */
446     public CE getProductCode() { 
447 		CE retVal = this.getTypedField(9, 0);
448 		return retVal;
449     }
450     
451     /**
452      * Returns
453      * PDC-9: "Product Code" - creates it if necessary
454      */
455     public CE getPdc9_ProductCode() { 
456 		CE retVal = this.getTypedField(9, 0);
457 		return retVal;
458     }
459 
460 
461 
462     /**
463      * Returns
464      * PDC-10: "Marketing Basis" - creates it if necessary
465      */
466     public ID getMarketingBasis() { 
467 		ID retVal = this.getTypedField(10, 0);
468 		return retVal;
469     }
470     
471     /**
472      * Returns
473      * PDC-10: "Marketing Basis" - creates it if necessary
474      */
475     public ID getPdc10_MarketingBasis() { 
476 		ID retVal = this.getTypedField(10, 0);
477 		return retVal;
478     }
479 
480 
481 
482     /**
483      * Returns
484      * PDC-11: "Marketing Approval Identifier" - creates it if necessary
485      */
486     public ST getMarketingApprovalIdentifier() { 
487 		ST retVal = this.getTypedField(11, 0);
488 		return retVal;
489     }
490     
491     /**
492      * Returns
493      * PDC-11: "Marketing Approval Identifier" - creates it if necessary
494      */
495     public ST getPdc11_MarketingApprovalIdentifier() { 
496 		ST retVal = this.getTypedField(11, 0);
497 		return retVal;
498     }
499 
500 
501 
502     /**
503      * Returns
504      * PDC-12: "Labeled Shelf Life" - creates it if necessary
505      */
506     public CQ getLabeledShelfLife() { 
507 		CQ retVal = this.getTypedField(12, 0);
508 		return retVal;
509     }
510     
511     /**
512      * Returns
513      * PDC-12: "Labeled Shelf Life" - creates it if necessary
514      */
515     public CQ getPdc12_LabeledShelfLife() { 
516 		CQ retVal = this.getTypedField(12, 0);
517 		return retVal;
518     }
519 
520 
521 
522     /**
523      * Returns
524      * PDC-13: "Expected Shelf Life" - creates it if necessary
525      */
526     public CQ getExpectedShelfLife() { 
527 		CQ retVal = this.getTypedField(13, 0);
528 		return retVal;
529     }
530     
531     /**
532      * Returns
533      * PDC-13: "Expected Shelf Life" - creates it if necessary
534      */
535     public CQ getPdc13_ExpectedShelfLife() { 
536 		CQ retVal = this.getTypedField(13, 0);
537 		return retVal;
538     }
539 
540 
541 
542     /**
543      * Returns
544      * PDC-14: "Date First Marked" - creates it if necessary
545      */
546     public TS getDateFirstMarked() { 
547 		TS retVal = this.getTypedField(14, 0);
548 		return retVal;
549     }
550     
551     /**
552      * Returns
553      * PDC-14: "Date First Marked" - creates it if necessary
554      */
555     public TS getPdc14_DateFirstMarked() { 
556 		TS retVal = this.getTypedField(14, 0);
557 		return retVal;
558     }
559 
560 
561 
562     /**
563      * Returns
564      * PDC-15: "Date Last Marked" - creates it if necessary
565      */
566     public TS getDateLastMarked() { 
567 		TS retVal = this.getTypedField(15, 0);
568 		return retVal;
569     }
570     
571     /**
572      * Returns
573      * PDC-15: "Date Last Marked" - creates it if necessary
574      */
575     public TS getPdc15_DateLastMarked() { 
576 		TS retVal = this.getTypedField(15, 0);
577 		return retVal;
578     }
579 
580 
581 
582 
583 
584     /** {@inheritDoc} */   
585     protected Type createNewTypeWithoutReflection(int field) {
586        switch (field) {
587           case 0: return new XON(getMessage());
588           case 1: return new CE(getMessage());
589           case 2: return new ST(getMessage());
590           case 3: return new ST(getMessage());
591           case 4: return new CE(getMessage());
592           case 5: return new ST(getMessage());
593           case 6: return new ST(getMessage());
594           case 7: return new ST(getMessage());
595           case 8: return new CE(getMessage());
596           case 9: return new ID(getMessage(), new Integer( 330 ));
597           case 10: return new ST(getMessage());
598           case 11: return new CQ(getMessage());
599           case 12: return new CQ(getMessage());
600           case 13: return new TS(getMessage());
601           case 14: return new TS(getMessage());
602           default: return null;
603        }
604    }
605 
606 
607 }
608