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>HumanNameDt</b> Datatype
078 * ()
079 *
080 * <p>
081 * <b>Definition:</b>
082 * A human's name with the ability to identify parts and usage
083 * </p> 
084 *
085 * <p>
086 * <b>Requirements:</b>
087 * Need to be able to record names, along with notes about their use
088 * </p> 
089 */
090@DatatypeDef(name="HumanName") 
091public class HumanNameDt
092        extends  BaseHumanNameDt         implements ICompositeDatatype{
093
094        /**
095         * Constructor
096         */
097        public HumanNameDt() {
098                // nothing
099        }
100
101
102        @Child(name="use", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=true)       
103        @Description(
104                shortDefinition="",
105                formalDefinition="Identifies the purpose for this name"
106        )
107        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/name-use")
108        private BoundCodeDt<NameUseEnum> myUse;
109        
110        @Child(name="text", type=StringDt.class, order=1, min=0, max=1, summary=true, modifier=false)   
111        @Description(
112                shortDefinition="",
113                formalDefinition="A full text representation of the name"
114        )
115        private StringDt myText;
116        
117        @Child(name="family", type=StringDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
118        @Description(
119                shortDefinition="",
120                formalDefinition="The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father."
121        )
122        private java.util.List<StringDt> myFamily;
123        
124        @Child(name="given", type=StringDt.class, order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)        
125        @Description(
126                shortDefinition="",
127                formalDefinition="Given name"
128        )
129        private java.util.List<StringDt> myGiven;
130        
131        @Child(name="prefix", type=StringDt.class, order=4, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
132        @Description(
133                shortDefinition="",
134                formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name"
135        )
136        private java.util.List<StringDt> myPrefix;
137        
138        @Child(name="suffix", type=StringDt.class, order=5, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
139        @Description(
140                shortDefinition="",
141                formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name"
142        )
143        private java.util.List<StringDt> mySuffix;
144        
145        @Child(name="period", type=PeriodDt.class, order=6, min=0, max=1, summary=true, modifier=false) 
146        @Description(
147                shortDefinition="",
148                formalDefinition="Indicates the period of time when this name was valid for the named person."
149        )
150        private PeriodDt myPeriod;
151        
152
153        @Override
154        public boolean isEmpty() {
155                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myUse,  myText,  myFamily,  myGiven,  myPrefix,  mySuffix,  myPeriod);
156        }
157        
158        @Override
159        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
160                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myText, myFamily, myGiven, myPrefix, mySuffix, myPeriod);
161        }
162
163        /**
164         * Gets the value(s) for <b>use</b> ().
165         * creating it if it does
166         * not exist. Will not return <code>null</code>.
167         *
168     * <p>
169     * <b>Definition:</b>
170     * Identifies the purpose for this name
171     * </p> 
172         */
173        public BoundCodeDt<NameUseEnum> getUseElement() {  
174                if (myUse == null) {
175                        myUse = new BoundCodeDt<NameUseEnum>(NameUseEnum.VALUESET_BINDER);
176                }
177                return myUse;
178        }
179
180        
181        /**
182         * Gets the value(s) for <b>use</b> ().
183         * creating it if it does
184         * not exist. This method may return <code>null</code>.
185         *
186     * <p>
187     * <b>Definition:</b>
188     * Identifies the purpose for this name
189     * </p> 
190         */
191        public String getUse() {  
192                return getUseElement().getValue();
193        }
194
195        /**
196         * Sets the value(s) for <b>use</b> ()
197         *
198     * <p>
199     * <b>Definition:</b>
200     * Identifies the purpose for this name
201     * </p> 
202         */
203        public HumanNameDt setUse(BoundCodeDt<NameUseEnum> theValue) {
204                myUse = theValue;
205                return this;
206        }
207        
208        
209
210        /**
211         * Sets the value(s) for <b>use</b> ()
212         *
213     * <p>
214     * <b>Definition:</b>
215     * Identifies the purpose for this name
216     * </p> 
217         */
218        public HumanNameDt setUse(NameUseEnum theValue) {
219                setUse(new BoundCodeDt<NameUseEnum>(NameUseEnum.VALUESET_BINDER, theValue));
220                
221/*
222                getUseElement().setValueAsEnum(theValue);
223*/
224                return this;
225        }
226
227  
228        /**
229         * Gets the value(s) for <b>text</b> ().
230         * creating it if it does
231         * not exist. Will not return <code>null</code>.
232         *
233     * <p>
234     * <b>Definition:</b>
235     * A full text representation of the name
236     * </p> 
237         */
238        public StringDt getTextElement() {  
239                if (myText == null) {
240                        myText = new StringDt();
241                }
242                return myText;
243        }
244
245        
246        /**
247         * Gets the value(s) for <b>text</b> ().
248         * creating it if it does
249         * not exist. This method may return <code>null</code>.
250         *
251     * <p>
252     * <b>Definition:</b>
253     * A full text representation of the name
254     * </p> 
255         */
256        public String getText() {  
257                return getTextElement().getValue();
258        }
259
260        /**
261         * Sets the value(s) for <b>text</b> ()
262         *
263     * <p>
264     * <b>Definition:</b>
265     * A full text representation of the name
266     * </p> 
267         */
268        public HumanNameDt setText(StringDt theValue) {
269                myText = theValue;
270                return this;
271        }
272        
273        
274
275        /**
276         * Sets the value for <b>text</b> ()
277         *
278     * <p>
279     * <b>Definition:</b>
280     * A full text representation of the name
281     * </p> 
282         */
283        public HumanNameDt setText( String theString) {
284                myText = new StringDt(theString); 
285                return this; 
286        }
287
288 
289        /**
290         * Gets the value(s) for <b>family</b> ().
291         * creating it if it does
292         * not exist. Will not return <code>null</code>.
293         *
294     * <p>
295     * <b>Definition:</b>
296     * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
297     * </p> 
298         */
299        public java.util.List<StringDt> getFamily() {  
300                if (myFamily == null) {
301                        myFamily = new java.util.ArrayList<StringDt>();
302                }
303                return myFamily;
304        }
305
306        /**
307         * Sets the value(s) for <b>family</b> ()
308         *
309     * <p>
310     * <b>Definition:</b>
311     * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
312     * </p> 
313         */
314        public HumanNameDt setFamily(java.util.List<StringDt> theValue) {
315                myFamily = theValue;
316                return this;
317        }
318        
319        
320
321        /**
322         * Adds and returns a new value for <b>family</b> ()
323         *
324     * <p>
325     * <b>Definition:</b>
326     * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
327     * </p> 
328         */
329        public StringDt addFamily() {
330                StringDt newType = new StringDt();
331                getFamily().add(newType);
332                return newType; 
333        }
334
335        /**
336         * Adds a given new value for <b>family</b> ()
337         *
338         * <p>
339         * <b>Definition:</b>
340         * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
341         * </p>
342         * @param theValue The family to add (must not be <code>null</code>)
343         */
344        public HumanNameDt addFamily(StringDt theValue) {
345                if (theValue == null) {
346                        throw new NullPointerException("theValue must not be null");
347                }
348                getFamily().add(theValue);
349                return this;
350        }
351
352        /**
353         * Gets the first repetition for <b>family</b> (),
354         * creating it if it does not already exist.
355         *
356     * <p>
357     * <b>Definition:</b>
358     * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
359     * </p> 
360         */
361        public StringDt getFamilyFirstRep() {
362                if (getFamily().isEmpty()) {
363                        return addFamily();
364                }
365                return getFamily().get(0); 
366        }
367        /**
368         * Adds a new value for <b>family</b> ()
369         *
370     * <p>
371     * <b>Definition:</b>
372     * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
373     * </p> 
374     *
375     * @return Returns a reference to this object, to allow for simple chaining.
376         */
377        public HumanNameDt addFamily( String theString) {
378                if (myFamily == null) {
379                        myFamily = new java.util.ArrayList<StringDt>();
380                }
381                myFamily.add(new StringDt(theString));
382                return this; 
383        }
384
385 
386        /**
387         * Gets the value(s) for <b>given</b> ().
388         * creating it if it does
389         * not exist. Will not return <code>null</code>.
390         *
391     * <p>
392     * <b>Definition:</b>
393     * Given name
394     * </p> 
395         */
396        public java.util.List<StringDt> getGiven() {  
397                if (myGiven == null) {
398                        myGiven = new java.util.ArrayList<StringDt>();
399                }
400                return myGiven;
401        }
402
403        /**
404         * Sets the value(s) for <b>given</b> ()
405         *
406     * <p>
407     * <b>Definition:</b>
408     * Given name
409     * </p> 
410         */
411        public HumanNameDt setGiven(java.util.List<StringDt> theValue) {
412                myGiven = theValue;
413                return this;
414        }
415        
416        
417
418        /**
419         * Adds and returns a new value for <b>given</b> ()
420         *
421     * <p>
422     * <b>Definition:</b>
423     * Given name
424     * </p> 
425         */
426        public StringDt addGiven() {
427                StringDt newType = new StringDt();
428                getGiven().add(newType);
429                return newType; 
430        }
431
432        /**
433         * Adds a given new value for <b>given</b> ()
434         *
435         * <p>
436         * <b>Definition:</b>
437         * Given name
438         * </p>
439         * @param theValue The given to add (must not be <code>null</code>)
440         */
441        public HumanNameDt addGiven(StringDt theValue) {
442                if (theValue == null) {
443                        throw new NullPointerException("theValue must not be null");
444                }
445                getGiven().add(theValue);
446                return this;
447        }
448
449        /**
450         * Gets the first repetition for <b>given</b> (),
451         * creating it if it does not already exist.
452         *
453     * <p>
454     * <b>Definition:</b>
455     * Given name
456     * </p> 
457         */
458        public StringDt getGivenFirstRep() {
459                if (getGiven().isEmpty()) {
460                        return addGiven();
461                }
462                return getGiven().get(0); 
463        }
464        /**
465         * Adds a new value for <b>given</b> ()
466         *
467     * <p>
468     * <b>Definition:</b>
469     * Given name
470     * </p> 
471     *
472     * @return Returns a reference to this object, to allow for simple chaining.
473         */
474        public HumanNameDt addGiven( String theString) {
475                if (myGiven == null) {
476                        myGiven = new java.util.ArrayList<StringDt>();
477                }
478                myGiven.add(new StringDt(theString));
479                return this; 
480        }
481
482 
483        /**
484         * Gets the value(s) for <b>prefix</b> ().
485         * creating it if it does
486         * not exist. Will not return <code>null</code>.
487         *
488     * <p>
489     * <b>Definition:</b>
490     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
491     * </p> 
492         */
493        public java.util.List<StringDt> getPrefix() {  
494                if (myPrefix == null) {
495                        myPrefix = new java.util.ArrayList<StringDt>();
496                }
497                return myPrefix;
498        }
499
500        /**
501         * Sets the value(s) for <b>prefix</b> ()
502         *
503     * <p>
504     * <b>Definition:</b>
505     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
506     * </p> 
507         */
508        public HumanNameDt setPrefix(java.util.List<StringDt> theValue) {
509                myPrefix = theValue;
510                return this;
511        }
512        
513        
514
515        /**
516         * Adds and returns a new value for <b>prefix</b> ()
517         *
518     * <p>
519     * <b>Definition:</b>
520     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
521     * </p> 
522         */
523        public StringDt addPrefix() {
524                StringDt newType = new StringDt();
525                getPrefix().add(newType);
526                return newType; 
527        }
528
529        /**
530         * Adds a given new value for <b>prefix</b> ()
531         *
532         * <p>
533         * <b>Definition:</b>
534         * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
535         * </p>
536         * @param theValue The prefix to add (must not be <code>null</code>)
537         */
538        public HumanNameDt addPrefix(StringDt theValue) {
539                if (theValue == null) {
540                        throw new NullPointerException("theValue must not be null");
541                }
542                getPrefix().add(theValue);
543                return this;
544        }
545
546        /**
547         * Gets the first repetition for <b>prefix</b> (),
548         * creating it if it does not already exist.
549         *
550     * <p>
551     * <b>Definition:</b>
552     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
553     * </p> 
554         */
555        public StringDt getPrefixFirstRep() {
556                if (getPrefix().isEmpty()) {
557                        return addPrefix();
558                }
559                return getPrefix().get(0); 
560        }
561        /**
562         * Adds a new value for <b>prefix</b> ()
563         *
564     * <p>
565     * <b>Definition:</b>
566     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
567     * </p> 
568     *
569     * @return Returns a reference to this object, to allow for simple chaining.
570         */
571        public HumanNameDt addPrefix( String theString) {
572                if (myPrefix == null) {
573                        myPrefix = new java.util.ArrayList<StringDt>();
574                }
575                myPrefix.add(new StringDt(theString));
576                return this; 
577        }
578
579 
580        /**
581         * Gets the value(s) for <b>suffix</b> ().
582         * creating it if it does
583         * not exist. Will not return <code>null</code>.
584         *
585     * <p>
586     * <b>Definition:</b>
587     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
588     * </p> 
589         */
590        public java.util.List<StringDt> getSuffix() {  
591                if (mySuffix == null) {
592                        mySuffix = new java.util.ArrayList<StringDt>();
593                }
594                return mySuffix;
595        }
596
597        /**
598         * Sets the value(s) for <b>suffix</b> ()
599         *
600     * <p>
601     * <b>Definition:</b>
602     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
603     * </p> 
604         */
605        public HumanNameDt setSuffix(java.util.List<StringDt> theValue) {
606                mySuffix = theValue;
607                return this;
608        }
609        
610        
611
612        /**
613         * Adds and returns a new value for <b>suffix</b> ()
614         *
615     * <p>
616     * <b>Definition:</b>
617     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
618     * </p> 
619         */
620        public StringDt addSuffix() {
621                StringDt newType = new StringDt();
622                getSuffix().add(newType);
623                return newType; 
624        }
625
626        /**
627         * Adds a given new value for <b>suffix</b> ()
628         *
629         * <p>
630         * <b>Definition:</b>
631         * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
632         * </p>
633         * @param theValue The suffix to add (must not be <code>null</code>)
634         */
635        public HumanNameDt addSuffix(StringDt theValue) {
636                if (theValue == null) {
637                        throw new NullPointerException("theValue must not be null");
638                }
639                getSuffix().add(theValue);
640                return this;
641        }
642
643        /**
644         * Gets the first repetition for <b>suffix</b> (),
645         * creating it if it does not already exist.
646         *
647     * <p>
648     * <b>Definition:</b>
649     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
650     * </p> 
651         */
652        public StringDt getSuffixFirstRep() {
653                if (getSuffix().isEmpty()) {
654                        return addSuffix();
655                }
656                return getSuffix().get(0); 
657        }
658        /**
659         * Adds a new value for <b>suffix</b> ()
660         *
661     * <p>
662     * <b>Definition:</b>
663     * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
664     * </p> 
665     *
666     * @return Returns a reference to this object, to allow for simple chaining.
667         */
668        public HumanNameDt addSuffix( String theString) {
669                if (mySuffix == null) {
670                        mySuffix = new java.util.ArrayList<StringDt>();
671                }
672                mySuffix.add(new StringDt(theString));
673                return this; 
674        }
675
676 
677        /**
678         * Gets the value(s) for <b>period</b> ().
679         * creating it if it does
680         * not exist. Will not return <code>null</code>.
681         *
682     * <p>
683     * <b>Definition:</b>
684     * Indicates the period of time when this name was valid for the named person.
685     * </p> 
686         */
687        public PeriodDt getPeriod() {  
688                if (myPeriod == null) {
689                        myPeriod = new PeriodDt();
690                }
691                return myPeriod;
692        }
693
694        /**
695         * Sets the value(s) for <b>period</b> ()
696         *
697     * <p>
698     * <b>Definition:</b>
699     * Indicates the period of time when this name was valid for the named person.
700     * </p> 
701         */
702        public HumanNameDt setPeriod(PeriodDt theValue) {
703                myPeriod = theValue;
704                return this;
705        }
706        
707        
708
709  
710
711
712}