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>ContactPointDt</b> Datatype
078 * ()
079 *
080 * <p>
081 * <b>Definition:</b>
082 * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
083 * </p> 
084 *
085 * <p>
086 * <b>Requirements:</b>
087 * Need to track phone, fax, mobile, sms numbers, email addresses, twitter tags, etc.
088 * </p> 
089 */
090@DatatypeDef(name="ContactPointDt") 
091public class ContactPointDt
092        extends  BaseIdentifiableElement         implements ICompositeDatatype{
093
094        /**
095         * Constructor
096         */
097        public ContactPointDt() {
098                // nothing
099        }
100
101
102        @Child(name="system", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=false)   
103        @Description(
104                shortDefinition="",
105                formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact"
106        )
107        private BoundCodeDt<ContactPointSystemEnum> mySystem;
108        
109        @Child(name="value", type=StringDt.class, order=1, min=0, max=1, summary=true, modifier=false)  
110        @Description(
111                shortDefinition="",
112                formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)."
113        )
114        private StringDt myValue;
115        
116        @Child(name="use", type=CodeDt.class, order=2, min=0, max=1, summary=true, modifier=true)       
117        @Description(
118                shortDefinition="",
119                formalDefinition="Identifies the purpose for the contact point"
120        )
121        private BoundCodeDt<ContactPointUseEnum> myUse;
122        
123        @Child(name="rank", type=PositiveIntDt.class, order=3, min=0, max=1, summary=true, modifier=false)      
124        @Description(
125                shortDefinition="",
126                formalDefinition="Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values"
127        )
128        private PositiveIntDt myRank;
129        
130        @Child(name="period", type=PeriodDt.class, order=4, min=0, max=1, summary=true, modifier=false) 
131        @Description(
132                shortDefinition="",
133                formalDefinition="Time period when the contact point was/is in use"
134        )
135        private PeriodDt myPeriod;
136        
137
138        @Override
139        public boolean isEmpty() {
140                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  mySystem,  myValue,  myUse,  myRank,  myPeriod);
141        }
142        
143        @Override
144        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
145                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myValue, myUse, myRank, myPeriod);
146        }
147
148        /**
149         * Gets the value(s) for <b>system</b> ().
150         * creating it if it does
151         * not exist. Will not return <code>null</code>.
152         *
153     * <p>
154     * <b>Definition:</b>
155     * Telecommunications form for contact point - what communications system is required to make use of the contact
156     * </p> 
157         */
158        public BoundCodeDt<ContactPointSystemEnum> getSystemElement() {  
159                if (mySystem == null) {
160                        mySystem = new BoundCodeDt<ContactPointSystemEnum>(ContactPointSystemEnum.VALUESET_BINDER);
161                }
162                return mySystem;
163        }
164
165        
166        /**
167         * Gets the value(s) for <b>system</b> ().
168         * creating it if it does
169         * not exist. Will not return <code>null</code>.
170         *
171     * <p>
172     * <b>Definition:</b>
173     * Telecommunications form for contact point - what communications system is required to make use of the contact
174     * </p> 
175         */
176        public String getSystem() {  
177                return getSystemElement().getValue();
178        }
179
180        /**
181         * Sets the value(s) for <b>system</b> ()
182         *
183     * <p>
184     * <b>Definition:</b>
185     * Telecommunications form for contact point - what communications system is required to make use of the contact
186     * </p> 
187         */
188        public ContactPointDt setSystem(BoundCodeDt<ContactPointSystemEnum> theValue) {
189                mySystem = theValue;
190                return this;
191        }
192        
193        
194
195        /**
196         * Sets the value(s) for <b>system</b> ()
197         *
198     * <p>
199     * <b>Definition:</b>
200     * Telecommunications form for contact point - what communications system is required to make use of the contact
201     * </p> 
202         */
203        public ContactPointDt setSystem(ContactPointSystemEnum theValue) {
204                setSystem(new BoundCodeDt<ContactPointSystemEnum>(ContactPointSystemEnum.VALUESET_BINDER, theValue));
205                
206/*
207                getSystemElement().setValueAsEnum(theValue);
208*/
209                return this;
210        }
211
212  
213        /**
214         * Gets the value(s) for <b>value</b> ().
215         * creating it if it does
216         * not exist. Will not return <code>null</code>.
217         *
218     * <p>
219     * <b>Definition:</b>
220     * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
221     * </p> 
222         */
223        public StringDt getValueElement() {  
224                if (myValue == null) {
225                        myValue = new StringDt();
226                }
227                return myValue;
228        }
229
230        
231        /**
232         * Gets the value(s) for <b>value</b> ().
233         * creating it if it does
234         * not exist. Will not return <code>null</code>.
235         *
236     * <p>
237     * <b>Definition:</b>
238     * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
239     * </p> 
240         */
241        public String getValue() {  
242                return getValueElement().getValue();
243        }
244
245        /**
246         * Sets the value(s) for <b>value</b> ()
247         *
248     * <p>
249     * <b>Definition:</b>
250     * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
251     * </p> 
252         */
253        public ContactPointDt setValue(StringDt theValue) {
254                myValue = theValue;
255                return this;
256        }
257        
258        
259
260        /**
261         * Sets the value for <b>value</b> ()
262         *
263     * <p>
264     * <b>Definition:</b>
265     * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
266     * </p> 
267         */
268        public ContactPointDt setValue( String theString) {
269                myValue = new StringDt(theString); 
270                return this; 
271        }
272
273 
274        /**
275         * Gets the value(s) for <b>use</b> ().
276         * creating it if it does
277         * not exist. Will not return <code>null</code>.
278         *
279     * <p>
280     * <b>Definition:</b>
281     * Identifies the purpose for the contact point
282     * </p> 
283         */
284        public BoundCodeDt<ContactPointUseEnum> getUseElement() {  
285                if (myUse == null) {
286                        myUse = new BoundCodeDt<ContactPointUseEnum>(ContactPointUseEnum.VALUESET_BINDER);
287                }
288                return myUse;
289        }
290
291        
292        /**
293         * Gets the value(s) for <b>use</b> ().
294         * creating it if it does
295         * not exist. Will not return <code>null</code>.
296         *
297     * <p>
298     * <b>Definition:</b>
299     * Identifies the purpose for the contact point
300     * </p> 
301         */
302        public String getUse() {  
303                return getUseElement().getValue();
304        }
305
306        /**
307         * Sets the value(s) for <b>use</b> ()
308         *
309     * <p>
310     * <b>Definition:</b>
311     * Identifies the purpose for the contact point
312     * </p> 
313         */
314        public ContactPointDt setUse(BoundCodeDt<ContactPointUseEnum> theValue) {
315                myUse = theValue;
316                return this;
317        }
318        
319        
320
321        /**
322         * Sets the value(s) for <b>use</b> ()
323         *
324     * <p>
325     * <b>Definition:</b>
326     * Identifies the purpose for the contact point
327     * </p> 
328         */
329        public ContactPointDt setUse(ContactPointUseEnum theValue) {
330                setUse(new BoundCodeDt<ContactPointUseEnum>(ContactPointUseEnum.VALUESET_BINDER, theValue));
331                
332/*
333                getUseElement().setValueAsEnum(theValue);
334*/
335                return this;
336        }
337
338  
339        /**
340         * Gets the value(s) for <b>rank</b> ().
341         * creating it if it does
342         * not exist. Will not return <code>null</code>.
343         *
344     * <p>
345     * <b>Definition:</b>
346     * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values
347     * </p> 
348         */
349        public PositiveIntDt getRankElement() {  
350                if (myRank == null) {
351                        myRank = new PositiveIntDt();
352                }
353                return myRank;
354        }
355
356        
357        /**
358         * Gets the value(s) for <b>rank</b> ().
359         * creating it if it does
360         * not exist. Will not return <code>null</code>.
361         *
362     * <p>
363     * <b>Definition:</b>
364     * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values
365     * </p> 
366         */
367        public Integer getRank() {  
368                return getRankElement().getValue();
369        }
370
371        /**
372         * Sets the value(s) for <b>rank</b> ()
373         *
374     * <p>
375     * <b>Definition:</b>
376     * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values
377     * </p> 
378         */
379        public ContactPointDt setRank(PositiveIntDt theValue) {
380                myRank = theValue;
381                return this;
382        }
383        
384        
385
386        /**
387         * Sets the value for <b>rank</b> ()
388         *
389     * <p>
390     * <b>Definition:</b>
391     * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values
392     * </p> 
393         */
394        public ContactPointDt setRank( int theInteger) {
395                myRank = new PositiveIntDt(theInteger); 
396                return this; 
397        }
398
399 
400        /**
401         * Gets the value(s) for <b>period</b> ().
402         * creating it if it does
403         * not exist. Will not return <code>null</code>.
404         *
405     * <p>
406     * <b>Definition:</b>
407     * Time period when the contact point was/is in use
408     * </p> 
409         */
410        public PeriodDt getPeriod() {  
411                if (myPeriod == null) {
412                        myPeriod = new PeriodDt();
413                }
414                return myPeriod;
415        }
416
417        /**
418         * Sets the value(s) for <b>period</b> ()
419         *
420     * <p>
421     * <b>Definition:</b>
422     * Time period when the contact point was/is in use
423     * </p> 
424         */
425        public ContactPointDt setPeriod(PeriodDt theValue) {
426                myPeriod = theValue;
427                return this;
428        }
429        
430        
431
432  
433
434
435}