Package org.hl7.fhir.r4.profilemodel
Class PEDefinition
- java.lang.Object
-
- org.hl7.fhir.r4.profilemodel.PEDefinition
-
- Direct Known Subclasses:
PEDefinitionElement,PEDefinitionExtension,PEDefinitionResource,PEDefinitionSlice,PEDefinitionSubExtension,PEDefinitionTypeSlice
public abstract class PEDefinition extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPEDefinition.PEDefinitionElementMode
-
Field Summary
Fields Modifier and Type Field Description protected PEBuilderbuilderprotected Map<String,List<PEDefinition>>childrenprotected ElementDefinitiondefinitionprotected Stringnameprotected Stringpathprotected StructureDefinitionprofileprotected List<PEType>types
-
Constructor Summary
Constructors Modifier Constructor Description protectedPEDefinition(PEBuilder builder, String name, StructureDefinition profile, ElementDefinition definition, String ppath)
-
Method Summary
-
-
-
Field Detail
-
profile
protected StructureDefinition profile
-
definition
protected ElementDefinition definition
-
children
protected Map<String,List<PEDefinition>> children
-
-
Constructor Detail
-
PEDefinition
protected PEDefinition(PEBuilder builder, String name, StructureDefinition profile, ElementDefinition definition, String ppath)
-
-
Method Detail
-
name
public String name()
- Returns:
- The name of the element or slice in the profile (always unique amongst children)
-
path
public String path()
- Returns:
- The path of the element or slice in the profile (name.name.name...)
-
schemaName
public String schemaName()
- Returns:
- The name of the element in the resource (may be different to the slice name)
-
schemaNameWithType
public String schemaNameWithType()
- Returns:
- The name of the element in the resource (may be different to the slice name)
-
types
public List<PEType> types()
- Returns:
- a list of types. There is usually at least one type; it might be Element, Type, BackboneElement or BackboneType The following elements don't have types (true primitives): Element.id. Extension.url, PrimitiveType.value
-
min
public int min()
- Returns:
- The minimum number of repeats allowed
-
max
public int max()
- Returns:
- the maximum number of repeats allowed
-
definition
public ElementDefinition definition()
- Returns:
- the definition of the element in the profile (fully populated) Note that the profile definition might be the same as a base definition, when the tree runs off the end of what's profiled
-
baseDefinition
public ElementDefinition baseDefinition()
- Returns:
- the definition of the element in the base specification Note that the profile definition might be the same as a base definition, when the tree runs off the end of what's profiled
-
shortDocumentation
public String shortDocumentation()
- Returns:
- the short documentation of the definition (shown in the profile table view)
-
documentation
public String documentation()
- Returns:
- the full definition of the element (markdown syntax)
-
children
public List<PEDefinition> children(String typeUrl)
- Parameters:
typeUrl- - the url of one of the types listed in types()- Returns:
- - the list of children for the nominated type Warning: profiles and resources can be recursive; you can't iterate this tree until you get to the leaves because you will never get to a child that doesn't have children (extensions have extensions etc)
-
children
public List<PEDefinition> children(String typeUrl, boolean allFixed)
-
children
public List<PEDefinition> children()
-
children
public List<PEDefinition> children(boolean allFixed)
-
hasFixedValue
public boolean hasFixedValue()
- Returns:
- True if the element has a fixed value. This will always be false if fixedProps = false when the builder is created
-
getFixedValue
public Type getFixedValue()
-
makeChildren
protected abstract void makeChildren(String typeUrl, List<PEDefinition> children, boolean allFixed)
-
isRecursing
public boolean isRecursing()
- Returns:
- true if the builder observes that this element is recursing (extensions have extensions) Note that this is unreliable and may be withdrawn if it can't be fixed
-
setRecursing
protected void setRecursing(boolean recursing)
-
isMustHaveValue
protected boolean isMustHaveValue()
-
setMustHaveValue
protected void setMustHaveValue(boolean mustHaveValue)
-
isInFixedValue
public boolean isInFixedValue()
- Returns:
- true if this property is inside an element that has an assigned fixed value
-
setInFixedValue
protected void setInFixedValue(boolean inFixedValue)
-
fhirpath
public abstract String fhirpath()
This is public to support unit testing - there's no reason to use it otherwise- Returns:
- used in the instance processor to differentiate slices
-
isList
public boolean isList()
-
repeats
public boolean repeats()
-
mode
public PEDefinition.PEDefinitionElementMode mode()
-
isProfiled
public boolean isProfiled()
- Returns:
- true if this element is profiled one way or another
-
isSlicer
public boolean isSlicer()
-
setSlicer
public void setSlicer(boolean isSlicer)
-
isBaseList
public boolean isBaseList()
-
getProfile
public StructureDefinition getProfile()
-
isKeyElement
public boolean isKeyElement()
-
isPrimitive
public boolean isPrimitive()
-
isBasePrimitive
public boolean isBasePrimitive()
-
directChildren
public List<PEDefinition> directChildren(boolean allFixed)
-
getSlices
public List<PEDefinition> getSlices()
-
setSlices
public void setSlices(List<PEDefinition> slices)
-
isExtension
public boolean isExtension()
-
-