Package org.hl7.fhir.r5.elementmodel
Class Element
java.lang.Object
org.hl7.fhir.r5.model.Base
org.hl7.fhir.r5.elementmodel.Element
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement
,Serializable
,org.hl7.fhir.instance.model.api.IBase
,org.hl7.fhir.utilities.NamedItemList.NamedItem
This class represents the underlying reference model of FHIR
A resource is nothing but a set of elements, where every element has a
name, maybe a stated type, maybe an id, and either a value or child elements
(one or the other, but not both or neither)
- Author:
- Grahame Grieve
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
class
class
static enum
Nested classes/interfaces inherited from class org.hl7.fhir.r5.model.Base
Base.ProfileSource, Base.ValidationInfo, Base.ValidationMode, Base.ValidationReason
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddDefinition
(StructureDefinition source, ElementDefinition defn, Base.ValidationMode mode) addElement
(String name) void
addMessage
(org.hl7.fhir.utilities.validation.ValidationMessage vm) void
addSliceDefinition
(StructureDefinition profile, ElementDefinition definition, ElementDefinition slice) asType()
boolean
void
clear()
void
int
col()
copy()
void
copyValues
(Base dst) int
boolean
equalsDeep
(Base other) boolean
equalsShallow
(Base other) fhirType()
forceElement
(String name) org.hl7.fhir.utilities.NamedItemList
<Element> getChildren
(String name) getChildrenByName
(String name) getChildValue
(String name) int
getExtension
(String url) getExtensions
(String url) getExtensionValue
(String url) org.hl7.fhir.utilities.FhirPublication
int
getIndex()
int
List
<org.hl7.fhir.utilities.validation.ValidationMessage> getName()
getNamedChild
(String name) getNamedChild
(String name, boolean exception) void
getNamedChildren
(String name, List<Element> list) void
getNamedChildrenWithWildcard
(String string, List<Element> values) getNamedChildValue
(String name) getNamedChildValue
(String name, boolean exception) this is set by the instance validator.getPath()
Base[]
getProperty
(int hash, String name, boolean checkValid) getTranslation
(String lang) getType()
String[]
getTypesForProperty
(int hash, String name) A list of definitions that the validator matched this element to.getValue()
org.hl7.fhir.utilities.xhtml.XhtmlNode
getXhtml()
return XHTML if this is an XHTML node, else nullboolean
boolean
boolean
boolean
hasChildren
(String name) boolean
boolean
hasDescendant
(Element element) boolean
boolean
hasExtension
(String url) boolean
hasIndex()
boolean
boolean
boolean
boolean
hasSlice
(StructureDefinition sd, String sliceName) boolean
boolean
hasType()
boolean
boolean
hasValue()
boolean
boolean
boolean
boolean
isEmpty()
boolean
boolean
isList()
boolean
boolean
isNull()
boolean
boolean
boolean
boolean
int
line()
protected void
listChildren
(List<Property> childProps) makeElement
(String name) makeProperty
(int hash, String name) markLocation
(int line, int col) markLocation
(Element src) markLocation
(org.hl7.fhir.utilities.SourceLocation loc) void
markValidation
(StructureDefinition profile, ElementDefinition definition) void
void
populatePaths
(String path) void
void
printToOutput
(PrintStream stream) void
removeChild
(String name) void
removeExtension
(String url) void
setChildValue
(String name, String value) void
setChildValue
(String name, Base value) void
setDescendentCount
(int descendentCount) void
setElement
(String string, Element map) void
setExplicitType
(String explicitType) setFormat
(Manager.FhirFormat format) void
void
setIgnorePropertyOrder
(boolean ignorePropertyOrder) void
setIndex
(int index) void
setInstanceId
(int instanceId) setNativeObject
(Object nativeObject) void
setNull
(boolean isNull) void
setParentForValidator
(Element parentForValidator) void
void
setProhibited
(boolean prohibited) setProperty
(int hash, String name, Base value) setProperty
(String name, Base value) void
setRequired
(boolean required) void
void
setTranslation
(String lang, String translation) void
void
setWebPath
(String webPath) setXhtml
(org.hl7.fhir.utilities.xhtml.XhtmlNode xhtml) void
sort()
toString()
void
updateProperty
(Property property, Element.SpecialElement special, Property elementProperty) Methods inherited from class org.hl7.fhir.r5.model.Base
addChild, addFormatCommentsPost, addFormatCommentsPre, addValidationMessage, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, copyFormatComments, copyUserData, dateTimeValue, equals, getChildByName, getChildValueByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getNamedProperty, getUserData, getUserInt, getUserString, getValidationMessages, hasFormatComment, hasFormatCommentPost, hasFormatCommentPre, hasType, hasUserData, hasValidated, hasValidationMessages, isCopyUserData, isDateTime, listChildrenByName, listChildrenByName, removeChild, setCopyUserData, setUserData, setUserDataINN
-
Constructor Details
-
Element
-
Element
-
Element
-
Element
-
-
Method Details
-
updateProperty
public void updateProperty(Property property, Element.SpecialElement special, Property elementProperty) -
getSpecial
-
getName
-
getType
-
getValue
-
hasChildren
-
getChildren
-
hasComments
-
getComments
-
getProperty
-
setValue
-
setType
-
isNull
-
setNull
-
hasValue
-
getChildrenByName
-
numberChildren
-
getIndex
-
hasIndex
-
setIndex
-
getChildValue
-
setChildValue
-
setChildValue
-
getChildren
-
hasType
-
fhirType
-
getProperty
public Base[] getProperty(int hash, String name, boolean checkValid) throws org.hl7.fhir.exceptions.FHIRException - Overrides:
getProperty
in classBase
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
listChildren
- Overrides:
listChildren
in classBase
-
setProperty
public Base setProperty(int hash, String name, Base value) throws org.hl7.fhir.exceptions.FHIRException - Overrides:
setProperty
in classBase
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
makeProperty
- Overrides:
makeProperty
in classBase
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
makeElement
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
forceElement
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isPrimitive
- Overrides:
isPrimitive
in classBase
- Returns:
- true if the data type is a primitive type and might have a primitive value (which will be accessed as a string, irrespective of the stated value)
-
isBooleanPrimitive
- Overrides:
isBooleanPrimitive
in classBase
- Returns:
- true if the type is boolean, and the primitive value can only be 'true' or 'false'
-
isResource
- Overrides:
isResource
in classBase
-
hasPrimitiveValue
- Overrides:
hasPrimitiveValue
in classBase
- Returns:
- true if the type is primitive, and there's value (e.g. no Data-Absent-Reason extension etc)
-
canHavePrimitiveValue
- Overrides:
canHavePrimitiveValue
in classBase
- Returns:
- true if the type is primitive, and there could be a value (irrespective of whether it's present e.g. no Data-Absent-Reason extension etc)
-
primitiveValue
- Overrides:
primitiveValue
in classBase
- Returns:
- the primitive value if there is one, as a string irrespective of the actual type (e.g. dates converted to their FHIR string representation) return null if the value is not a primitive or there is no value (might be extensions instead)
-
line
-
col
-
markLocation
-
markLocation
-
markLocation
-
clearDecorations
-
markValidation
-
getNamedChild
-
getNamedChild
-
getNamedChildren
-
getNamedChildValue
-
getNamedChildValue
-
getNamedChildrenWithWildcard
-
getXhtml
Description copied from class:Base
return XHTML if this is an XHTML node, else null -
setXhtml
-
isEmpty
-
getElementProperty
-
hasElementProperty
-
hasChild
-
hasChild
-
hasChildren
-
toString
-
getIdBase
-
setIdBase
-
equalsDeep
- Overrides:
equalsDeep
in classBase
-
equalsShallow
- Overrides:
equalsShallow
in classBase
-
asType
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isMetadataBased
- Overrides:
isMetadataBased
in classBase
-
isList
-
isBaseList
-
getTypesForProperty
public String[] getTypesForProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException - Overrides:
getTypesForProperty
in classBase
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
sort
-
getAsICoding
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getExplicitType
-
setExplicitType
-
hasDescendant
-
getExtension
-
getExtensions
-
getExtensionValue
-
hasExtension
-
getParentForValidator
this is set by the instance validator. There's no reason to maintain this when working with an element tree, and so it should be ignored outside the validator -
setParentForValidator
-
hasParentForValidator
-
clear
-
getPath
-
setPath
-
addMessage
-
hasMessages
-
getMessages
-
removeChild
-
isProhibited
-
setProhibited
-
isRequired
-
setRequired
-
getDescendentCount
-
setDescendentCount
-
countDescendents
-
getInstanceId
-
setInstanceId
-
hasValidationInfo
- Overrides:
hasValidationInfo
in classBase
-
getValidationInfo
Description copied from class:Base
A list of definitions that the validator matched this element to. Note that the element doesn't have to conform to these definitions - check whether they're valid Some of the definitions will be noted because of slice matching- Overrides:
getValidationInfo
in classBase
- Returns:
-
addDefinition
public Base.ValidationInfo addDefinition(StructureDefinition source, ElementDefinition defn, Base.ValidationMode mode) - Overrides:
addDefinition
in classBase
-
hasSource
-
getSource
-
setSource
-
printToOutput
-
printToOutput
-
populatePaths
-
fhirTypeRoot
-
setElement
-
addElement
-
copy
-
copyValues
- Overrides:
copyValues
in classBase
-
setProperty
- Overrides:
setProperty
in classBase
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isIgnorePropertyOrder
-
setIgnorePropertyOrder
-
hasWebPath
-
getWebPath
-
setWebPath
-
getTranslation
-
getBasePath
-
setTranslation
-
getListName
- Specified by:
getListName
in interfaceorg.hl7.fhir.utilities.NamedItemList.NamedItem
-
getFormat
-
setFormat
-
getNativeObject
-
setNativeObject
-
removeExtension
-
addSliceDefinition
public void addSliceDefinition(StructureDefinition profile, ElementDefinition definition, ElementDefinition slice) -
hasSlice
-
getFHIRPublicationVersion
- Specified by:
getFHIRPublicationVersion
in classBase
-