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