ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt 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 CodeableConceptDt Datatype
* ()
*
*
* Definition:
* A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text
*
*
*
* Requirements:
* This is a common pattern in healthcare - a concept that may be defined by one or more codes from formal definitions including LOINC and SNOMED CT, and/or defined by the provision of text that captures a human sense of the concept
*
*/
@DatatypeDef(name="CodeableConcept")
public class CodeableConceptDt
extends BaseIdentifiableElement
implements ICompositeDatatype
{
/**
* Constructor
*/
public CodeableConceptDt() {
// nothing
}
/**
* Constructor which creates a CodeableConceptDt with one coding repetition, containing
* the given system and code
*/
public CodeableConceptDt(String theSystem, String theCode) {
addCoding().setSystem(theSystem).setCode(theCode);
}
@Child(name="coding", type=CodingDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
@Description(
shortDefinition="",
formalDefinition="A reference to a code defined by a terminology system"
)
private java.util.List myCoding;
@Child(name="text", type=StringDt.class, order=1, min=0, max=1, summary=true, modifier=false)
@Description(
shortDefinition="",
formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user"
)
private StringDt myText;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCoding, myText);
}
@Override
public List getAllPopulatedChildElementsOfType(Class theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCoding, myText);
}
/**
* Gets the value(s) for coding ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* A reference to a code defined by a terminology system
*
*/
public java.util.List getCoding() {
if (myCoding == null) {
myCoding = new java.util.ArrayList();
}
return myCoding;
}
/**
* Sets the value(s) for coding ()
*
*
* Definition:
* A reference to a code defined by a terminology system
*
*/
public CodeableConceptDt setCoding(java.util.List theValue) {
myCoding = theValue;
return this;
}
/**
* Adds and returns a new value for coding ()
*
*
* Definition:
* A reference to a code defined by a terminology system
*
*/
public CodingDt addCoding() {
CodingDt newType = new CodingDt();
getCoding().add(newType);
return newType;
}
/**
* Adds a given new value for coding ()
*
*
* Definition:
* A reference to a code defined by a terminology system
*
* @param theValue The coding to add (must not be null
)
*/
public CodeableConceptDt addCoding(CodingDt theValue) {
if (theValue == null) {
throw new NullPointerException("theValue must not be null");
}
getCoding().add(theValue);
return this;
}
/**
* Gets the first repetition for coding (),
* creating it if it does not already exist.
*
*
* Definition:
* A reference to a code defined by a terminology system
*
*/
public CodingDt getCodingFirstRep() {
if (getCoding().isEmpty()) {
return addCoding();
}
return getCoding().get(0);
}
/**
* Gets the value(s) for text ().
* creating it if it does
* not exist. Will not return null
.
*
*
* Definition:
* A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user
*
*/
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 human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user
*
*/
public String getText() {
return getTextElement().getValue();
}
/**
* Sets the value(s) for text ()
*
*
* Definition:
* A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user
*
*/
public CodeableConceptDt setText(StringDt theValue) {
myText = theValue;
return this;
}
/**
* Sets the value for text ()
*
*
* Definition:
* A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user
*
*/
public CodeableConceptDt setText( String theString) {
myText = new StringDt(theString);
return this;
}
}