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