public abstract class FhirDataformat extends DataFormatDefinition
Modifier | Constructor and Description |
---|---|
protected |
FhirDataformat() |
protected |
FhirDataformat(String dataFormatName) |
Modifier and Type | Method and Description |
---|---|
protected void |
configureDataFormat(DataFormat dataFormat,
CamelContext camelContext)
Allows derived classes to customize the data format
|
Set<String> |
getDontEncodeElements() |
List<String> |
getDontStripVersionsFromReferencesAtPaths() |
Set<String> |
getEncodeElements() |
Set<String> |
getEncodeElementsAppliesToResourceTypes() |
Object |
getFhirContext() |
String |
getFhirVersion() |
Object |
getForceResourceId() |
Boolean |
getOverrideResourceIdWithBundleEntryFullUrl() |
Object |
getParserErrorHandler() |
Object |
getParserOptions() |
Object |
getPreferTypes() |
String |
getServerBaseUrl() |
Boolean |
getStripVersionsFromReferences() |
Boolean |
isEncodeElementsAppliesToChildResourcesOnly() |
Boolean |
isOmitResourceId() |
Boolean |
isPrettyPrint() |
Boolean |
isSummaryMode() |
Boolean |
isSuppressNarratives() |
void |
setDontEncodeElements(Set<String> dontEncodeElements)
If provided, specifies the elements which should NOT be encoded.
|
void |
setDontStripVersionsFromReferencesAtPaths(List<String> dontStripVersionsFromReferencesAtPaths)
If supplied value(s), any resource references at the specified paths will have their
resource versions encoded instead of being automatically stripped during the encoding
process.
|
void |
setEncodeElements(Set<String> encodeElements)
If provided, specifies the elements which should be encoded, to the exclusion of all others.
|
void |
setEncodeElementsAppliesToChildResourcesOnly(Boolean encodeElementsAppliesToChildResourcesOnly)
If set to
true (default is false), the values supplied
to setEncodeElements(Set) will not be applied to the root
resource (typically a Bundle), but will be applied to any sub-resources
contained within it (i.e. |
void |
setEncodeElementsAppliesToResourceTypes(Set<String> encodeElementsAppliesToResourceTypes)
If provided, tells the parse which resource types to apply
encode elements to. |
void |
setFhirContext(Object fhirContext) |
void |
setFhirVersion(String fhirVersion)
The version of FHIR to use.
|
void |
setForceResourceId(Object forceResourceId)
When encoding, force this resource ID to be encoded as the resource ID
|
void |
setOmitResourceId(Boolean omitResourceId)
If set to
true (default is false ) the ID of any resources being encoded will not be
included in the output. |
void |
setOverrideResourceIdWithBundleEntryFullUrl(Boolean overrideResourceIdWithBundleEntryFullUrl)
If set to
true (which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's
resource id if the fullUrl is defined. |
void |
setParserErrorHandler(Object parserErrorHandler)
Registers an error handler which will be invoked when any parse errors are found
|
void |
setParserOptions(Object parserOptions)
Sets the parser options object which will be used to supply default
options to newly created parsers.
|
void |
setPreferTypes(Object preferTypes)
If set, when parsing resources the parser will try to use the given types when possible, in
the order that they are provided (from highest to lowest priority).
|
void |
setPrettyPrint(Boolean prettyPrint)
Sets the "pretty print" flag, meaning that the parser will encode resources with human-readable spacing and
newlines between elements instead of condensing output as much as possible.
|
void |
setServerBaseUrl(String serverBaseUrl)
Sets the server's base URL used by this parser.
|
void |
setStripVersionsFromReferences(Boolean stripVersionsFromReferences)
If set to
true |
void |
setSummaryMode(Boolean summaryMode)
If set to
true (default is false ) only elements marked by the FHIR specification as
being "summary elements" will be included. |
void |
setSuppressNarratives(Boolean suppressNarratives)
If set to
true (default is false ), narratives will not be included in the encoded
values. |
configureDataFormat, createDataFormat, getContentTypeHeader, getDataFormat, getDataFormat, getDataFormat, getDataFormatName, getOtherAttributes, getShortName, setContentTypeHeader, setDataFormat, setDataFormatName, setOtherAttributes, setProperty, setProperty
getId, setId
protected FhirDataformat(String dataFormatName)
protected FhirDataformat()
protected void configureDataFormat(DataFormat dataFormat, CamelContext camelContext)
DataFormatDefinition
configureDataFormat
in class DataFormatDefinition
public Object getFhirContext()
public void setFhirContext(Object fhirContext)
public String getFhirVersion()
public void setFhirVersion(String fhirVersion)
public Boolean isPrettyPrint()
public void setPrettyPrint(Boolean prettyPrint)
prettyPrint
- The flagpublic Object getParserErrorHandler()
public void setParserErrorHandler(Object parserErrorHandler)
parserErrorHandler
- The error handler to set. Must not be null.public Object getParserOptions()
public void setParserOptions(Object parserOptions)
parserOptions
- The parser options objectpublic Object getPreferTypes()
public void setPreferTypes(Object preferTypes)
preferTypes
- The preferred types, or null
public Object getForceResourceId()
public void setForceResourceId(Object forceResourceId)
public String getServerBaseUrl()
public void setServerBaseUrl(String serverBaseUrl)
serverBaseUrl
- The base URL, e.g. "http://example.com/base"public Boolean isOmitResourceId()
public void setOmitResourceId(Boolean omitResourceId)
true
(default is false
) the ID of any resources being encoded will not be
included in the output. Note that this does not apply to contained resources, only to root resources. In other
words, if this is set to true
, contained resources will still have local IDs but the outer/containing
ID will not have an ID.omitResourceId
- Should resource IDs be omittedpublic Set<String> getEncodeElementsAppliesToResourceTypes()
public void setEncodeElementsAppliesToResourceTypes(Set<String> encodeElementsAppliesToResourceTypes)
encode elements
to. Any
resource types not specified here will be encoded completely, with no elements excluded.encodeElementsAppliesToResourceTypes
- resouce typespublic Boolean isEncodeElementsAppliesToChildResourcesOnly()
public void setEncodeElementsAppliesToChildResourcesOnly(Boolean encodeElementsAppliesToChildResourcesOnly)
true
(default is false), the values supplied
to setEncodeElements(Set)
will not be applied to the root
resource (typically a Bundle), but will be applied to any sub-resources
contained within it (i.e. search result resources in that bundle)public Set<String> getEncodeElements()
public void setEncodeElements(Set<String> encodeElements)
encodeElements
- The elements to encodesetDontEncodeElements(Set)
public Set<String> getDontEncodeElements()
public void setDontEncodeElements(Set<String> dontEncodeElements)
DSTU2 note: Note that values including meta, such as Patient.meta
will work for DSTU2 parsers, but values with subelements on meta such
as Patient.meta.lastUpdated
will only work in
DSTU3+ mode.
dontEncodeElements
- The elements to encodesetEncodeElements(Set)
public Boolean getStripVersionsFromReferences()
public void setStripVersionsFromReferences(Boolean stripVersionsFromReferences)
true (which is the default), resource references containing a version
will have the version removed when the resource is encoded. This is generally good behaviour because
in most situations, references from one resource to another should be to the resource by ID, not
by ID and version. In some cases though, it may be desirable to preserve the version in resource
links. In that case, this value should be set to false
.
This method provides the ability to globally disable reference encoding. If finer-grained
control is needed, use setDontStripVersionsFromReferencesAtPaths(List)
stripVersionsFromReferences
- Set this to false to prevent the parser from removing resource versions
from references (or null
to apply the default setting from the setParserOptions(Object)
setDontStripVersionsFromReferencesAtPaths(List)
public Boolean getOverrideResourceIdWithBundleEntryFullUrl()
public void setOverrideResourceIdWithBundleEntryFullUrl(Boolean overrideResourceIdWithBundleEntryFullUrl)
true
(which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's
resource id if the fullUrl is defined. This behavior happens when parsing the source data into a Bundle object. Set this
to false
if this is not the desired behavior (e.g. the client code wishes to perform additional
validation checks between the fullUrl and the resource id).overrideResourceIdWithBundleEntryFullUrl
- Set this to false
to prevent the parser from overriding resource ids with the
Bundle.entry.fullUrl (or null
to apply the default setting from the setParserOptions(Object)
)public Boolean isSummaryMode()
public void setSummaryMode(Boolean summaryMode)
true
(default is false
) only elements marked by the FHIR specification as
being "summary elements" will be included.public Boolean isSuppressNarratives()
public void setSuppressNarratives(Boolean suppressNarratives)
true
(default is false
), narratives will not be included in the encoded
values.public List<String> getDontStripVersionsFromReferencesAtPaths()
public void setDontStripVersionsFromReferencesAtPaths(List<String> dontStripVersionsFromReferencesAtPaths)
This method provides a finer-grained level of control than setStripVersionsFromReferences(Boolean)
and any paths specified by this method will be encoded even if setStripVersionsFromReferences(Boolean)
has been set to true
(which is the default)
dontStripVersionsFromReferencesAtPaths
- A collection of paths for which the resource versions will not be removed automatically
when serializing, e.g. "Patient.managingOrganization" or "AuditEvent.object.reference". Note that
only resource name and field names with dots separating is allowed here (no repetition
indicators, FluentPath expressions, etc.). Set to null
to use the value
set in the setParserOptions(Object)
setStripVersionsFromReferences(Boolean)
Apache Camel