
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
Nested ClassesModifier and TypeClassDescriptionclassclassclassstatic enumNested classes/interfaces inherited from class org.hl7.fhir.r5.model.Base
Base.ProfileSource, Base.ValidationInfo, Base.ValidationMode, Base.ValidationReason -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDefinition(StructureDefinition source, ElementDefinition defn, Base.ValidationMode mode) addElement(String name) voidaddMessage(org.hl7.fhir.utilities.validation.ValidationMessage vm) voidaddSliceDefinition(StructureDefinition profile, ElementDefinition definition, ElementDefinition slice) asType()booleancanHaveChild(String name) booleanvoidclear()voidintcol()copy()voidcopyValues(Base dst) intbooleanequalsDeep(Base other) booleanequalsShallow(Base other) fhirType()forceElement(String name) org.hl7.fhir.utilities.NamedItemList<Element> getChildren(String name) getChildrenByName(String name) getChildValue(String name) intgetExtension(String url) getExtension(String... urls) getExtensions(String url) getExtensionString(String url) getExtensionValue(String... url) org.hl7.fhir.utilities.FhirPublicationintgetIndex()intList<org.hl7.fhir.utilities.validation.ValidationMessage> getName()getNamedChild(String name) getNamedChild(String name, boolean exception) voidgetNamedChildren(String name, List<Element> list) voidgetNamedChildrenWithWildcard(String string, List<Element> values) getNamedChildSingle(String name, boolean exception) getNamedChildValue(String... names) getNamedChildValue(String name, boolean exception) getNamedChildValueSingle(String... names) getNamedChildValueSingle(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.XhtmlNodegetXhtml()return XHTML if this is an XHTML node, else nullbooleanbooleanbooleanbooleanhasChildren(String name) booleanbooleanhasDescendant(Element element) booleanbooleanhasExtension(String... url) booleanhasIndex()booleanbooleanbooleanbooleanhasSlice(StructureDefinition sd, String sliceName) booleanbooleanhasType()booleanbooleanhasValue()booleanbooleanhasXhtml()booleanbooleanbooleanisElided()booleanisEmpty()booleanbooleanisList()booleanbooleanisNull()booleanbooleanbooleanbooleanintline()protected voidlistChildren(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) voidmarkValidation(StructureDefinition profile, ElementDefinition definition) voidvoidpopulatePaths(String path) voidvoidprintToOutput(PrintStream stream) voidremoveChild(String name) voidremoveChild(Element child) voidremoveExtension(String url) voidsetChildValue(String name, String value) voidsetChildValue(String name, Base value) voidsetDescendentCount(int descendentCount) voidsetElement(String string, Element map) voidsetElided(boolean elided) voidsetExplicitType(String explicitType) setFormat(Manager.FhirFormat format) voidvoidsetIgnorePropertyOrder(boolean ignorePropertyOrder) voidsetIndex(int index) voidsetInstanceId(int instanceId) setNativeObject(Object nativeObject) voidsetNull(boolean isNull) voidsetParentForValidator(Element parentForValidator) voidvoidsetProhibited(boolean prohibited) setProperty(int hash, String name, Base value) setProperty(String name, Base value) voidsetRequired(boolean required) voidvoidsetTranslation(String lang, String translation) voidvoidsetWebPath(String webPath) setXhtml(org.hl7.fhir.utilities.xhtml.XhtmlNode xhtml) return set XHTML if this is an XHTML node, else errorvoidsort()voidsortChildren(Comparator<Element> sorter) voidtoString()voidupdateProperty(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, executeFunction, 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
-
getJsonName
-
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:
getPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
listChildren
- Overrides:
listChildrenin classBase
-
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
-
makeProperty
- Overrides:
makePropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
makeElement
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
forceElement
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isPrimitive
- Overrides:
isPrimitivein 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:
isBooleanPrimitivein classBase- Returns:
- true if the type is boolean, and the primitive value can only be 'true' or 'false'
-
isResource
- Overrides:
isResourcein classBase
-
hasPrimitiveValue
- Overrides:
hasPrimitiveValuein classBase- Returns:
- true if the type is primitive, and there's value (e.g. no Data-Absent-Reason extension etc)
-
canHavePrimitiveValue
- Overrides:
canHavePrimitiveValuein 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:
primitiveValuein 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
-
getNamedChildSingle
-
getNamedChildren
-
getNamedChildValue
-
getNamedChildValue
-
getNamedChildValueSingle
-
getNamedChildValueSingle
-
getNamedChildrenWithWildcard
-
getXhtml
Description copied from class:Basereturn XHTML if this is an XHTML node, else null -
setXhtml
Description copied from class:Basereturn set XHTML if this is an XHTML node, else error -
isEmpty
-
getElementProperty
-
hasElementProperty
-
hasChild
-
hasChild
-
canHaveChild
-
hasChildren
-
toString
-
getIdBase
-
setIdBase
-
equalsDeep
- Overrides:
equalsDeepin classBase
-
equalsShallow
- Overrides:
equalsShallowin classBase
-
asType
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isMetadataBased
- Overrides:
isMetadataBasedin classBase
-
isList
-
isBaseList
-
getTypesForProperty
public String[] getTypesForProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException - Overrides:
getTypesForPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
sort
-
getAsICoding
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getExplicitType
-
setExplicitType
-
hasDescendant
-
getExtension
-
getExtension
-
getExtensionString
-
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
-
removeChild
-
isProhibited
-
setProhibited
-
isRequired
-
setRequired
-
getDescendentCount
-
setDescendentCount
-
countDescendents
-
getInstanceId
-
setInstanceId
-
hasValidationInfo
- Overrides:
hasValidationInfoin classBase
-
getValidationInfo
Description copied from class:BaseA 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:
getValidationInfoin classBase- Returns:
-
addDefinition
public Base.ValidationInfo addDefinition(StructureDefinition source, ElementDefinition defn, Base.ValidationMode mode) - Overrides:
addDefinitionin classBase
-
hasSource
-
getSource
-
setSource
-
printToOutput
-
printToOutput
-
populatePaths
-
fhirTypeRoot
-
setElement
-
addElement
-
copy
-
copyValues
- Overrides:
copyValuesin classBase
-
setProperty
- Overrides:
setPropertyin classBase- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isIgnorePropertyOrder
-
setIgnorePropertyOrder
-
hasWebPath
-
getWebPath
-
setWebPath
-
getTranslation
-
getBasePath
-
setTranslation
-
getListName
- Specified by:
getListNamein 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:
getFHIRPublicationVersionin classBase
-
setElided
-
isElided
-
stripLocations
-
sortChildren
-
getStatedResourceId
-
hasXhtml
-