ca.uhn.fhir.model.dstu2.composite.HumanNameDt Maven / Gradle / Ivy
package ca.uhn.fhir.model.dstu2.composite;
import java.net.URI;
import java.math.BigDecimal;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.base.composite.*;
import ca.uhn.fhir.model.dstu2.valueset.AddressTypeEnum;
import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.AggregationModeEnum;
import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
import ca.uhn.fhir.model.dstu2.composite.CodingDt;
import ca.uhn.fhir.model.dstu2.valueset.ConstraintSeverityEnum;
import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum;
import ca.uhn.fhir.model.dstu2.valueset.ContactPointUseEnum;
import ca.uhn.fhir.model.dstu2.resource.Device;
import ca.uhn.fhir.model.dstu2.valueset.EventTimingEnum;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum;
import ca.uhn.fhir.model.dstu2.resource.Organization;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
import ca.uhn.fhir.model.dstu2.resource.Practitioner;
import ca.uhn.fhir.model.dstu2.valueset.PropertyRepresentationEnum;
import ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum;
import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
import ca.uhn.fhir.model.dstu2.composite.RangeDt;
import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
import ca.uhn.fhir.model.dstu2.valueset.SignatureTypeCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.SlicingRulesEnum;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.dstu2.valueset.TimingAbbreviationEnum;
import ca.uhn.fhir.model.dstu2.valueset.UnitsOfTimeEnum;
import ca.uhn.fhir.model.dstu2.resource.ValueSet;
import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
import ca.uhn.fhir.model.dstu2.composite.DurationDt;
import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
import ca.uhn.fhir.model.primitive.Base64BinaryDt;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.MarkdownDt;
import ca.uhn.fhir.model.primitive.PositiveIntDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UnsignedIntDt;
import ca.uhn.fhir.model.primitive.UriDt;
/**
* HAPI/FHIR HumanNameDt Datatype
* ()
*
*
* Definition:
* A human's name with the ability to identify parts and usage
*
*
*
* Requirements:
* Need to be able to record names, along with notes about their use
*
*/
@DatatypeDef(name="HumanName")
public class HumanNameDt
extends BaseHumanNameDt
implements ICompositeDatatype
{
/**
* Constructor
*/
public HumanNameDt() {
// nothing
}
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=true)
@Description(
shortDefinition="",
formalDefinition="Identifies the purpose for this name"
)
@ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/name-use")
private BoundCodeDt myUse;
@Child(name="text", type=StringDt.class, order=1, min=0, max=1, summary=true, modifier=false)
@Description(
shortDefinition="",
formalDefinition="A full text representation of the name"
)
private StringDt myText;
@Child(name="family", type=StringDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
@Description(
shortDefinition="",
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."
)
private java.util.List myFamily;
@Child(name="given", type=StringDt.class, order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
@Description(
shortDefinition="",
formalDefinition="Given name"
)
private java.util.List myGiven;
@Child(name="prefix", type=StringDt.class, order=4, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
@Description(
shortDefinition="",
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"
)
private java.util.List myPrefix;
@Child(name="suffix", type=StringDt.class, order=5, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
@Description(
shortDefinition="",
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"
)
private java.util.List mySuffix;
@Child(name="period", type=PeriodDt.class, order=6, min=0, max=1, summary=true, modifier=false)
@Description(
shortDefinition="",
formalDefinition="Indicates the period of time when this name was valid for the named person."
)
private PeriodDt myPeriod;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myText, myFamily, myGiven, myPrefix, mySuffix, myPeriod);
}
@Override
public List getAllPopulatedChildElementsOfType(Class theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myText, myFamily, myGiven, myPrefix, mySuffix, myPeriod);
}
/**
* Gets the value(s) for use ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* Identifies the purpose for this name
*
*/
public BoundCodeDt getUseElement() {
if (myUse == null) {
myUse = new BoundCodeDt(NameUseEnum.VALUESET_BINDER);
}
return myUse;
}
/**
* Gets the value(s) for use ().
* creating it if it does
* not exist. This method may return null
.
*
*
* Definition:
* Identifies the purpose for this name
*
*/
public String getUse() {
return getUseElement().getValue();
}
/**
* Sets the value(s) for use ()
*
*
* Definition:
* Identifies the purpose for this name
*
*/
public HumanNameDt setUse(BoundCodeDt theValue) {
myUse = theValue;
return this;
}
/**
* Sets the value(s) for use ()
*
*
* Definition:
* Identifies the purpose for this name
*
*/
public HumanNameDt setUse(NameUseEnum theValue) {
setUse(new BoundCodeDt(NameUseEnum.VALUESET_BINDER, theValue));
/*
getUseElement().setValueAsEnum(theValue);
*/
return this;
}
/**
* Gets the value(s) for text ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* A full text representation of the name
*
*/
public StringDt getTextElement() {
if (myText == null) {
myText = new StringDt();
}
return myText;
}
/**
* Gets the value(s) for text ().
* creating it if it does
* not exist. This method may return null
.
*
*
* Definition:
* A full text representation of the name
*
*/
public String getText() {
return getTextElement().getValue();
}
/**
* Sets the value(s) for text ()
*
*
* Definition:
* A full text representation of the name
*
*/
public HumanNameDt setText(StringDt theValue) {
myText = theValue;
return this;
}
/**
* Sets the value for text ()
*
*
* Definition:
* A full text representation of the name
*
*/
public HumanNameDt setText( String theString) {
myText = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for family ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* 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.
*
*/
public java.util.List getFamily() {
if (myFamily == null) {
myFamily = new java.util.ArrayList();
}
return myFamily;
}
/**
* Sets the value(s) for family ()
*
*
* Definition:
* 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.
*
*/
public HumanNameDt setFamily(java.util.List theValue) {
myFamily = theValue;
return this;
}
/**
* Adds and returns a new value for family ()
*
*
* Definition:
* 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.
*
*/
public StringDt addFamily() {
StringDt newType = new StringDt();
getFamily().add(newType);
return newType;
}
/**
* Adds a given new value for family ()
*
*
* Definition:
* 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.
*
* @param theValue The family to add (must not be null
)
*/
public HumanNameDt addFamily(StringDt theValue) {
if (theValue == null) {
throw new NullPointerException("theValue must not be null");
}
getFamily().add(theValue);
return this;
}
/**
* Gets the first repetition for family (),
* creating it if it does not already exist.
*
*
* Definition:
* 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.
*
*/
public StringDt getFamilyFirstRep() {
if (getFamily().isEmpty()) {
return addFamily();
}
return getFamily().get(0);
}
/**
* Adds a new value for family ()
*
*
* Definition:
* 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.
*
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addFamily( String theString) {
if (myFamily == null) {
myFamily = new java.util.ArrayList();
}
myFamily.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for given ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* Given name
*
*/
public java.util.List getGiven() {
if (myGiven == null) {
myGiven = new java.util.ArrayList();
}
return myGiven;
}
/**
* Sets the value(s) for given ()
*
*
* Definition:
* Given name
*
*/
public HumanNameDt setGiven(java.util.List theValue) {
myGiven = theValue;
return this;
}
/**
* Adds and returns a new value for given ()
*
*
* Definition:
* Given name
*
*/
public StringDt addGiven() {
StringDt newType = new StringDt();
getGiven().add(newType);
return newType;
}
/**
* Adds a given new value for given ()
*
*
* Definition:
* Given name
*
* @param theValue The given to add (must not be null
)
*/
public HumanNameDt addGiven(StringDt theValue) {
if (theValue == null) {
throw new NullPointerException("theValue must not be null");
}
getGiven().add(theValue);
return this;
}
/**
* Gets the first repetition for given (),
* creating it if it does not already exist.
*
*
* Definition:
* Given name
*
*/
public StringDt getGivenFirstRep() {
if (getGiven().isEmpty()) {
return addGiven();
}
return getGiven().get(0);
}
/**
* Adds a new value for given ()
*
*
* Definition:
* Given name
*
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addGiven( String theString) {
if (myGiven == null) {
myGiven = new java.util.ArrayList();
}
myGiven.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for prefix ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* 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
*
*/
public java.util.List getPrefix() {
if (myPrefix == null) {
myPrefix = new java.util.ArrayList();
}
return myPrefix;
}
/**
* Sets the value(s) for prefix ()
*
*
* Definition:
* 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
*
*/
public HumanNameDt setPrefix(java.util.List theValue) {
myPrefix = theValue;
return this;
}
/**
* Adds and returns a new value for prefix ()
*
*
* Definition:
* 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
*
*/
public StringDt addPrefix() {
StringDt newType = new StringDt();
getPrefix().add(newType);
return newType;
}
/**
* Adds a given new value for prefix ()
*
*
* Definition:
* 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
*
* @param theValue The prefix to add (must not be null
)
*/
public HumanNameDt addPrefix(StringDt theValue) {
if (theValue == null) {
throw new NullPointerException("theValue must not be null");
}
getPrefix().add(theValue);
return this;
}
/**
* Gets the first repetition for prefix (),
* creating it if it does not already exist.
*
*
* Definition:
* 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
*
*/
public StringDt getPrefixFirstRep() {
if (getPrefix().isEmpty()) {
return addPrefix();
}
return getPrefix().get(0);
}
/**
* Adds a new value for prefix ()
*
*
* Definition:
* 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
*
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addPrefix( String theString) {
if (myPrefix == null) {
myPrefix = new java.util.ArrayList();
}
myPrefix.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for suffix ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* 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
*
*/
public java.util.List getSuffix() {
if (mySuffix == null) {
mySuffix = new java.util.ArrayList();
}
return mySuffix;
}
/**
* Sets the value(s) for suffix ()
*
*
* Definition:
* 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
*
*/
public HumanNameDt setSuffix(java.util.List theValue) {
mySuffix = theValue;
return this;
}
/**
* Adds and returns a new value for suffix ()
*
*
* Definition:
* 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
*
*/
public StringDt addSuffix() {
StringDt newType = new StringDt();
getSuffix().add(newType);
return newType;
}
/**
* Adds a given new value for suffix ()
*
*
* Definition:
* 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
*
* @param theValue The suffix to add (must not be null
)
*/
public HumanNameDt addSuffix(StringDt theValue) {
if (theValue == null) {
throw new NullPointerException("theValue must not be null");
}
getSuffix().add(theValue);
return this;
}
/**
* Gets the first repetition for suffix (),
* creating it if it does not already exist.
*
*
* Definition:
* 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
*
*/
public StringDt getSuffixFirstRep() {
if (getSuffix().isEmpty()) {
return addSuffix();
}
return getSuffix().get(0);
}
/**
* Adds a new value for suffix ()
*
*
* Definition:
* 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
*
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addSuffix( String theString) {
if (mySuffix == null) {
mySuffix = new java.util.ArrayList();
}
mySuffix.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for period ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* Indicates the period of time when this name was valid for the named person.
*
*/
public PeriodDt getPeriod() {
if (myPeriod == null) {
myPeriod = new PeriodDt();
}
return myPeriod;
}
/**
* Sets the value(s) for period ()
*
*
* Definition:
* Indicates the period of time when this name was valid for the named person.
*
*/
public HumanNameDt setPeriod(PeriodDt theValue) {
myPeriod = theValue;
return this;
}
}