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