Package org.hl7.fhir.r4.profilemodel
Class PEInstance
- java.lang.Object
-
- org.hl7.fhir.r4.profilemodel.PEInstance
-
public class PEInstance extends Object
This class provides a profile centric view of a resource, as driven by a profile This class is also suitable to be used as the base of a POJO- Author:
- grahamegrieve
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPEInstance.PEInstanceDataKind
-
Constructor Summary
Constructors Modifier Constructor Description protectedPEInstance(PEBuilder builder, PEDefinition definition, Resource resource, Base data, String path)
-
Method Summary
-
-
-
Constructor Detail
-
PEInstance
protected PEInstance(PEBuilder builder, PEDefinition definition, Resource resource, Base data, String path)
-
-
Method Detail
-
definition
public PEDefinition definition()
- Returns:
- definition information about this instance data
-
children
public List<PEInstance> children()
- Returns:
- all the children of this instance data
-
child
public PEInstance child(String name)
- Returns:
- all the single children of this instance data for the named property. An exception if there's more than one, null if there's none
-
children
public List<PEInstance> children(String name)
- Returns:
- all the children of this instance data for the named property
-
makeChild
public PEInstance makeChild(String name)
- Returns:
- make a child, and append it to existing children (if they exist)
-
forceChild
public PEInstance forceChild(String name)
- Returns:
- get a child. if it doesn't exist, make one
-
removeChild
public void removeChild(PEInstance child)
remove the nominated child from the resource
-
getDataKind
public PEInstance.PEInstanceDataKind getDataKind()
- Returns:
- the kind of data behind this profiled node
-
asResource
public Resource asResource()
- Returns:
- if dataKind = Resource, get the underlying resource, otherwise an exception
-
asDataType
public Type asDataType()
- Returns:
- if dataKind = Datatype, get the underlying resource, otherwise an exception
-
asElement
public BackboneElement asElement()
-
asCodeableConcept
public CodeableConcept asCodeableConcept()
-
Identifier
public Identifier Identifier()
-
asQuantity
public Quantity asQuantity()
-
asHumanName
public HumanName asHumanName()
-
asContactPoint
public ContactPoint asContactPoint()
-
asReference
public Reference asReference()
-
getPrimitiveAsString
public String getPrimitiveAsString()
- Returns:
- if dataKind = PrimitiveValue, get the underlying resource, otherwise an exception Note that this is for e.g. String.value, not String itself
-
getPrimitiveAsDate
public Date getPrimitiveAsDate()
-
setPrimitiveValue
public void setPrimitiveValue(String value)
-
getContext
public IWorkerContext getContext()
-
addChild
public Base addChild(String name, BackboneElement value)
-
-