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 LDP message segment (Location Department). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>LDP-1: LDP Primary Key Value (PL) <b> </b>
052     * <li>LDP-2: Location Department (IS) <b> </b>
053     * <li>LDP-3: Location Service (IS) <b>optional repeating</b>
054     * <li>LDP-4: Speciality Type (CE) <b>optional repeating</b>
055     * <li>LDP-5: Valid Patient Classes (ID) <b>optional repeating</b>
056     * <li>LDP-6: Active/Inactive Flag (ID) <b>optional </b>
057     * <li>LDP-7: Activation Date (TS) <b>optional </b>
058     * <li>LDP-8: Inactivation Date - LDP (TS) <b>optional </b>
059     * <li>LDP-9: Inactivated Reason (ST) <b>optional </b>
060     * <li>LDP-10: Visiting Hours (VH) <b>optional repeating</b>
061     * <li>LDP-11: Contact Phone (XTN) <b>optional </b>
062 * </ul>
063 */
064@SuppressWarnings("unused")
065public class LDP extends AbstractSegment {
066
067    /** 
068     * Creates a new LDP segment
069     */
070    public LDP(Group parent, ModelClassFactory factory) {
071       super(parent, factory);
072       init(factory);
073    }
074
075    private void init(ModelClassFactory factory) {
076       try {
077                                  this.add(PL.class, true, 1, 20, new Object[]{ getMessage() }, "LDP Primary Key Value");
078                                              this.add(IS.class, true, 1, 10, new Object[]{ getMessage(), new Integer(264) }, "Location Department");
079                                              this.add(IS.class, false, 0, 3, new Object[]{ getMessage(), new Integer(69) }, "Location Service");
080                                  this.add(CE.class, false, 0, 60, new Object[]{ getMessage() }, "Speciality Type");
081                                              this.add(ID.class, false, 0, 1, new Object[]{ getMessage(), new Integer(4) }, "Valid Patient Classes");
082                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(183) }, "Active/Inactive Flag");
083                                  this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "Activation Date");
084                                  this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "Inactivation Date - LDP");
085                                  this.add(ST.class, false, 1, 80, new Object[]{ getMessage() }, "Inactivated Reason");
086                                  this.add(VH.class, false, 0, 80, new Object[]{ getMessage() }, "Visiting Hours");
087                                  this.add(XTN.class, false, 1, 40, new Object[]{ getMessage() }, "Contact Phone");
088       } catch(HL7Exception e) {
089          log.error("Unexpected error creating LDP - this is probably a bug in the source code generator.", e);
090       }
091    }
092
093
094
095    /**
096     * Returns
097     * LDP-1: "LDP Primary Key Value" - creates it if necessary
098     */
099    public PL getLDPPrimaryKeyValue() { 
100                PL retVal = this.getTypedField(1, 0);
101                return retVal;
102    }
103    
104    /**
105     * Returns
106     * LDP-1: "LDP Primary Key Value" - creates it if necessary
107     */
108    public PL getLdp1_LDPPrimaryKeyValue() { 
109                PL retVal = this.getTypedField(1, 0);
110                return retVal;
111    }
112
113
114
115    /**
116     * Returns
117     * LDP-2: "Location Department" - creates it if necessary
118     */
119    public IS getLocationDepartment() { 
120                IS retVal = this.getTypedField(2, 0);
121                return retVal;
122    }
123    
124    /**
125     * Returns
126     * LDP-2: "Location Department" - creates it if necessary
127     */
128    public IS getLdp2_LocationDepartment() { 
129                IS retVal = this.getTypedField(2, 0);
130                return retVal;
131    }
132
133
134    /**
135     * Returns all repetitions of Location Service (LDP-3).
136     */
137    public IS[] getLocationService() {
138        IS[] retVal = this.getTypedField(3, new IS[0]);
139        return retVal;
140    }
141
142
143    /**
144     * Returns all repetitions of Location Service (LDP-3).
145     */
146    public IS[] getLdp3_LocationService() {
147        IS[] retVal = this.getTypedField(3, new IS[0]);
148        return retVal;
149    }
150
151
152    /**
153     * Returns a count of the current number of repetitions of Location Service (LDP-3).
154     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
155     * it will return zero.
156     */
157    public int getLocationServiceReps() {
158        return this.getReps(3);
159    }
160
161
162    /**
163     * Returns a specific repetition of
164     * LDP-3: "Location Service" - creates it if necessary
165     *
166     * @param rep The repetition index (0-indexed)
167     */
168    public IS getLocationService(int rep) { 
169                IS retVal = this.getTypedField(3, rep);
170                return retVal;
171    }
172
173    /**
174     * Returns a specific repetition of
175     * LDP-3: "Location Service" - creates it if necessary
176     *
177     * @param rep The repetition index (0-indexed)
178     */
179    public IS getLdp3_LocationService(int rep) { 
180                IS retVal = this.getTypedField(3, rep);
181                return retVal;
182    }
183
184    /**
185     * Returns a count of the current number of repetitions of Location Service (LDP-3).
186     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
187     * it will return zero.
188     */
189    public int getLdp3_LocationServiceReps() {
190        return this.getReps(3);
191    }
192
193
194    /**
195     * Inserts a repetition of
196     * LDP-3: "Location Service" at a specific index
197     *
198     * @param rep The repetition index (0-indexed)
199     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
200     */
201    public IS insertLocationService(int rep) throws HL7Exception { 
202        return (IS) super.insertRepetition(3, rep);
203    }
204
205
206    /**
207     * Inserts a repetition of
208     * LDP-3: "Location Service" at a specific index
209     *
210     * @param rep The repetition index (0-indexed)
211     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
212     */
213    public IS insertLdp3_LocationService(int rep) throws HL7Exception { 
214        return (IS) super.insertRepetition(3, rep);
215    }
216
217
218    /**
219     * Removes a repetition of
220     * LDP-3: "Location Service" at a specific index
221     *
222     * @param rep The repetition index (0-indexed)
223     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
224     */
225    public IS removeLocationService(int rep) throws HL7Exception { 
226        return (IS) super.removeRepetition(3, rep);
227    }
228
229
230    /**
231     * Removes a repetition of
232     * LDP-3: "Location Service" at a specific index
233     *
234     * @param rep The repetition index (0-indexed)
235     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
236     */
237    public IS removeLdp3_LocationService(int rep) throws HL7Exception { 
238        return (IS) super.removeRepetition(3, rep);
239    }
240
241
242
243    /**
244     * Returns all repetitions of Speciality Type (LDP-4).
245     */
246    public CE[] getSpecialityType() {
247        CE[] retVal = this.getTypedField(4, new CE[0]);
248        return retVal;
249    }
250
251
252    /**
253     * Returns all repetitions of Speciality Type (LDP-4).
254     */
255    public CE[] getLdp4_SpecialityType() {
256        CE[] retVal = this.getTypedField(4, new CE[0]);
257        return retVal;
258    }
259
260
261    /**
262     * Returns a count of the current number of repetitions of Speciality Type (LDP-4).
263     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
264     * it will return zero.
265     */
266    public int getSpecialityTypeReps() {
267        return this.getReps(4);
268    }
269
270
271    /**
272     * Returns a specific repetition of
273     * LDP-4: "Speciality Type" - creates it if necessary
274     *
275     * @param rep The repetition index (0-indexed)
276     */
277    public CE getSpecialityType(int rep) { 
278                CE retVal = this.getTypedField(4, rep);
279                return retVal;
280    }
281
282    /**
283     * Returns a specific repetition of
284     * LDP-4: "Speciality Type" - creates it if necessary
285     *
286     * @param rep The repetition index (0-indexed)
287     */
288    public CE getLdp4_SpecialityType(int rep) { 
289                CE retVal = this.getTypedField(4, rep);
290                return retVal;
291    }
292
293    /**
294     * Returns a count of the current number of repetitions of Speciality Type (LDP-4).
295     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
296     * it will return zero.
297     */
298    public int getLdp4_SpecialityTypeReps() {
299        return this.getReps(4);
300    }
301
302
303    /**
304     * Inserts a repetition of
305     * LDP-4: "Speciality Type" at a specific index
306     *
307     * @param rep The repetition index (0-indexed)
308     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
309     */
310    public CE insertSpecialityType(int rep) throws HL7Exception { 
311        return (CE) super.insertRepetition(4, rep);
312    }
313
314
315    /**
316     * Inserts a repetition of
317     * LDP-4: "Speciality Type" at a specific index
318     *
319     * @param rep The repetition index (0-indexed)
320     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
321     */
322    public CE insertLdp4_SpecialityType(int rep) throws HL7Exception { 
323        return (CE) super.insertRepetition(4, rep);
324    }
325
326
327    /**
328     * Removes a repetition of
329     * LDP-4: "Speciality Type" at a specific index
330     *
331     * @param rep The repetition index (0-indexed)
332     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
333     */
334    public CE removeSpecialityType(int rep) throws HL7Exception { 
335        return (CE) super.removeRepetition(4, rep);
336    }
337
338
339    /**
340     * Removes a repetition of
341     * LDP-4: "Speciality Type" at a specific index
342     *
343     * @param rep The repetition index (0-indexed)
344     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
345     */
346    public CE removeLdp4_SpecialityType(int rep) throws HL7Exception { 
347        return (CE) super.removeRepetition(4, rep);
348    }
349
350
351
352    /**
353     * Returns all repetitions of Valid Patient Classes (LDP-5).
354     */
355    public ID[] getValidPatientClasses() {
356        ID[] retVal = this.getTypedField(5, new ID[0]);
357        return retVal;
358    }
359
360
361    /**
362     * Returns all repetitions of Valid Patient Classes (LDP-5).
363     */
364    public ID[] getLdp5_ValidPatientClasses() {
365        ID[] retVal = this.getTypedField(5, new ID[0]);
366        return retVal;
367    }
368
369
370    /**
371     * Returns a count of the current number of repetitions of Valid Patient Classes (LDP-5).
372     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
373     * it will return zero.
374     */
375    public int getValidPatientClassesReps() {
376        return this.getReps(5);
377    }
378
379
380    /**
381     * Returns a specific repetition of
382     * LDP-5: "Valid Patient Classes" - creates it if necessary
383     *
384     * @param rep The repetition index (0-indexed)
385     */
386    public ID getValidPatientClasses(int rep) { 
387                ID retVal = this.getTypedField(5, rep);
388                return retVal;
389    }
390
391    /**
392     * Returns a specific repetition of
393     * LDP-5: "Valid Patient Classes" - creates it if necessary
394     *
395     * @param rep The repetition index (0-indexed)
396     */
397    public ID getLdp5_ValidPatientClasses(int rep) { 
398                ID retVal = this.getTypedField(5, rep);
399                return retVal;
400    }
401
402    /**
403     * Returns a count of the current number of repetitions of Valid Patient Classes (LDP-5).
404     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
405     * it will return zero.
406     */
407    public int getLdp5_ValidPatientClassesReps() {
408        return this.getReps(5);
409    }
410
411
412    /**
413     * Inserts a repetition of
414     * LDP-5: "Valid Patient Classes" 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 ID insertValidPatientClasses(int rep) throws HL7Exception { 
420        return (ID) super.insertRepetition(5, rep);
421    }
422
423
424    /**
425     * Inserts a repetition of
426     * LDP-5: "Valid Patient Classes" 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 ID insertLdp5_ValidPatientClasses(int rep) throws HL7Exception { 
432        return (ID) super.insertRepetition(5, rep);
433    }
434
435
436    /**
437     * Removes a repetition of
438     * LDP-5: "Valid Patient Classes" 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 ID removeValidPatientClasses(int rep) throws HL7Exception { 
444        return (ID) super.removeRepetition(5, rep);
445    }
446
447
448    /**
449     * Removes a repetition of
450     * LDP-5: "Valid Patient Classes" at a specific index
451     *
452     * @param rep The repetition index (0-indexed)
453     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
454     */
455    public ID removeLdp5_ValidPatientClasses(int rep) throws HL7Exception { 
456        return (ID) super.removeRepetition(5, rep);
457    }
458
459
460
461
462    /**
463     * Returns
464     * LDP-6: "Active/Inactive Flag" - creates it if necessary
465     */
466    public ID getActiveInactiveFlag() { 
467                ID retVal = this.getTypedField(6, 0);
468                return retVal;
469    }
470    
471    /**
472     * Returns
473     * LDP-6: "Active/Inactive Flag" - creates it if necessary
474     */
475    public ID getLdp6_ActiveInactiveFlag() { 
476                ID retVal = this.getTypedField(6, 0);
477                return retVal;
478    }
479
480
481
482    /**
483     * Returns
484     * LDP-7: "Activation Date" - creates it if necessary
485     */
486    public TS getActivationDate() { 
487                TS retVal = this.getTypedField(7, 0);
488                return retVal;
489    }
490    
491    /**
492     * Returns
493     * LDP-7: "Activation Date" - creates it if necessary
494     */
495    public TS getLdp7_ActivationDate() { 
496                TS retVal = this.getTypedField(7, 0);
497                return retVal;
498    }
499
500
501
502    /**
503     * Returns
504     * LDP-8: "Inactivation Date - LDP" - creates it if necessary
505     */
506    public TS getInactivationDateLDP() { 
507                TS retVal = this.getTypedField(8, 0);
508                return retVal;
509    }
510    
511    /**
512     * Returns
513     * LDP-8: "Inactivation Date - LDP" - creates it if necessary
514     */
515    public TS getLdp8_InactivationDateLDP() { 
516                TS retVal = this.getTypedField(8, 0);
517                return retVal;
518    }
519
520
521
522    /**
523     * Returns
524     * LDP-9: "Inactivated Reason" - creates it if necessary
525     */
526    public ST getInactivatedReason() { 
527                ST retVal = this.getTypedField(9, 0);
528                return retVal;
529    }
530    
531    /**
532     * Returns
533     * LDP-9: "Inactivated Reason" - creates it if necessary
534     */
535    public ST getLdp9_InactivatedReason() { 
536                ST retVal = this.getTypedField(9, 0);
537                return retVal;
538    }
539
540
541    /**
542     * Returns all repetitions of Visiting Hours (LDP-10).
543     */
544    public VH[] getVisitingHours() {
545        VH[] retVal = this.getTypedField(10, new VH[0]);
546        return retVal;
547    }
548
549
550    /**
551     * Returns all repetitions of Visiting Hours (LDP-10).
552     */
553    public VH[] getLdp10_VisitingHours() {
554        VH[] retVal = this.getTypedField(10, new VH[0]);
555        return retVal;
556    }
557
558
559    /**
560     * Returns a count of the current number of repetitions of Visiting Hours (LDP-10).
561     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
562     * it will return zero.
563     */
564    public int getVisitingHoursReps() {
565        return this.getReps(10);
566    }
567
568
569    /**
570     * Returns a specific repetition of
571     * LDP-10: "Visiting Hours" - creates it if necessary
572     *
573     * @param rep The repetition index (0-indexed)
574     */
575    public VH getVisitingHours(int rep) { 
576                VH retVal = this.getTypedField(10, rep);
577                return retVal;
578    }
579
580    /**
581     * Returns a specific repetition of
582     * LDP-10: "Visiting Hours" - creates it if necessary
583     *
584     * @param rep The repetition index (0-indexed)
585     */
586    public VH getLdp10_VisitingHours(int rep) { 
587                VH retVal = this.getTypedField(10, rep);
588                return retVal;
589    }
590
591    /**
592     * Returns a count of the current number of repetitions of Visiting Hours (LDP-10).
593     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
594     * it will return zero.
595     */
596    public int getLdp10_VisitingHoursReps() {
597        return this.getReps(10);
598    }
599
600
601    /**
602     * Inserts a repetition of
603     * LDP-10: "Visiting Hours" at a specific index
604     *
605     * @param rep The repetition index (0-indexed)
606     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
607     */
608    public VH insertVisitingHours(int rep) throws HL7Exception { 
609        return (VH) super.insertRepetition(10, rep);
610    }
611
612
613    /**
614     * Inserts a repetition of
615     * LDP-10: "Visiting Hours" at a specific index
616     *
617     * @param rep The repetition index (0-indexed)
618     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
619     */
620    public VH insertLdp10_VisitingHours(int rep) throws HL7Exception { 
621        return (VH) super.insertRepetition(10, rep);
622    }
623
624
625    /**
626     * Removes a repetition of
627     * LDP-10: "Visiting Hours" at a specific index
628     *
629     * @param rep The repetition index (0-indexed)
630     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
631     */
632    public VH removeVisitingHours(int rep) throws HL7Exception { 
633        return (VH) super.removeRepetition(10, rep);
634    }
635
636
637    /**
638     * Removes a repetition of
639     * LDP-10: "Visiting Hours" at a specific index
640     *
641     * @param rep The repetition index (0-indexed)
642     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
643     */
644    public VH removeLdp10_VisitingHours(int rep) throws HL7Exception { 
645        return (VH) super.removeRepetition(10, rep);
646    }
647
648
649
650
651    /**
652     * Returns
653     * LDP-11: "Contact Phone" - creates it if necessary
654     */
655    public XTN getContactPhone() { 
656                XTN retVal = this.getTypedField(11, 0);
657                return retVal;
658    }
659    
660    /**
661     * Returns
662     * LDP-11: "Contact Phone" - creates it if necessary
663     */
664    public XTN getLdp11_ContactPhone() { 
665                XTN retVal = this.getTypedField(11, 0);
666                return retVal;
667    }
668
669
670
671
672
673    /** {@inheritDoc} */   
674    protected Type createNewTypeWithoutReflection(int field) {
675       switch (field) {
676          case 0: return new PL(getMessage());
677          case 1: return new IS(getMessage(), new Integer( 264 ));
678          case 2: return new IS(getMessage(), new Integer( 69 ));
679          case 3: return new CE(getMessage());
680          case 4: return new ID(getMessage(), new Integer( 4 ));
681          case 5: return new ID(getMessage(), new Integer( 183 ));
682          case 6: return new TS(getMessage());
683          case 7: return new TS(getMessage());
684          case 8: return new ST(getMessage());
685          case 9: return new VH(getMessage());
686          case 10: return new XTN(getMessage());
687          default: return null;
688       }
689   }
690
691
692}
693