
ca.uhn.fhir.model.dstu.composite.HumanNameDt Maven / Gradle / Ivy
package ca.uhn.fhir.model.dstu.composite;
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.dstu.valueset.AddressUseEnum;
import ca.uhn.fhir.model.dstu.composite.CodingDt;
import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum;
import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum;
import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.dstu.valueset.NameUseEnum;
import ca.uhn.fhir.model.dstu.resource.Organization;
import ca.uhn.fhir.model.dstu.composite.PeriodDt;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
import ca.uhn.fhir.model.dstu.composite.QuantityDt;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum;
import ca.uhn.fhir.model.dstu.resource.ValueSet;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
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.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
/**
* HAPI/FHIR HumanNameDt Datatype
* (Name of a human - parts and usage)
*
*
* 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="HumanNameDt")
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="usual | official | temp | nickname | anonymous | old | maiden",
formalDefinition="Identifies the purpose for this name"
)
private BoundCodeDt myUse;
@Child(name="text", type=StringDt.class, order=1, min=0, max=1, summary=true, modifier=false)
@Description(
shortDefinition="Text representation of the full name",
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="Family name (often called 'Surname')",
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="Given names (not always 'first'). Includes middle names",
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="Parts that come before the name",
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="Parts that come after the name",
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="Time period when name was/is in use",
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 (usual | official | temp | nickname | anonymous | old | maiden).
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* Identifies the purpose for this name
*
*/
public BoundCodeDt getUse() {
if (myUse == null) {
myUse = new BoundCodeDt(NameUseEnum.VALUESET_BINDER);
}
return myUse;
}
/**
* Gets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden).
* 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;
}
/**
* Sets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden)
*
*
* Definition:
* Identifies the purpose for this name
*
*/
public HumanNameDt setUse(BoundCodeDt theValue) {
myUse = theValue;
return this;
}
/**
* Sets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden)
*
*
* Definition:
* Identifies the purpose for this name
*
*/
public HumanNameDt setUse(NameUseEnum theValue) {
getUse().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for text (Text representation of the full name).
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* A full text representation of the name
*
*/
public StringDt getText() {
if (myText == null) {
myText = new StringDt();
}
return myText;
}
/**
* Gets the value(s) for text (Text representation of the full name).
* 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;
}
/**
* Sets the value(s) for text (Text representation of the full name)
*
*
* Definition:
* A full text representation of the name
*
*/
public HumanNameDt setText(StringDt theValue) {
myText = theValue;
return this;
}
/**
* Sets the value for text (Text representation of the full name)
*
*
* 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 (Family name (often called 'Surname')).
* 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;
}
/**
* Gets the value(s) for family (Family name (often called 'Surname')).
* 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 getFamilyElement() {
if (myFamily == null) {
myFamily = new java.util.ArrayList();
}
return myFamily;
}
/**
* Sets the value(s) for family (Family name (often called 'Surname'))
*
*
* 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 (Family name (often called 'Surname'))
*
*
* 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;
}
/**
* Gets the first repetition for family (Family name (often called 'Surname')),
* 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 (Family name (often called 'Surname'))
*
*
* 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 (Given names (not always 'first'). Includes middle names).
* 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;
}
/**
* Gets the value(s) for given (Given names (not always 'first'). Includes middle names).
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* Given name
*
*/
public java.util.List getGivenElement() {
if (myGiven == null) {
myGiven = new java.util.ArrayList();
}
return myGiven;
}
/**
* Sets the value(s) for given (Given names (not always 'first'). Includes middle names)
*
*
* Definition:
* Given name
*
*/
public HumanNameDt setGiven(java.util.List theValue) {
myGiven = theValue;
return this;
}
/**
* Adds and returns a new value for given (Given names (not always 'first'). Includes middle names)
*
*
* Definition:
* Given name
*
*/
public StringDt addGiven() {
StringDt newType = new StringDt();
getGiven().add(newType);
return newType;
}
/**
* Gets the first repetition for given (Given names (not always 'first'). Includes middle names),
* 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 (Given names (not always 'first'). Includes middle names)
*
*
* 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 (Parts that come before the name).
* 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;
}
/**
* Gets the value(s) for prefix (Parts that come before the name).
* 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 getPrefixElement() {
if (myPrefix == null) {
myPrefix = new java.util.ArrayList();
}
return myPrefix;
}
/**
* Sets the value(s) for prefix (Parts that come before the name)
*
*
* 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 (Parts that come before the name)
*
*
* 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;
}
/**
* Gets the first repetition for prefix (Parts that come before the name),
* 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 (Parts that come before the name)
*
*
* 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 (Parts that come after the name).
* 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;
}
/**
* Gets the value(s) for suffix (Parts that come after the name).
* 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 getSuffixElement() {
if (mySuffix == null) {
mySuffix = new java.util.ArrayList();
}
return mySuffix;
}
/**
* Sets the value(s) for suffix (Parts that come after the name)
*
*
* 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 (Parts that come after the name)
*
*
* 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;
}
/**
* Gets the first repetition for suffix (Parts that come after the name),
* 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 (Parts that come after the name)
*
*
* 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 (Time period when name was/is in use).
* 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;
}
/**
* Gets the value(s) for period (Time period when name was/is in use).
* 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 getPeriodElement() {
if (myPeriod == null) {
myPeriod = new PeriodDt();
}
return myPeriod;
}
/**
* Sets the value(s) for period (Time period when name was/is in use)
*
*
* Definition:
* Indicates the period of time when this name was valid for the named person.
*
*/
public HumanNameDt setPeriod(PeriodDt theValue) {
myPeriod = theValue;
return this;
}
}