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>AnnotationDt</b> Datatype
078 * ()
079 *
080 * <p>
081 * <b>Definition:</b>
082 * A  text note which also  contains information about who made the statement and when
083 * </p> 
084 *
085 * <p>
086 * <b>Requirements:</b>
087 * 
088 * </p> 
089 */
090@DatatypeDef(name="Annotation") 
091public class AnnotationDt
092        extends  BaseIdentifiableElement         implements ICompositeDatatype{
093
094        /**
095         * Constructor
096         */
097        public AnnotationDt() {
098                // nothing
099        }
100
101
102        @Child(name="author", order=0, min=0, max=1, summary=true, modifier=false, type={
103                Practitioner.class,             Patient.class,          RelatedPerson.class,            StringDt.class  })
104        @Description(
105                shortDefinition="",
106                formalDefinition="The individual responsible for making the annotation."
107        )
108        private IDatatype myAuthor;
109        
110        @Child(name="time", type=DateTimeDt.class, order=1, min=0, max=1, summary=true, modifier=false) 
111        @Description(
112                shortDefinition="",
113                formalDefinition="Indicates when this particular annotation was made"
114        )
115        private DateTimeDt myTime;
116        
117        @Child(name="text", type=StringDt.class, order=2, min=1, max=1, summary=true, modifier=false)   
118        @Description(
119                shortDefinition="",
120                formalDefinition="The text of the annotation"
121        )
122        private StringDt myText;
123        
124
125        @Override
126        public boolean isEmpty() {
127                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myAuthor,  myTime,  myText);
128        }
129        
130        @Override
131        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
132                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myAuthor, myTime, myText);
133        }
134
135        /**
136         * Gets the value(s) for <b>author[x]</b> ().
137         * creating it if it does
138         * not exist. Will not return <code>null</code>.
139         *
140     * <p>
141     * <b>Definition:</b>
142     * The individual responsible for making the annotation.
143     * </p> 
144         */
145        public IDatatype getAuthor() {  
146                return myAuthor;
147        }
148
149        /**
150         * Sets the value(s) for <b>author[x]</b> ()
151         *
152     * <p>
153     * <b>Definition:</b>
154     * The individual responsible for making the annotation.
155     * </p> 
156         */
157        public AnnotationDt setAuthor(IDatatype theValue) {
158                myAuthor = theValue;
159                return this;
160        }
161        
162        
163
164  
165        /**
166         * Gets the value(s) for <b>time</b> ().
167         * creating it if it does
168         * not exist. Will not return <code>null</code>.
169         *
170     * <p>
171     * <b>Definition:</b>
172     * Indicates when this particular annotation was made
173     * </p> 
174         */
175        public DateTimeDt getTimeElement() {  
176                if (myTime == null) {
177                        myTime = new DateTimeDt();
178                }
179                return myTime;
180        }
181
182        
183        /**
184         * Gets the value(s) for <b>time</b> ().
185         * creating it if it does
186         * not exist. This method may return <code>null</code>.
187         *
188     * <p>
189     * <b>Definition:</b>
190     * Indicates when this particular annotation was made
191     * </p> 
192         */
193        public Date getTime() {  
194                return getTimeElement().getValue();
195        }
196
197        /**
198         * Sets the value(s) for <b>time</b> ()
199         *
200     * <p>
201     * <b>Definition:</b>
202     * Indicates when this particular annotation was made
203     * </p> 
204         */
205        public AnnotationDt setTime(DateTimeDt theValue) {
206                myTime = theValue;
207                return this;
208        }
209        
210        
211
212        /**
213         * Sets the value for <b>time</b> ()
214         *
215     * <p>
216     * <b>Definition:</b>
217     * Indicates when this particular annotation was made
218     * </p> 
219         */
220        public AnnotationDt setTime( Date theDate,  TemporalPrecisionEnum thePrecision) {
221                myTime = new DateTimeDt(theDate, thePrecision); 
222                return this; 
223        }
224
225        /**
226         * Sets the value for <b>time</b> ()
227         *
228     * <p>
229     * <b>Definition:</b>
230     * Indicates when this particular annotation was made
231     * </p> 
232         */
233        public AnnotationDt setTimeWithSecondsPrecision( Date theDate) {
234                myTime = new DateTimeDt(theDate); 
235                return this; 
236        }
237
238 
239        /**
240         * Gets the value(s) for <b>text</b> ().
241         * creating it if it does
242         * not exist. Will not return <code>null</code>.
243         *
244     * <p>
245     * <b>Definition:</b>
246     * The text of the annotation
247     * </p> 
248         */
249        public StringDt getTextElement() {  
250                if (myText == null) {
251                        myText = new StringDt();
252                }
253                return myText;
254        }
255
256        
257        /**
258         * Gets the value(s) for <b>text</b> ().
259         * creating it if it does
260         * not exist. This method may return <code>null</code>.
261         *
262     * <p>
263     * <b>Definition:</b>
264     * The text of the annotation
265     * </p> 
266         */
267        public String getText() {  
268                return getTextElement().getValue();
269        }
270
271        /**
272         * Sets the value(s) for <b>text</b> ()
273         *
274     * <p>
275     * <b>Definition:</b>
276     * The text of the annotation
277     * </p> 
278         */
279        public AnnotationDt setText(StringDt theValue) {
280                myText = theValue;
281                return this;
282        }
283        
284        
285
286        /**
287         * Sets the value for <b>text</b> ()
288         *
289     * <p>
290     * <b>Definition:</b>
291     * The text of the annotation
292     * </p> 
293         */
294        public AnnotationDt setText( String theString) {
295                myText = new StringDt(theString); 
296                return this; 
297        }
298
299 
300
301
302}