All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.uhn.fhir.model.dstu.composite.AddressDt Maven / Gradle / Ivy

There is a newer version: 7.6.1
Show newest version
















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 AddressDt Datatype
 * (A postal address)
 *
 * 

* Definition: * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world *

* *

* Requirements: * Need to be able to record postal addresses, along with notes about their use *

*/ @DatatypeDef(name="AddressDt") public class AddressDt extends BaseIdentifiableElement implements ICompositeDatatype { /** * Constructor */ public AddressDt() { // nothing } @Child(name="use", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=true) @Description( shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address" ) 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 address", formalDefinition="A full text representation of the address" ) private StringDt myText; @Child(name="line", type=StringDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false) @Description( shortDefinition="Street name, number, direction & P.O. Box etc", formalDefinition="This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information" ) private java.util.List myLine; @Child(name="city", type=StringDt.class, order=3, min=0, max=1, summary=true, modifier=false) @Description( shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." ) private StringDt myCity; @Child(name="state", type=StringDt.class, order=4, min=0, max=1, summary=true, modifier=false) @Description( shortDefinition="Sub-unit of country (abreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." ) private StringDt myState; @Child(name="zip", type=StringDt.class, order=5, min=0, max=1, summary=true, modifier=false) @Description( shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." ) private StringDt myZip; @Child(name="country", type=StringDt.class, order=6, min=0, max=1, summary=true, modifier=false) @Description( shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted" ) private StringDt myCountry; @Child(name="period", type=PeriodDt.class, order=7, min=0, max=1, summary=true, modifier=false) @Description( shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use" ) private PeriodDt myPeriod; @Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myText, myLine, myCity, myState, myZip, myCountry, myPeriod); } @Override public List getAllPopulatedChildElementsOfType(Class theType) { return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myText, myLine, myCity, myState, myZip, myCountry, myPeriod); } /** * Gets the value(s) for use (home | work | temp | old - purpose of this address). * creating it if it does * not exist. Will not return null. * *

* Definition: * The purpose of this address *

*/ public BoundCodeDt getUse() { if (myUse == null) { myUse = new BoundCodeDt(AddressUseEnum.VALUESET_BINDER); } return myUse; } /** * Gets the value(s) for use (home | work | temp | old - purpose of this address). * creating it if it does * not exist. Will not return null. * *

* Definition: * The purpose of this address *

*/ public BoundCodeDt getUseElement() { if (myUse == null) { myUse = new BoundCodeDt(AddressUseEnum.VALUESET_BINDER); } return myUse; } /** * Sets the value(s) for use (home | work | temp | old - purpose of this address) * *

* Definition: * The purpose of this address *

*/ public AddressDt setUse(BoundCodeDt theValue) { myUse = theValue; return this; } /** * Sets the value(s) for use (home | work | temp | old - purpose of this address) * *

* Definition: * The purpose of this address *

*/ public AddressDt setUse(AddressUseEnum theValue) { getUse().setValueAsEnum(theValue); return this; } /** * Gets the value(s) for text (Text representation of the address). * creating it if it does * not exist. Will not return null. * *

* Definition: * A full text representation of the address *

*/ public StringDt getText() { if (myText == null) { myText = new StringDt(); } return myText; } /** * Gets the value(s) for text (Text representation of the address). * creating it if it does * not exist. Will not return null. * *

* Definition: * A full text representation of the address *

*/ public StringDt getTextElement() { if (myText == null) { myText = new StringDt(); } return myText; } /** * Sets the value(s) for text (Text representation of the address) * *

* Definition: * A full text representation of the address *

*/ public AddressDt setText(StringDt theValue) { myText = theValue; return this; } /** * Sets the value for text (Text representation of the address) * *

* Definition: * A full text representation of the address *

*/ public AddressDt setText( String theString) { myText = new StringDt(theString); return this; } /** * Gets the value(s) for line (Street name, number, direction & P.O. Box etc). * creating it if it does * not exist. Will not return null. * *

* Definition: * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information *

*/ public java.util.List getLine() { if (myLine == null) { myLine = new java.util.ArrayList(); } return myLine; } /** * Gets the value(s) for line (Street name, number, direction & P.O. Box etc). * creating it if it does * not exist. Will not return null. * *

* Definition: * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information *

*/ public java.util.List getLineElement() { if (myLine == null) { myLine = new java.util.ArrayList(); } return myLine; } /** * Sets the value(s) for line (Street name, number, direction & P.O. Box etc) * *

* Definition: * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information *

*/ public AddressDt setLine(java.util.List theValue) { myLine = theValue; return this; } /** * Adds and returns a new value for line (Street name, number, direction & P.O. Box etc) * *

* Definition: * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information *

*/ public StringDt addLine() { StringDt newType = new StringDt(); getLine().add(newType); return newType; } /** * Gets the first repetition for line (Street name, number, direction & P.O. Box etc), * creating it if it does not already exist. * *

* Definition: * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information *

*/ public StringDt getLineFirstRep() { if (getLine().isEmpty()) { return addLine(); } return getLine().get(0); } /** * Adds a new value for line (Street name, number, direction & P.O. Box etc) * *

* Definition: * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information *

* * @return Returns a reference to this object, to allow for simple chaining. */ public AddressDt addLine( String theString) { if (myLine == null) { myLine = new java.util.ArrayList(); } myLine.add(new StringDt(theString)); return this; } /** * Gets the value(s) for city (Name of city, town etc.). * creating it if it does * not exist. Will not return null. * *

* Definition: * The name of the city, town, village or other community or delivery center. *

*/ public StringDt getCity() { if (myCity == null) { myCity = new StringDt(); } return myCity; } /** * Gets the value(s) for city (Name of city, town etc.). * creating it if it does * not exist. Will not return null. * *

* Definition: * The name of the city, town, village or other community or delivery center. *

*/ public StringDt getCityElement() { if (myCity == null) { myCity = new StringDt(); } return myCity; } /** * Sets the value(s) for city (Name of city, town etc.) * *

* Definition: * The name of the city, town, village or other community or delivery center. *

*/ public AddressDt setCity(StringDt theValue) { myCity = theValue; return this; } /** * Sets the value for city (Name of city, town etc.) * *

* Definition: * The name of the city, town, village or other community or delivery center. *

*/ public AddressDt setCity( String theString) { myCity = new StringDt(theString); return this; } /** * Gets the value(s) for state (Sub-unit of country (abreviations ok)). * creating it if it does * not exist. Will not return null. * *

* Definition: * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). *

*/ public StringDt getState() { if (myState == null) { myState = new StringDt(); } return myState; } /** * Gets the value(s) for state (Sub-unit of country (abreviations ok)). * creating it if it does * not exist. Will not return null. * *

* Definition: * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). *

*/ public StringDt getStateElement() { if (myState == null) { myState = new StringDt(); } return myState; } /** * Sets the value(s) for state (Sub-unit of country (abreviations ok)) * *

* Definition: * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). *

*/ public AddressDt setState(StringDt theValue) { myState = theValue; return this; } /** * Sets the value for state (Sub-unit of country (abreviations ok)) * *

* Definition: * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). *

*/ public AddressDt setState( String theString) { myState = new StringDt(theString); return this; } /** * Gets the value(s) for zip (Postal code for area). * creating it if it does * not exist. Will not return null. * *

* Definition: * A postal code designating a region defined by the postal service. *

*/ public StringDt getZip() { if (myZip == null) { myZip = new StringDt(); } return myZip; } /** * Gets the value(s) for zip (Postal code for area). * creating it if it does * not exist. Will not return null. * *

* Definition: * A postal code designating a region defined by the postal service. *

*/ public StringDt getZipElement() { if (myZip == null) { myZip = new StringDt(); } return myZip; } /** * Sets the value(s) for zip (Postal code for area) * *

* Definition: * A postal code designating a region defined by the postal service. *

*/ public AddressDt setZip(StringDt theValue) { myZip = theValue; return this; } /** * Sets the value for zip (Postal code for area) * *

* Definition: * A postal code designating a region defined by the postal service. *

*/ public AddressDt setZip( String theString) { myZip = new StringDt(theString); return this; } /** * Gets the value(s) for country (Country (can be ISO 3166 3 letter code)). * creating it if it does * not exist. Will not return null. * *

* Definition: * Country - a nation as commonly understood or generally accepted *

*/ public StringDt getCountry() { if (myCountry == null) { myCountry = new StringDt(); } return myCountry; } /** * Gets the value(s) for country (Country (can be ISO 3166 3 letter code)). * creating it if it does * not exist. Will not return null. * *

* Definition: * Country - a nation as commonly understood or generally accepted *

*/ public StringDt getCountryElement() { if (myCountry == null) { myCountry = new StringDt(); } return myCountry; } /** * Sets the value(s) for country (Country (can be ISO 3166 3 letter code)) * *

* Definition: * Country - a nation as commonly understood or generally accepted *

*/ public AddressDt setCountry(StringDt theValue) { myCountry = theValue; return this; } /** * Sets the value for country (Country (can be ISO 3166 3 letter code)) * *

* Definition: * Country - a nation as commonly understood or generally accepted *

*/ public AddressDt setCountry( String theString) { myCountry = new StringDt(theString); return this; } /** * Gets the value(s) for period (Time period when address was/is in use). * creating it if it does * not exist. Will not return null. * *

* Definition: * Time period when address was/is in use *

*/ public PeriodDt getPeriod() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; } /** * Gets the value(s) for period (Time period when address was/is in use). * creating it if it does * not exist. Will not return null. * *

* Definition: * Time period when address was/is in use *

*/ public PeriodDt getPeriodElement() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; } /** * Sets the value(s) for period (Time period when address was/is in use) * *

* Definition: * Time period when address was/is in use *

*/ public AddressDt setPeriod(PeriodDt theValue) { myPeriod = theValue; return this; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy