001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017package ca.uhn.fhir.model.dstu2.composite;
018
019import java.net.URI;
020import java.math.BigDecimal;
021import org.apache.commons.lang3.StringUtils;
022import java.util.*;
023import ca.uhn.fhir.model.api.*;
024import ca.uhn.fhir.model.primitive.*;
025import ca.uhn.fhir.model.api.annotation.*;
026import ca.uhn.fhir.model.base.composite.*;
027
028import ca.uhn.fhir.model.dstu2.valueset.AddressTypeEnum;
029import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum;
030import ca.uhn.fhir.model.dstu2.valueset.AggregationModeEnum;
031import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
032import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
033import ca.uhn.fhir.model.dstu2.composite.CodingDt;
034import ca.uhn.fhir.model.dstu2.valueset.ConstraintSeverityEnum;
035import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum;
036import ca.uhn.fhir.model.dstu2.valueset.ContactPointUseEnum;
037import ca.uhn.fhir.model.dstu2.resource.Device;
038import ca.uhn.fhir.model.dstu2.valueset.EventTimingEnum;
039import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
040import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
041import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum;
042import ca.uhn.fhir.model.dstu2.resource.Organization;
043import ca.uhn.fhir.model.dstu2.resource.Patient;
044import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
045import ca.uhn.fhir.model.dstu2.resource.Practitioner;
046import ca.uhn.fhir.model.dstu2.valueset.PropertyRepresentationEnum;
047import ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum;
048import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
049import ca.uhn.fhir.model.dstu2.composite.RangeDt;
050import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
051import ca.uhn.fhir.model.dstu2.valueset.SignatureTypeCodesEnum;
052import ca.uhn.fhir.model.dstu2.valueset.SlicingRulesEnum;
053import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
054import ca.uhn.fhir.model.dstu2.valueset.TimingAbbreviationEnum;
055import ca.uhn.fhir.model.dstu2.valueset.UnitsOfTimeEnum;
056import ca.uhn.fhir.model.dstu2.resource.ValueSet;
057import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
058import ca.uhn.fhir.model.dstu2.composite.DurationDt;
059import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
060import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
061import ca.uhn.fhir.model.primitive.Base64BinaryDt;
062import ca.uhn.fhir.model.primitive.BooleanDt;
063import ca.uhn.fhir.model.primitive.BoundCodeDt;
064import ca.uhn.fhir.model.primitive.CodeDt;
065import ca.uhn.fhir.model.primitive.DateTimeDt;
066import ca.uhn.fhir.model.primitive.DecimalDt;
067import ca.uhn.fhir.model.primitive.IdDt;
068import ca.uhn.fhir.model.primitive.InstantDt;
069import ca.uhn.fhir.model.primitive.IntegerDt;
070import ca.uhn.fhir.model.primitive.MarkdownDt;
071import ca.uhn.fhir.model.primitive.PositiveIntDt;
072import ca.uhn.fhir.model.primitive.StringDt;
073import ca.uhn.fhir.model.primitive.UnsignedIntDt;
074import ca.uhn.fhir.model.primitive.UriDt;
075
076/**
077 * HAPI/FHIR <b>TimingDt</b> Datatype
078 * ()
079 *
080 * <p>
081 * <b>Definition:</b>
082 * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds
083 * </p> 
084 *
085 * <p>
086 * <b>Requirements:</b>
087 * Need to able to track proposed timing schedules. There are several different ways to do this: one or more specified times, a simple rules like three times a day, or  before/after meals
088 * </p> 
089 */
090@DatatypeDef(name="TimingDt") 
091public class TimingDt
092        extends  BaseIdentifiableElement         implements ICompositeDatatype{
093
094        /**
095         * Constructor
096         */
097        public TimingDt() {
098                // nothing
099        }
100
101
102        @Child(name="event", type=DateTimeDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)      
103        @Description(
104                shortDefinition="",
105                formalDefinition="Identifies specific times when the event occurs"
106        )
107        private java.util.List<DateTimeDt> myEvent;
108        
109        @Child(name="repeat", order=1, min=0, max=1, summary=true, modifier=false)      
110        @Description(
111                shortDefinition="",
112                formalDefinition="A set of rules that describe when the event should occur"
113        )
114        private Repeat myRepeat;
115        
116        @Child(name="code", type=CodeableConceptDt.class, order=2, min=0, max=1, summary=true, modifier=false)  
117        @Description(
118                shortDefinition="",
119                formalDefinition="A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes"
120        )
121        private BoundCodeableConceptDt<TimingAbbreviationEnum> myCode;
122        
123
124        @Override
125        public boolean isEmpty() {
126                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myEvent,  myRepeat,  myCode);
127        }
128        
129        @Override
130        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
131                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEvent, myRepeat, myCode);
132        }
133
134        /**
135         * Gets the value(s) for <b>event</b> ().
136         * creating it if it does
137         * not exist. Will not return <code>null</code>.
138         *
139     * <p>
140     * <b>Definition:</b>
141     * Identifies specific times when the event occurs
142     * </p> 
143         */
144        public java.util.List<DateTimeDt> getEvent() {  
145                if (myEvent == null) {
146                        myEvent = new java.util.ArrayList<DateTimeDt>();
147                }
148                return myEvent;
149        }
150
151        /**
152         * Sets the value(s) for <b>event</b> ()
153         *
154     * <p>
155     * <b>Definition:</b>
156     * Identifies specific times when the event occurs
157     * </p> 
158         */
159        public TimingDt setEvent(java.util.List<DateTimeDt> theValue) {
160                myEvent = theValue;
161                return this;
162        }
163        
164        
165
166        /**
167         * Adds and returns a new value for <b>event</b> ()
168         *
169     * <p>
170     * <b>Definition:</b>
171     * Identifies specific times when the event occurs
172     * </p> 
173         */
174        public DateTimeDt addEvent() {
175                DateTimeDt newType = new DateTimeDt();
176                getEvent().add(newType);
177                return newType; 
178        }
179
180        /**
181         * Adds a given new value for <b>event</b> ()
182         *
183         * <p>
184         * <b>Definition:</b>
185         * Identifies specific times when the event occurs
186         * </p>
187         * @param theValue The event to add (must not be <code>null</code>)
188         */
189        public TimingDt addEvent(DateTimeDt theValue) {
190                if (theValue == null) {
191                        throw new NullPointerException("theValue must not be null");
192                }
193                getEvent().add(theValue);
194                return this;
195        }
196
197        /**
198         * Gets the first repetition for <b>event</b> (),
199         * creating it if it does not already exist.
200         *
201     * <p>
202     * <b>Definition:</b>
203     * Identifies specific times when the event occurs
204     * </p> 
205         */
206        public DateTimeDt getEventFirstRep() {
207                if (getEvent().isEmpty()) {
208                        return addEvent();
209                }
210                return getEvent().get(0); 
211        }
212        /**
213         * Adds a new value for <b>event</b> ()
214         *
215     * <p>
216     * <b>Definition:</b>
217     * Identifies specific times when the event occurs
218     * </p> 
219     *
220     * @return Returns a reference to this object, to allow for simple chaining.
221         */
222        public TimingDt addEvent( Date theDate,  TemporalPrecisionEnum thePrecision) {
223                if (myEvent == null) {
224                        myEvent = new java.util.ArrayList<DateTimeDt>();
225                }
226                myEvent.add(new DateTimeDt(theDate, thePrecision));
227                return this; 
228        }
229
230        /**
231         * Adds a new value for <b>event</b> ()
232         *
233     * <p>
234     * <b>Definition:</b>
235     * Identifies specific times when the event occurs
236     * </p> 
237     *
238     * @return Returns a reference to this object, to allow for simple chaining.
239         */
240        public TimingDt addEvent( Date theDate) {
241                if (myEvent == null) {
242                        myEvent = new java.util.ArrayList<DateTimeDt>();
243                }
244                myEvent.add(new DateTimeDt(theDate));
245                return this; 
246        }
247
248 
249        /**
250         * Gets the value(s) for <b>repeat</b> ().
251         * creating it if it does
252         * not exist. Will not return <code>null</code>.
253         *
254     * <p>
255     * <b>Definition:</b>
256     * A set of rules that describe when the event should occur
257     * </p> 
258         */
259        public Repeat getRepeat() {  
260                if (myRepeat == null) {
261                        myRepeat = new Repeat();
262                }
263                return myRepeat;
264        }
265
266        /**
267         * Sets the value(s) for <b>repeat</b> ()
268         *
269     * <p>
270     * <b>Definition:</b>
271     * A set of rules that describe when the event should occur
272     * </p> 
273         */
274        public TimingDt setRepeat(Repeat theValue) {
275                myRepeat = theValue;
276                return this;
277        }
278        
279        
280
281  
282        /**
283         * Gets the value(s) for <b>code</b> ().
284         * creating it if it does
285         * not exist. Will not return <code>null</code>.
286         *
287     * <p>
288     * <b>Definition:</b>
289     * A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes
290     * </p> 
291         */
292        public BoundCodeableConceptDt<TimingAbbreviationEnum> getCode() {  
293                if (myCode == null) {
294                        myCode = new BoundCodeableConceptDt<TimingAbbreviationEnum>(TimingAbbreviationEnum.VALUESET_BINDER);
295                }
296                return myCode;
297        }
298
299        /**
300         * Sets the value(s) for <b>code</b> ()
301         *
302     * <p>
303     * <b>Definition:</b>
304     * A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes
305     * </p> 
306         */
307        public TimingDt setCode(BoundCodeableConceptDt<TimingAbbreviationEnum> theValue) {
308                myCode = theValue;
309                return this;
310        }
311        
312        
313
314        /**
315         * Sets the value(s) for <b>code</b> ()
316         *
317     * <p>
318     * <b>Definition:</b>
319     * A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes
320     * </p> 
321         */
322        public TimingDt setCode(TimingAbbreviationEnum theValue) {
323                setCode(new BoundCodeableConceptDt<TimingAbbreviationEnum>(TimingAbbreviationEnum.VALUESET_BINDER, theValue));
324                
325/*
326                getCode().setValueAsEnum(theValue);
327*/
328                return this;
329        }
330
331  
332        /**
333         * Block class for child element: <b>Timing.repeat</b> ()
334         *
335     * <p>
336     * <b>Definition:</b>
337     * A set of rules that describe when the event should occur
338     * </p> 
339         */
340        @Block()        
341        public static class Repeat 
342            extends  BaseIdentifiableElement        implements IResourceBlock {
343        
344        @Child(name="bounds", order=0, min=0, max=1, summary=true, modifier=false, type={
345                DurationDt.class,               RangeDt.class,          PeriodDt.class  })
346        @Description(
347                shortDefinition="",
348                formalDefinition="Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule"
349        )
350        private IDatatype myBounds;
351        
352        @Child(name="count", type=IntegerDt.class, order=1, min=0, max=1, summary=true, modifier=false) 
353        @Description(
354                shortDefinition="",
355                formalDefinition="A total count of the desired number of repetitions"
356        )
357        private IntegerDt myCount;
358        
359        @Child(name="duration", type=DecimalDt.class, order=2, min=0, max=1, summary=true, modifier=false)      
360        @Description(
361                shortDefinition="",
362                formalDefinition="How long this thing happens for when it happens"
363        )
364        private DecimalDt myDuration;
365        
366        @Child(name="durationMax", type=DecimalDt.class, order=3, min=0, max=1, summary=true, modifier=false)   
367        @Description(
368                shortDefinition="",
369                formalDefinition="The upper limit of how long this thing happens for when it happens"
370        )
371        private DecimalDt myDurationMax;
372        
373        @Child(name="durationUnits", type=CodeDt.class, order=4, min=0, max=1, summary=true, modifier=false)    
374        @Description(
375                shortDefinition="",
376                formalDefinition="The units of time for the duration, in UCUM units"
377        )
378        private BoundCodeDt<UnitsOfTimeEnum> myDurationUnits;
379        
380        @Child(name="frequency", type=IntegerDt.class, order=5, min=0, max=1, summary=true, modifier=false)     
381        @Description(
382                shortDefinition="",
383                formalDefinition="The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)"
384        )
385        private IntegerDt myFrequency;
386        
387        @Child(name="frequencyMax", type=IntegerDt.class, order=6, min=0, max=1, summary=true, modifier=false)  
388        @Description(
389                shortDefinition="",
390                formalDefinition=""
391        )
392        private IntegerDt myFrequencyMax;
393        
394        @Child(name="period", type=DecimalDt.class, order=7, min=0, max=1, summary=true, modifier=false)        
395        @Description(
396                shortDefinition="",
397                formalDefinition="Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period"
398        )
399        private DecimalDt myPeriod;
400        
401        @Child(name="periodMax", type=DecimalDt.class, order=8, min=0, max=1, summary=true, modifier=false)     
402        @Description(
403                shortDefinition="",
404                formalDefinition="If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days"
405        )
406        private DecimalDt myPeriodMax;
407        
408        @Child(name="periodUnits", type=CodeDt.class, order=9, min=0, max=1, summary=true, modifier=false)      
409        @Description(
410                shortDefinition="",
411                formalDefinition="The units of time for the period in UCUM units"
412        )
413        private BoundCodeDt<UnitsOfTimeEnum> myPeriodUnits;
414        
415        @Child(name="when", type=CodeDt.class, order=10, min=0, max=1, summary=true, modifier=false)    
416        @Description(
417                shortDefinition="",
418                formalDefinition="A real world event that the occurrence of the event should be tied to."
419        )
420        private BoundCodeDt<EventTimingEnum> myWhen;
421        
422
423        @Override
424        public boolean isEmpty() {
425                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myBounds,  myCount,  myDuration,  myDurationMax,  myDurationUnits,  myFrequency,  myFrequencyMax,  myPeriod,  myPeriodMax,  myPeriodUnits,  myWhen);
426        }
427        
428        @Override
429        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
430                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myBounds, myCount, myDuration, myDurationMax, myDurationUnits, myFrequency, myFrequencyMax, myPeriod, myPeriodMax, myPeriodUnits, myWhen);
431        }
432
433        /**
434         * Gets the value(s) for <b>bounds[x]</b> ().
435         * creating it if it does
436         * not exist. Will not return <code>null</code>.
437         *
438     * <p>
439     * <b>Definition:</b>
440     * Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule
441     * </p> 
442         */
443        public IDatatype getBounds() {  
444                return myBounds;
445        }
446
447        /**
448         * Sets the value(s) for <b>bounds[x]</b> ()
449         *
450     * <p>
451     * <b>Definition:</b>
452     * Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule
453     * </p> 
454         */
455        public Repeat setBounds(IDatatype theValue) {
456                myBounds = theValue;
457                return this;
458        }
459        
460        
461
462  
463        /**
464         * Gets the value(s) for <b>count</b> ().
465         * creating it if it does
466         * not exist. Will not return <code>null</code>.
467         *
468     * <p>
469     * <b>Definition:</b>
470     * A total count of the desired number of repetitions
471     * </p> 
472         */
473        public IntegerDt getCountElement() {  
474                if (myCount == null) {
475                        myCount = new IntegerDt();
476                }
477                return myCount;
478        }
479
480        
481        /**
482         * Gets the value(s) for <b>count</b> ().
483         * creating it if it does
484         * not exist. Will not return <code>null</code>.
485         *
486     * <p>
487     * <b>Definition:</b>
488     * A total count of the desired number of repetitions
489     * </p> 
490         */
491        public Integer getCount() {  
492                return getCountElement().getValue();
493        }
494
495        /**
496         * Sets the value(s) for <b>count</b> ()
497         *
498     * <p>
499     * <b>Definition:</b>
500     * A total count of the desired number of repetitions
501     * </p> 
502         */
503        public Repeat setCount(IntegerDt theValue) {
504                myCount = theValue;
505                return this;
506        }
507        
508        
509
510        /**
511         * Sets the value for <b>count</b> ()
512         *
513     * <p>
514     * <b>Definition:</b>
515     * A total count of the desired number of repetitions
516     * </p> 
517         */
518        public Repeat setCount( int theInteger) {
519                myCount = new IntegerDt(theInteger); 
520                return this; 
521        }
522
523 
524        /**
525         * Gets the value(s) for <b>duration</b> ().
526         * creating it if it does
527         * not exist. Will not return <code>null</code>.
528         *
529     * <p>
530     * <b>Definition:</b>
531     * How long this thing happens for when it happens
532     * </p> 
533         */
534        public DecimalDt getDurationElement() {  
535                if (myDuration == null) {
536                        myDuration = new DecimalDt();
537                }
538                return myDuration;
539        }
540
541        
542        /**
543         * Gets the value(s) for <b>duration</b> ().
544         * creating it if it does
545         * not exist. Will not return <code>null</code>.
546         *
547     * <p>
548     * <b>Definition:</b>
549     * How long this thing happens for when it happens
550     * </p> 
551         */
552        public BigDecimal getDuration() {  
553                return getDurationElement().getValue();
554        }
555
556        /**
557         * Sets the value(s) for <b>duration</b> ()
558         *
559     * <p>
560     * <b>Definition:</b>
561     * How long this thing happens for when it happens
562     * </p> 
563         */
564        public Repeat setDuration(DecimalDt theValue) {
565                myDuration = theValue;
566                return this;
567        }
568        
569        
570
571        /**
572         * Sets the value for <b>duration</b> ()
573         *
574     * <p>
575     * <b>Definition:</b>
576     * How long this thing happens for when it happens
577     * </p> 
578         */
579        public Repeat setDuration( long theValue) {
580                myDuration = new DecimalDt(theValue); 
581                return this; 
582        }
583
584        /**
585         * Sets the value for <b>duration</b> ()
586         *
587     * <p>
588     * <b>Definition:</b>
589     * How long this thing happens for when it happens
590     * </p> 
591         */
592        public Repeat setDuration( double theValue) {
593                myDuration = new DecimalDt(theValue); 
594                return this; 
595        }
596
597        /**
598         * Sets the value for <b>duration</b> ()
599         *
600     * <p>
601     * <b>Definition:</b>
602     * How long this thing happens for when it happens
603     * </p> 
604         */
605        public Repeat setDuration( java.math.BigDecimal theValue) {
606                myDuration = new DecimalDt(theValue); 
607                return this; 
608        }
609
610 
611        /**
612         * Gets the value(s) for <b>durationMax</b> ().
613         * creating it if it does
614         * not exist. Will not return <code>null</code>.
615         *
616     * <p>
617     * <b>Definition:</b>
618     * The upper limit of how long this thing happens for when it happens
619     * </p> 
620         */
621        public DecimalDt getDurationMaxElement() {  
622                if (myDurationMax == null) {
623                        myDurationMax = new DecimalDt();
624                }
625                return myDurationMax;
626        }
627
628        
629        /**
630         * Gets the value(s) for <b>durationMax</b> ().
631         * creating it if it does
632         * not exist. Will not return <code>null</code>.
633         *
634     * <p>
635     * <b>Definition:</b>
636     * The upper limit of how long this thing happens for when it happens
637     * </p> 
638         */
639        public BigDecimal getDurationMax() {  
640                return getDurationMaxElement().getValue();
641        }
642
643        /**
644         * Sets the value(s) for <b>durationMax</b> ()
645         *
646     * <p>
647     * <b>Definition:</b>
648     * The upper limit of how long this thing happens for when it happens
649     * </p> 
650         */
651        public Repeat setDurationMax(DecimalDt theValue) {
652                myDurationMax = theValue;
653                return this;
654        }
655        
656        
657
658        /**
659         * Sets the value for <b>durationMax</b> ()
660         *
661     * <p>
662     * <b>Definition:</b>
663     * The upper limit of how long this thing happens for when it happens
664     * </p> 
665         */
666        public Repeat setDurationMax( long theValue) {
667                myDurationMax = new DecimalDt(theValue); 
668                return this; 
669        }
670
671        /**
672         * Sets the value for <b>durationMax</b> ()
673         *
674     * <p>
675     * <b>Definition:</b>
676     * The upper limit of how long this thing happens for when it happens
677     * </p> 
678         */
679        public Repeat setDurationMax( double theValue) {
680                myDurationMax = new DecimalDt(theValue); 
681                return this; 
682        }
683
684        /**
685         * Sets the value for <b>durationMax</b> ()
686         *
687     * <p>
688     * <b>Definition:</b>
689     * The upper limit of how long this thing happens for when it happens
690     * </p> 
691         */
692        public Repeat setDurationMax( java.math.BigDecimal theValue) {
693                myDurationMax = new DecimalDt(theValue); 
694                return this; 
695        }
696
697 
698        /**
699         * Gets the value(s) for <b>durationUnits</b> ().
700         * creating it if it does
701         * not exist. Will not return <code>null</code>.
702         *
703     * <p>
704     * <b>Definition:</b>
705     * The units of time for the duration, in UCUM units
706     * </p> 
707         */
708        public BoundCodeDt<UnitsOfTimeEnum> getDurationUnitsElement() {  
709                if (myDurationUnits == null) {
710                        myDurationUnits = new BoundCodeDt<UnitsOfTimeEnum>(UnitsOfTimeEnum.VALUESET_BINDER);
711                }
712                return myDurationUnits;
713        }
714
715        
716        /**
717         * Gets the value(s) for <b>durationUnits</b> ().
718         * creating it if it does
719         * not exist. Will not return <code>null</code>.
720         *
721     * <p>
722     * <b>Definition:</b>
723     * The units of time for the duration, in UCUM units
724     * </p> 
725         */
726        public String getDurationUnits() {  
727                return getDurationUnitsElement().getValue();
728        }
729
730        /**
731         * Sets the value(s) for <b>durationUnits</b> ()
732         *
733     * <p>
734     * <b>Definition:</b>
735     * The units of time for the duration, in UCUM units
736     * </p> 
737         */
738        public Repeat setDurationUnits(BoundCodeDt<UnitsOfTimeEnum> theValue) {
739                myDurationUnits = theValue;
740                return this;
741        }
742        
743        
744
745        /**
746         * Sets the value(s) for <b>durationUnits</b> ()
747         *
748     * <p>
749     * <b>Definition:</b>
750     * The units of time for the duration, in UCUM units
751     * </p> 
752         */
753        public Repeat setDurationUnits(UnitsOfTimeEnum theValue) {
754                setDurationUnits(new BoundCodeDt<UnitsOfTimeEnum>(UnitsOfTimeEnum.VALUESET_BINDER, theValue));
755                
756/*
757                getDurationUnitsElement().setValueAsEnum(theValue);
758*/
759                return this;
760        }
761
762  
763        /**
764         * Gets the value(s) for <b>frequency</b> ().
765         * creating it if it does
766         * not exist. Will not return <code>null</code>.
767         *
768     * <p>
769     * <b>Definition:</b>
770     * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)
771     * </p> 
772         */
773        public IntegerDt getFrequencyElement() {  
774                if (myFrequency == null) {
775                        myFrequency = new IntegerDt();
776                }
777                return myFrequency;
778        }
779
780        
781        /**
782         * Gets the value(s) for <b>frequency</b> ().
783         * creating it if it does
784         * not exist. Will not return <code>null</code>.
785         *
786     * <p>
787     * <b>Definition:</b>
788     * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)
789     * </p> 
790         */
791        public Integer getFrequency() {  
792                return getFrequencyElement().getValue();
793        }
794
795        /**
796         * Sets the value(s) for <b>frequency</b> ()
797         *
798     * <p>
799     * <b>Definition:</b>
800     * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)
801     * </p> 
802         */
803        public Repeat setFrequency(IntegerDt theValue) {
804                myFrequency = theValue;
805                return this;
806        }
807        
808        
809
810        /**
811         * Sets the value for <b>frequency</b> ()
812         *
813     * <p>
814     * <b>Definition:</b>
815     * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)
816     * </p> 
817         */
818        public Repeat setFrequency( int theInteger) {
819                myFrequency = new IntegerDt(theInteger); 
820                return this; 
821        }
822
823 
824        /**
825         * Gets the value(s) for <b>frequencyMax</b> ().
826         * creating it if it does
827         * not exist. Will not return <code>null</code>.
828         *
829     * <p>
830     * <b>Definition:</b>
831     * 
832     * </p> 
833         */
834        public IntegerDt getFrequencyMaxElement() {  
835                if (myFrequencyMax == null) {
836                        myFrequencyMax = new IntegerDt();
837                }
838                return myFrequencyMax;
839        }
840
841        
842        /**
843         * Gets the value(s) for <b>frequencyMax</b> ().
844         * creating it if it does
845         * not exist. Will not return <code>null</code>.
846         *
847     * <p>
848     * <b>Definition:</b>
849     * 
850     * </p> 
851         */
852        public Integer getFrequencyMax() {  
853                return getFrequencyMaxElement().getValue();
854        }
855
856        /**
857         * Sets the value(s) for <b>frequencyMax</b> ()
858         *
859     * <p>
860     * <b>Definition:</b>
861     * 
862     * </p> 
863         */
864        public Repeat setFrequencyMax(IntegerDt theValue) {
865                myFrequencyMax = theValue;
866                return this;
867        }
868        
869        
870
871        /**
872         * Sets the value for <b>frequencyMax</b> ()
873         *
874     * <p>
875     * <b>Definition:</b>
876     * 
877     * </p> 
878         */
879        public Repeat setFrequencyMax( int theInteger) {
880                myFrequencyMax = new IntegerDt(theInteger); 
881                return this; 
882        }
883
884 
885        /**
886         * Gets the value(s) for <b>period</b> ().
887         * creating it if it does
888         * not exist. Will not return <code>null</code>.
889         *
890     * <p>
891     * <b>Definition:</b>
892     * Indicates the duration of time over which repetitions are to occur; e.g. to express \&quot;3 times per day\&quot;, 3 would be the frequency and \&quot;1 day\&quot; would be the period
893     * </p> 
894         */
895        public DecimalDt getPeriodElement() {  
896                if (myPeriod == null) {
897                        myPeriod = new DecimalDt();
898                }
899                return myPeriod;
900        }
901
902        
903        /**
904         * Gets the value(s) for <b>period</b> ().
905         * creating it if it does
906         * not exist. Will not return <code>null</code>.
907         *
908     * <p>
909     * <b>Definition:</b>
910     * Indicates the duration of time over which repetitions are to occur; e.g. to express \&quot;3 times per day\&quot;, 3 would be the frequency and \&quot;1 day\&quot; would be the period
911     * </p> 
912         */
913        public BigDecimal getPeriod() {  
914                return getPeriodElement().getValue();
915        }
916
917        /**
918         * Sets the value(s) for <b>period</b> ()
919         *
920     * <p>
921     * <b>Definition:</b>
922     * Indicates the duration of time over which repetitions are to occur; e.g. to express \&quot;3 times per day\&quot;, 3 would be the frequency and \&quot;1 day\&quot; would be the period
923     * </p> 
924         */
925        public Repeat setPeriod(DecimalDt theValue) {
926                myPeriod = theValue;
927                return this;
928        }
929        
930        
931
932        /**
933         * Sets the value for <b>period</b> ()
934         *
935     * <p>
936     * <b>Definition:</b>
937     * Indicates the duration of time over which repetitions are to occur; e.g. to express \&quot;3 times per day\&quot;, 3 would be the frequency and \&quot;1 day\&quot; would be the period
938     * </p> 
939         */
940        public Repeat setPeriod( long theValue) {
941                myPeriod = new DecimalDt(theValue); 
942                return this; 
943        }
944
945        /**
946         * Sets the value for <b>period</b> ()
947         *
948     * <p>
949     * <b>Definition:</b>
950     * Indicates the duration of time over which repetitions are to occur; e.g. to express \&quot;3 times per day\&quot;, 3 would be the frequency and \&quot;1 day\&quot; would be the period
951     * </p> 
952         */
953        public Repeat setPeriod( double theValue) {
954                myPeriod = new DecimalDt(theValue); 
955                return this; 
956        }
957
958        /**
959         * Sets the value for <b>period</b> ()
960         *
961     * <p>
962     * <b>Definition:</b>
963     * Indicates the duration of time over which repetitions are to occur; e.g. to express \&quot;3 times per day\&quot;, 3 would be the frequency and \&quot;1 day\&quot; would be the period
964     * </p> 
965         */
966        public Repeat setPeriod( java.math.BigDecimal theValue) {
967                myPeriod = new DecimalDt(theValue); 
968                return this; 
969        }
970
971 
972        /**
973         * Gets the value(s) for <b>periodMax</b> ().
974         * creating it if it does
975         * not exist. Will not return <code>null</code>.
976         *
977     * <p>
978     * <b>Definition:</b>
979     * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \&quot;do this once every 3-5 days
980     * </p> 
981         */
982        public DecimalDt getPeriodMaxElement() {  
983                if (myPeriodMax == null) {
984                        myPeriodMax = new DecimalDt();
985                }
986                return myPeriodMax;
987        }
988
989        
990        /**
991         * Gets the value(s) for <b>periodMax</b> ().
992         * creating it if it does
993         * not exist. Will not return <code>null</code>.
994         *
995     * <p>
996     * <b>Definition:</b>
997     * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \&quot;do this once every 3-5 days
998     * </p> 
999         */
1000        public BigDecimal getPeriodMax() {  
1001                return getPeriodMaxElement().getValue();
1002        }
1003
1004        /**
1005         * Sets the value(s) for <b>periodMax</b> ()
1006         *
1007     * <p>
1008     * <b>Definition:</b>
1009     * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \&quot;do this once every 3-5 days
1010     * </p> 
1011         */
1012        public Repeat setPeriodMax(DecimalDt theValue) {
1013                myPeriodMax = theValue;
1014                return this;
1015        }
1016        
1017        
1018
1019        /**
1020         * Sets the value for <b>periodMax</b> ()
1021         *
1022     * <p>
1023     * <b>Definition:</b>
1024     * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \&quot;do this once every 3-5 days
1025     * </p> 
1026         */
1027        public Repeat setPeriodMax( long theValue) {
1028                myPeriodMax = new DecimalDt(theValue); 
1029                return this; 
1030        }
1031
1032        /**
1033         * Sets the value for <b>periodMax</b> ()
1034         *
1035     * <p>
1036     * <b>Definition:</b>
1037     * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \&quot;do this once every 3-5 days
1038     * </p> 
1039         */
1040        public Repeat setPeriodMax( double theValue) {
1041                myPeriodMax = new DecimalDt(theValue); 
1042                return this; 
1043        }
1044
1045        /**
1046         * Sets the value for <b>periodMax</b> ()
1047         *
1048     * <p>
1049     * <b>Definition:</b>
1050     * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \&quot;do this once every 3-5 days
1051     * </p> 
1052         */
1053        public Repeat setPeriodMax( java.math.BigDecimal theValue) {
1054                myPeriodMax = new DecimalDt(theValue); 
1055                return this; 
1056        }
1057
1058 
1059        /**
1060         * Gets the value(s) for <b>periodUnits</b> ().
1061         * creating it if it does
1062         * not exist. Will not return <code>null</code>.
1063         *
1064     * <p>
1065     * <b>Definition:</b>
1066     * The units of time for the period in UCUM units
1067     * </p> 
1068         */
1069        public BoundCodeDt<UnitsOfTimeEnum> getPeriodUnitsElement() {  
1070                if (myPeriodUnits == null) {
1071                        myPeriodUnits = new BoundCodeDt<UnitsOfTimeEnum>(UnitsOfTimeEnum.VALUESET_BINDER);
1072                }
1073                return myPeriodUnits;
1074        }
1075
1076        
1077        /**
1078         * Gets the value(s) for <b>periodUnits</b> ().
1079         * creating it if it does
1080         * not exist. Will not return <code>null</code>.
1081         *
1082     * <p>
1083     * <b>Definition:</b>
1084     * The units of time for the period in UCUM units
1085     * </p> 
1086         */
1087        public String getPeriodUnits() {  
1088                return getPeriodUnitsElement().getValue();
1089        }
1090
1091        /**
1092         * Sets the value(s) for <b>periodUnits</b> ()
1093         *
1094     * <p>
1095     * <b>Definition:</b>
1096     * The units of time for the period in UCUM units
1097     * </p> 
1098         */
1099        public Repeat setPeriodUnits(BoundCodeDt<UnitsOfTimeEnum> theValue) {
1100                myPeriodUnits = theValue;
1101                return this;
1102        }
1103        
1104        
1105
1106        /**
1107         * Sets the value(s) for <b>periodUnits</b> ()
1108         *
1109     * <p>
1110     * <b>Definition:</b>
1111     * The units of time for the period in UCUM units
1112     * </p> 
1113         */
1114        public Repeat setPeriodUnits(UnitsOfTimeEnum theValue) {
1115                setPeriodUnits(new BoundCodeDt<UnitsOfTimeEnum>(UnitsOfTimeEnum.VALUESET_BINDER, theValue));
1116                
1117/*
1118                getPeriodUnitsElement().setValueAsEnum(theValue);
1119*/
1120                return this;
1121        }
1122
1123  
1124        /**
1125         * Gets the value(s) for <b>when</b> ().
1126         * creating it if it does
1127         * not exist. Will not return <code>null</code>.
1128         *
1129     * <p>
1130     * <b>Definition:</b>
1131     * A real world event that the occurrence of the event should be tied to.
1132     * </p> 
1133         */
1134        public BoundCodeDt<EventTimingEnum> getWhenElement() {  
1135                if (myWhen == null) {
1136                        myWhen = new BoundCodeDt<EventTimingEnum>(EventTimingEnum.VALUESET_BINDER);
1137                }
1138                return myWhen;
1139        }
1140
1141        
1142        /**
1143         * Gets the value(s) for <b>when</b> ().
1144         * creating it if it does
1145         * not exist. Will not return <code>null</code>.
1146         *
1147     * <p>
1148     * <b>Definition:</b>
1149     * A real world event that the occurrence of the event should be tied to.
1150     * </p> 
1151         */
1152        public String getWhen() {  
1153                return getWhenElement().getValue();
1154        }
1155
1156        /**
1157         * Sets the value(s) for <b>when</b> ()
1158         *
1159     * <p>
1160     * <b>Definition:</b>
1161     * A real world event that the occurrence of the event should be tied to.
1162     * </p> 
1163         */
1164        public Repeat setWhen(BoundCodeDt<EventTimingEnum> theValue) {
1165                myWhen = theValue;
1166                return this;
1167        }
1168        
1169        
1170
1171        /**
1172         * Sets the value(s) for <b>when</b> ()
1173         *
1174     * <p>
1175     * <b>Definition:</b>
1176     * A real world event that the occurrence of the event should be tied to.
1177     * </p> 
1178         */
1179        public Repeat setWhen(EventTimingEnum theValue) {
1180                setWhen(new BoundCodeDt<EventTimingEnum>(EventTimingEnum.VALUESET_BINDER, theValue));
1181                
1182/*
1183                getWhenElement().setValueAsEnum(theValue);
1184*/
1185                return this;
1186        }
1187
1188  
1189
1190
1191        }
1192
1193
1194
1195
1196}