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>IdentifierDt</b> Datatype
078 * ()
079 *
080 * <p>
081 * <b>Definition:</b>
082 * A technical identifier - identifies some entity uniquely and unambiguously
083 * </p> 
084 *
085 * <p>
086 * <b>Requirements:</b>
087 * Need to be able to identify things with confidence and be sure that the identification is not subject to misinterpretation
088 * </p> 
089 */
090@DatatypeDef(name="IdentifierDt") 
091public class IdentifierDt
092        extends  BaseIdentifierDt         implements ICompositeDatatype{
093
094        /**
095         * Constructor
096         */
097        public IdentifierDt() {
098                // nothing
099        }
100
101        /**
102         * Creates a new identifier with the given system and value
103         */
104        @SimpleSetter
105        public IdentifierDt(@SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theValue") String theValue) {
106                setSystem(theSystem);
107                setValue(theValue);
108        }
109
110        @Override
111        public String toString() {
112                return "IdentifierDt[" + getValueAsQueryToken() + "]";
113        }
114
115        @Child(name="use", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=true)       
116        @Description(
117                shortDefinition="",
118                formalDefinition="The purpose of this identifier"
119        )
120        private BoundCodeDt<IdentifierUseEnum> myUse;
121        
122        @Child(name="type", type=CodeableConceptDt.class, order=1, min=0, max=1, summary=true, modifier=false)  
123        @Description(
124                shortDefinition="",
125                formalDefinition="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose"
126        )
127        private BoundCodeableConceptDt<IdentifierTypeCodesEnum> myType;
128        
129        @Child(name="system", type=UriDt.class, order=2, min=0, max=1, summary=true, modifier=false)    
130        @Description(
131                shortDefinition="",
132                formalDefinition="Establishes the namespace in which set of possible id values is unique."
133        )
134        private UriDt mySystem;
135        
136        @Child(name="value", type=StringDt.class, order=3, min=0, max=1, summary=true, modifier=false)  
137        @Description(
138                shortDefinition="",
139                formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system."
140        )
141        private StringDt myValue;
142        
143        @Child(name="period", type=PeriodDt.class, order=4, min=0, max=1, summary=true, modifier=false) 
144        @Description(
145                shortDefinition="",
146                formalDefinition="Time period during which identifier is/was valid for use"
147        )
148        private PeriodDt myPeriod;
149        
150        @Child(name="assigner", order=5, min=0, max=1, summary=true, modifier=false, type={
151                ca.uhn.fhir.model.dstu2.resource.Organization.class     })
152        @Description(
153                shortDefinition="",
154                formalDefinition="Organization that issued/manages the identifier"
155        )
156        private ResourceReferenceDt myAssigner;
157        
158
159        @Override
160        public boolean isEmpty() {
161                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myUse,  myType,  mySystem,  myValue,  myPeriod,  myAssigner);
162        }
163        
164        @Override
165        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
166                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myType, mySystem, myValue, myPeriod, myAssigner);
167        }
168
169        /**
170         * Gets the value(s) for <b>use</b> ().
171         * creating it if it does
172         * not exist. Will not return <code>null</code>.
173         *
174     * <p>
175     * <b>Definition:</b>
176     * The purpose of this identifier
177     * </p> 
178         */
179        public BoundCodeDt<IdentifierUseEnum> getUseElement() {  
180                if (myUse == null) {
181                        myUse = new BoundCodeDt<IdentifierUseEnum>(IdentifierUseEnum.VALUESET_BINDER);
182                }
183                return myUse;
184        }
185
186        
187        /**
188         * Gets the value(s) for <b>use</b> ().
189         * creating it if it does
190         * not exist. Will not return <code>null</code>.
191         *
192     * <p>
193     * <b>Definition:</b>
194     * The purpose of this identifier
195     * </p> 
196         */
197        public String getUse() {  
198                return getUseElement().getValue();
199        }
200
201        /**
202         * Sets the value(s) for <b>use</b> ()
203         *
204     * <p>
205     * <b>Definition:</b>
206     * The purpose of this identifier
207     * </p> 
208         */
209        public IdentifierDt setUse(BoundCodeDt<IdentifierUseEnum> theValue) {
210                myUse = theValue;
211                return this;
212        }
213        
214        
215
216        /**
217         * Sets the value(s) for <b>use</b> ()
218         *
219     * <p>
220     * <b>Definition:</b>
221     * The purpose of this identifier
222     * </p> 
223         */
224        public IdentifierDt setUse(IdentifierUseEnum theValue) {
225                setUse(new BoundCodeDt<IdentifierUseEnum>(IdentifierUseEnum.VALUESET_BINDER, theValue));
226                
227/*
228                getUseElement().setValueAsEnum(theValue);
229*/
230                return this;
231        }
232
233  
234        /**
235         * Gets the value(s) for <b>type</b> ().
236         * creating it if it does
237         * not exist. Will not return <code>null</code>.
238         *
239     * <p>
240     * <b>Definition:</b>
241     * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose
242     * </p> 
243         */
244        public BoundCodeableConceptDt<IdentifierTypeCodesEnum> getType() {  
245                if (myType == null) {
246                        myType = new BoundCodeableConceptDt<IdentifierTypeCodesEnum>(IdentifierTypeCodesEnum.VALUESET_BINDER);
247                }
248                return myType;
249        }
250
251        /**
252         * Sets the value(s) for <b>type</b> ()
253         *
254     * <p>
255     * <b>Definition:</b>
256     * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose
257     * </p> 
258         */
259        public IdentifierDt setType(BoundCodeableConceptDt<IdentifierTypeCodesEnum> theValue) {
260                myType = theValue;
261                return this;
262        }
263        
264        
265
266        /**
267         * Sets the value(s) for <b>type</b> ()
268         *
269     * <p>
270     * <b>Definition:</b>
271     * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose
272     * </p> 
273         */
274        public IdentifierDt setType(IdentifierTypeCodesEnum theValue) {
275                setType(new BoundCodeableConceptDt<IdentifierTypeCodesEnum>(IdentifierTypeCodesEnum.VALUESET_BINDER, theValue));
276                
277/*
278                getType().setValueAsEnum(theValue);
279*/
280                return this;
281        }
282
283  
284        /**
285         * Gets the value(s) for <b>system</b> ().
286         * creating it if it does
287         * not exist. Will not return <code>null</code>.
288         *
289     * <p>
290     * <b>Definition:</b>
291     * Establishes the namespace in which set of possible id values is unique.
292     * </p> 
293         */
294        public UriDt getSystemElement() {  
295                if (mySystem == null) {
296                        mySystem = new UriDt();
297                }
298                return mySystem;
299        }
300
301        
302        /**
303         * Gets the value(s) for <b>system</b> ().
304         * creating it if it does
305         * not exist. Will not return <code>null</code>.
306         *
307     * <p>
308     * <b>Definition:</b>
309     * Establishes the namespace in which set of possible id values is unique.
310     * </p> 
311         */
312        public String getSystem() {  
313                return getSystemElement().getValue();
314        }
315
316        /**
317         * Sets the value(s) for <b>system</b> ()
318         *
319     * <p>
320     * <b>Definition:</b>
321     * Establishes the namespace in which set of possible id values is unique.
322     * </p> 
323         */
324        public IdentifierDt setSystem(UriDt theValue) {
325                mySystem = theValue;
326                return this;
327        }
328        
329        
330
331        /**
332         * Sets the value for <b>system</b> ()
333         *
334     * <p>
335     * <b>Definition:</b>
336     * Establishes the namespace in which set of possible id values is unique.
337     * </p> 
338         */
339        public IdentifierDt setSystem( String theUri) {
340                mySystem = new UriDt(theUri); 
341                return this; 
342        }
343
344 
345        /**
346         * Gets the value(s) for <b>value</b> ().
347         * creating it if it does
348         * not exist. Will not return <code>null</code>.
349         *
350     * <p>
351     * <b>Definition:</b>
352     * The portion of the identifier typically displayed to the user and which is unique within the context of the system.
353     * </p> 
354         */
355        public StringDt getValueElement() {  
356                if (myValue == null) {
357                        myValue = new StringDt();
358                }
359                return myValue;
360        }
361
362        
363        /**
364         * Gets the value(s) for <b>value</b> ().
365         * creating it if it does
366         * not exist. Will not return <code>null</code>.
367         *
368     * <p>
369     * <b>Definition:</b>
370     * The portion of the identifier typically displayed to the user and which is unique within the context of the system.
371     * </p> 
372         */
373        public String getValue() {  
374                return getValueElement().getValue();
375        }
376
377        /**
378         * Sets the value(s) for <b>value</b> ()
379         *
380     * <p>
381     * <b>Definition:</b>
382     * The portion of the identifier typically displayed to the user and which is unique within the context of the system.
383     * </p> 
384         */
385        public IdentifierDt setValue(StringDt theValue) {
386                myValue = theValue;
387                return this;
388        }
389        
390        
391
392        /**
393         * Sets the value for <b>value</b> ()
394         *
395     * <p>
396     * <b>Definition:</b>
397     * The portion of the identifier typically displayed to the user and which is unique within the context of the system.
398     * </p> 
399         */
400        public IdentifierDt setValue( String theString) {
401                myValue = new StringDt(theString); 
402                return this; 
403        }
404
405 
406        /**
407         * Gets the value(s) for <b>period</b> ().
408         * creating it if it does
409         * not exist. Will not return <code>null</code>.
410         *
411     * <p>
412     * <b>Definition:</b>
413     * Time period during which identifier is/was valid for use
414     * </p> 
415         */
416        public PeriodDt getPeriod() {  
417                if (myPeriod == null) {
418                        myPeriod = new PeriodDt();
419                }
420                return myPeriod;
421        }
422
423        /**
424         * Sets the value(s) for <b>period</b> ()
425         *
426     * <p>
427     * <b>Definition:</b>
428     * Time period during which identifier is/was valid for use
429     * </p> 
430         */
431        public IdentifierDt setPeriod(PeriodDt theValue) {
432                myPeriod = theValue;
433                return this;
434        }
435        
436        
437
438  
439        /**
440         * Gets the value(s) for <b>assigner</b> ().
441         * creating it if it does
442         * not exist. Will not return <code>null</code>.
443         *
444     * <p>
445     * <b>Definition:</b>
446     * Organization that issued/manages the identifier
447     * </p> 
448         */
449        public ResourceReferenceDt getAssigner() {  
450                if (myAssigner == null) {
451                        myAssigner = new ResourceReferenceDt();
452                }
453                return myAssigner;
454        }
455
456        /**
457         * Sets the value(s) for <b>assigner</b> ()
458         *
459     * <p>
460     * <b>Definition:</b>
461     * Organization that issued/manages the identifier
462     * </p> 
463         */
464        public IdentifierDt setAssigner(ResourceReferenceDt theValue) {
465                myAssigner = theValue;
466                return this;
467        }
468        
469        
470
471  
472
473
474}