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