Package org.hl7.fhir.r5.model
Class Element
- java.lang.Object
-
- org.hl7.fhir.r5.model.Base
-
- org.hl7.fhir.r5.model.Element
-
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement,Serializable,org.hl7.fhir.instance.model.api.IBase,org.hl7.fhir.instance.model.api.IBaseElement,org.hl7.fhir.instance.model.api.IBaseHasExtensions
- Direct Known Subclasses:
BackboneElement,DataRequirement.DataRequirementCodeFilterComponent,DataRequirement.DataRequirementDateFilterComponent,DataRequirement.DataRequirementSortComponent,DataType,Dosage.DosageDoseAndRateComponent,ElementDefinition.ElementDefinitionBaseComponent,ElementDefinition.ElementDefinitionBindingComponent,ElementDefinition.ElementDefinitionConstraintComponent,ElementDefinition.ElementDefinitionExampleComponent,ElementDefinition.ElementDefinitionMappingComponent,ElementDefinition.ElementDefinitionSlicingComponent,ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent,ElementDefinition.TypeRefComponent,OrderedDistribution.OrderedDistributionIntervalComponent,Statistic.StatisticAttributeEstimateAttributeEstimateComponent,Statistic.StatisticAttributeEstimateComponent,Statistic.StatisticModelCharacteristicComponent,Statistic.StatisticModelCharacteristicVariableComponent,Statistic.StatisticSampleSizeComponent,SubstanceAmount.SubstanceAmountReferenceRangeComponent,Timing.TimingRepeatComponent
public abstract class Element extends Base implements org.hl7.fhir.instance.model.api.IBaseHasExtensions, org.hl7.fhir.instance.model.api.IBaseElement
Base StructureDefinition for Element Type: Base definition for all elements in a resource.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Extension>extensionMay be used to represent additional information that is not part of the basic definition of the element.protected StringTypeidUnique id for the element within a resource (for internal references).
-
Constructor Summary
Constructors Constructor Description Element()Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BaseaddChild(String name)ExtensionaddExtension()voidaddExtension(String url, DataType value)ElementaddExtension(Extension t)abstract Elementcopy()voidcopyValues(Element dst)booleanequalsDeep(Base other_)booleanequalsShallow(Base other_)StringfhirType()List<Extension>getExtension()ExtensiongetExtensionByUrl(String theUrl)Returns an extension if one (and only one) matches the given URL.ExtensiongetExtensionFirstRep()List<Extension>getExtensionsByUrl(String theUrl)Returns an unmodifiable list containing all extensions on this element which match the given URL.StringgetExtensionString(String theUrl)Returns the value as a string if this element has only one extension that matches the given URL, and that can be converted to a string.StringgetId()StringgetIdBase()StringTypegetIdElement()PropertygetNamedProperty(int _hash, String _name, boolean _checkValid)Base[]getProperty(int hash, String name, boolean checkValid)String[]getTypesForProperty(int hash, String name)booleanhasExtension()booleanhasExtension(String theUrl)Returns an true if this element has an extension that matchs the given URL.booleanhasId()booleanhasIdElement()booleanisDisallowExtensions()booleanisEmpty()protected voidlistChildren(List<Property> children)BasemakeProperty(int hash, String name)ElementnoExtensions()voidremoveExtension(String theUrl)Remove any extensions that match (by given URL).ElementsetDisallowExtensions(boolean disallowExtensions)ElementsetExtension(List<Extension> theExtension)ElementsetId(String value)voidsetIdBase(String value)ElementsetIdElement(StringType value)BasesetProperty(int hash, String name, Base value)BasesetProperty(String name, Base value)-
Methods inherited from class org.hl7.fhir.r5.model.Base
children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, copyUserData, copyValues, dateTimeValue, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, getXhtml, hasFormatComment, hasPrimitiveValue, hasType, hasUserData, isBooleanPrimitive, isDateTime, isMetadataBased, isPrimitive, isResource, listChildrenByName, listChildrenByName, primitiveValue, setUserData, setUserDataINN
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
id
protected StringType id
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
-
extension
protected List<Extension> extension
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
-
-
Constructor Detail
-
Element
public Element()
Constructor
-
-
Method Detail
-
getIdElement
public StringType getIdElement()
- Returns:
id(Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value
-
hasIdElement
public boolean hasIdElement()
-
hasId
public boolean hasId()
-
setIdElement
public Element setIdElement(StringType value)
- Parameters:
value-id(Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value
-
getId
public String getId()
- Specified by:
getIdin interfaceorg.hl7.fhir.instance.model.api.IBaseElement- Returns:
- Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
-
setId
public Element setId(String value)
- Specified by:
setIdin interfaceorg.hl7.fhir.instance.model.api.IBaseElement- Parameters:
value- Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
-
getExtension
public List<Extension> getExtension()
- Specified by:
getExtensionin interfaceorg.hl7.fhir.instance.model.api.IBaseHasExtensions- Returns:
extension(May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.)
-
setExtension
public Element setExtension(List<Extension> theExtension)
- Returns:
- Returns a reference to
thisfor easy method chaining
-
hasExtension
public boolean hasExtension()
- Specified by:
hasExtensionin interfaceorg.hl7.fhir.instance.model.api.IBaseHasExtensions
-
addExtension
public Extension addExtension()
- Specified by:
addExtensionin interfaceorg.hl7.fhir.instance.model.api.IBaseHasExtensions
-
addExtension
public Element addExtension(Extension t)
-
getExtensionFirstRep
public Extension getExtensionFirstRep()
- Returns:
- The first repetition of repeating field
extension, creating it if it does not already exist {3}
-
listChildren
protected void listChildren(List<Property> children)
- Overrides:
listChildrenin classBase
-
getNamedProperty
public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getNamedPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getProperty
public Base[] getProperty(int hash, String name, boolean checkValid) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
setProperty
public Base setProperty(int hash, String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
setProperty
public Base setProperty(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
makeProperty
public Base makeProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
makePropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getTypesForProperty
public String[] getTypesForProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getTypesForPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
copyValues
public void copyValues(Element dst)
-
equalsDeep
public boolean equalsDeep(Base other_)
- Overrides:
equalsDeepin classBase
-
equalsShallow
public boolean equalsShallow(Base other_)
- Overrides:
equalsShallowin classBase
-
isEmpty
public boolean isEmpty()
-
addExtension
public void addExtension(String url, DataType value)
-
getExtensionByUrl
public Extension getExtensionByUrl(String theUrl)
Returns an extension if one (and only one) matches the given URL. Note: BackbdoneElements override this to look in matching Modifier Extensions too- Parameters:
theUrl- The URL. Must not be blank or null.- Returns:
- the matching extension, or null
-
removeExtension
public void removeExtension(String theUrl)
Remove any extensions that match (by given URL). Note: BackbdoneElements override this to remove from Modifier Extensions too- Parameters:
theUrl- The URL. Must not be blank or null.
-
isDisallowExtensions
public boolean isDisallowExtensions()
-
setDisallowExtensions
public Element setDisallowExtensions(boolean disallowExtensions)
-
noExtensions
public Element noExtensions()
-
getExtensionsByUrl
public List<Extension> getExtensionsByUrl(String theUrl)
Returns an unmodifiable list containing all extensions on this element which match the given URL. Note: BackbdoneElements override this to add matching Modifier Extensions too- Parameters:
theUrl- The URL. Must not be blank or null.- Returns:
- an unmodifiable list containing all extensions on this element which match the given URL
-
hasExtension
public boolean hasExtension(String theUrl)
Returns an true if this element has an extension that matchs the given URL. Note: BackbdoneElements override this to check Modifier Extensions too- Parameters:
theUrl- The URL. Must not be blank or null.
-
getExtensionString
public String getExtensionString(String theUrl) throws org.hl7.fhir.exceptions.FHIRException
Returns the value as a string if this element has only one extension that matches the given URL, and that can be converted to a string. Note: BackbdoneElements override this to check Modifier Extensions too- Parameters:
theUrl- The URL. Must not be blank or null.- Throws:
org.hl7.fhir.exceptions.FHIRException
-
-