Class DaoConfig


  • public class DaoConfig
    extends Object
    • Constructor Detail

      • DaoConfig

        public DaoConfig()
        Constructor
    • Method Detail

      • isEnforceReferenceTargetTypes

        public boolean isEnforceReferenceTargetTypes()
        If set to true (default is true) when a resource is being persisted, the target resource types of references will be validated to ensure that they are appropriate for the field containing the reference. This is generally a good idea because invalid reference target types may not be searchable.
      • setEnforceReferenceTargetTypes

        public void setEnforceReferenceTargetTypes​(boolean theEnforceReferenceTargetTypes)
        If set to true (default is true) when a resource is being persisted, the target resource types of references will be validated to ensure that they are appropriate for the field containing the reference. This is generally a good idea because invalid reference target types may not be searchable.
      • getDefaultTotalMode

        public SearchTotalModeEnum getDefaultTotalMode()
        If a non-null value is supplied (default is null), a default for the _total parameter may be specified here. For example, setting this value to SearchTotalModeEnum.ACCURATE will force a count to always be calculated for all searches. This can have a performance impact since it means that a count query will always be performed, but this is desirable for some solutions.
      • setDefaultTotalMode

        public void setDefaultTotalMode​(SearchTotalModeEnum theDefaultTotalMode)
        If a non-null value is supplied (default is null), a default for the _total parameter may be specified here. For example, setting this value to SearchTotalModeEnum.ACCURATE will force a count to always be calculated for all searches. This can have a performance impact since it means that a count query will always be performed, but this is desirable for some solutions.
      • getWarmCacheEntries

        public List<WarmCacheEntry> getWarmCacheEntries()
        Returns a set of searches that should be kept "warm", meaning that searches will periodically be performed in the background to keep results ready for this search
      • setWarmCacheEntries

        public void setWarmCacheEntries​(List<WarmCacheEntry> theWarmCacheEntries)
      • isStatusBasedReindexingDisabled

        public boolean isStatusBasedReindexingDisabled()
        If set to true (default is false), the reindexing of search parameters using a query on the HFJ_RESOURCE.SP_INDEX_STATUS column will be disabled completely. This query is just not efficient on Oracle and bogs the system down when there are a lot of resources. A more efficient way of doing this will be introduced in the next release of HAPI FHIR.
        Since:
        3.5.0
      • setStatusBasedReindexingDisabled

        public void setStatusBasedReindexingDisabled​(boolean theStatusBasedReindexingDisabled)
        If set to true (default is false), the reindexing of search parameters using a query on the HFJ_RESOURCE.SP_INDEX_STATUS column will be disabled completely. This query is just not efficient on Oracle and bogs the system down when there are a lot of resources. A more efficient way of doing this will be introduced in the next release of HAPI FHIR.
        Since:
        3.5.0
      • getBundleTypesAllowedForStorage

        public Set<String> getBundleTypesAllowedForStorage()
        This setting specifies the bundle types (Bundle.type) that are allowed to be stored as-is on the /Bundle endpoint.
        See Also:
        DEFAULT_BUNDLE_TYPES_ALLOWED_FOR_STORAGE
      • setBundleTypesAllowedForStorage

        public void setBundleTypesAllowedForStorage​(Set<String> theBundleTypesAllowedForStorage)
        This setting specifies the bundle types (Bundle.type) that are allowed to be stored as-is on the /Bundle endpoint.
        See Also:
        DEFAULT_BUNDLE_TYPES_ALLOWED_FOR_STORAGE
      • getCacheControlNoStoreMaxResultsUpperLimit

        public Integer getCacheControlNoStoreMaxResultsUpperLimit()
        Specifies the highest number that a client is permitted to use in a Cache-Control: nostore, max-results=NNN directive. If the client tries to exceed this limit, the request will be denied. Defaults to 1000.
      • setCacheControlNoStoreMaxResultsUpperLimit

        public void setCacheControlNoStoreMaxResultsUpperLimit​(Integer theCacheControlNoStoreMaxResults)
        Specifies the highest number that a client is permitted to use in a Cache-Control: nostore, max-results=NNN directive. If the client tries to exceed this limit, the request will be denied. Defaults to 1000.
      • getCountSearchResultsUpTo

        public Integer getCountSearchResultsUpTo()
        When searching, if set to a non-null value (default is null) the search coordinator will attempt to find at least this many results before returning a response to the client. This parameter mainly affects whether a "total count" is included in the response bundle for searches that return large amounts of data.

        For a search that returns 10000 results, if this value is set to 10000 the search coordinator will find all 10000 results prior to returning, so the initial response bundle will have the total set to 10000. If this value is null (or less than 10000) the response bundle will likely return slightly faster, but will not include the total. Subsequent page requests will likely include the total however, if they are performed after the search coordinator has found all results.

        Set this value to 0 to always load all results before returning.

      • setCountSearchResultsUpTo

        public void setCountSearchResultsUpTo​(Integer theCountSearchResultsUpTo)
        When searching, if set to a non-null value (default is null) the search coordinator will attempt to find at least this many results before returning a response to the client. This parameter mainly affects whether a "total count" is included in the response bundle for searches that return large amounts of data.

        For a search that returns 10000 results, if this value is set to 10000 the search coordinator will find all 10000 results prior to returning, so the initial response bundle will have the total set to 10000. If this value is null (or less than 10000) the response bundle will likely return slightly faster, but will not include the total. Subsequent page requests will likely include the total however, if they are performed after the search coordinator has found all results.

        Set this value to 0 to always load all results before returning.

      • getDeferIndexingForCodesystemsOfSize

        public int getDeferIndexingForCodesystemsOfSize()
        When a code system is added that contains more than this number of codes, the code system will be indexed later in an incremental process in order to avoid overwhelming Lucene with a huge number of codes in a single operation.

        Defaults to 2000

      • setDeferIndexingForCodesystemsOfSize

        public void setDeferIndexingForCodesystemsOfSize​(int theDeferIndexingForCodesystemsOfSize)
        When a code system is added that contains more than this number of codes, the code system will be indexed later in an incremental process in order to avoid overwhelming Lucene with a huge number of codes in a single operation.

        Defaults to 2000

      • getEverythingIncludesFetchPageSize

        public int getEverythingIncludesFetchPageSize()
        Unlike with normal search queries, $everything queries have their _includes loaded by the main search thread and these included results are added to the normal search results instead of being added on as extras in a page. This means that they will not appear multiple times as the search results are paged over.

        In order to recursively load _includes, we process the original results in batches of this size. Adjust with caution, increasing this value may improve performance but may also cause memory issues.

        The default value is 50

      • setEverythingIncludesFetchPageSize

        public void setEverythingIncludesFetchPageSize​(int theEverythingIncludesFetchPageSize)
        Unlike with normal search queries, $everything queries have their _includes loaded by the main search thread and these included results are added to the normal search results instead of being added on as extras in a page. This means that they will not appear multiple times as the search results are paged over.

        In order to recursively load _includes, we process the original results in batches of this size. Adjust with caution, increasing this value may improve performance but may also cause memory issues.

        The default value is 50

      • getExpireSearchResultsAfterMillis

        public long getExpireSearchResultsAfterMillis()
        Sets the number of milliseconds that search results for a given client search should be preserved before being purged from the database.

        Search results are stored in the database so that they can be paged over multiple requests. After this number of milliseconds, they will be deleted from the database, and any paging links (next/prev links in search response bundles) will become invalid. Defaults to 1 hour.

        To disable this feature entirely, see setExpireSearchResults(boolean)

        Since:
        1.5
      • setExpireSearchResultsAfterMillis

        public void setExpireSearchResultsAfterMillis​(long theExpireSearchResultsAfterMillis)
        Sets the number of milliseconds that search results for a given client search should be preserved before being purged from the database.

        Search results are stored in the database so that they can be paged over multiple requests. After this number of milliseconds, they will be deleted from the database, and any paging links (next/prev links in search response bundles) will become invalid. Defaults to 1 hour.

        To disable this feature entirely, see setExpireSearchResults(boolean)

        Since:
        1.5
      • getFetchSizeDefaultMaximum

        public Integer getFetchSizeDefaultMaximum()
        Gets the default maximum number of results to load in a query.

        For example, if the database has a million Patient resources in it, and the client requests GET /Patient, if this value is set to a non-null value (default is null) only this number of results will be fetched. Setting this value appropriately can be useful to improve performance in some situations.

      • setFetchSizeDefaultMaximum

        public void setFetchSizeDefaultMaximum​(Integer theFetchSizeDefaultMaximum)
        Gets the default maximum number of results to load in a query.

        For example, if the database has a million Patient resources in it, and the client requests GET /Patient, if this value is set to a non-null value (default is null) only this number of results will be fetched. Setting this value appropriately can be useful to improve performance in some situations.

      • getHardTagListLimit

        public int getHardTagListLimit()
        Gets the maximum number of results to return in a GetTags query (DSTU1 only)
      • setHardTagListLimit

        public void setHardTagListLimit​(int theHardTagListLimit)
        Gets the maximum number of results to return in a GetTags query (DSTU1 only)
      • getIndexMissingFields

        public DaoConfig.IndexEnabledEnum getIndexMissingFields()
        If set to DaoConfig.IndexEnabledEnum.DISABLED (default is DaoConfig.IndexEnabledEnum.DISABLED) the server will not create search indexes for search parameters with no values in resources.

        Disabling this feature means that the :missing search modifier will not be supported on the server, but also means that storage and indexing (i.e. writes to the database) may be much faster on servers which have lots of search parameters and need to write quickly.

        This feature may be enabled on servers where supporting the use of the :missing parameter is of higher importance than raw write performance

      • setIndexMissingFields

        public void setIndexMissingFields​(DaoConfig.IndexEnabledEnum theIndexMissingFields)
        If set to DaoConfig.IndexEnabledEnum.DISABLED (default is DaoConfig.IndexEnabledEnum.DISABLED) the server will not create search indexes for search parameters with no values in resources.

        Disabling this feature means that the :missing search modifier will not be supported on the server, but also means that storage and indexing (i.e. writes to the database) may be much faster on servers which have lots of search parameters and need to write quickly.

        This feature may be enabled on servers where supporting the use of the :missing parameter is of higher importance than raw write performance

        Note that this setting also has an impact on sorting (i.e. using the _sort parameter on searches): If the server is configured to not index missing field.

      • setMaximumExpansionSize

        public void setMaximumExpansionSize​(int theMaximumExpansionSize)
        Sets the maximum number of codes that will be added to an in-memory valueset expansion before the operation will be failed as too costly. Note that this setting applies only to in-memory expansions and does not apply to expansions that are being pre-calculated.

        The default value for this setting is 1000.

      • getMaximumSearchResultCountInTransaction

        public Integer getMaximumSearchResultCountInTransaction()
        Provides the maximum number of results which may be returned by a search (HTTP GET) which is executed as a sub-operation within within a FHIR transaction or batch operation. For example, if this value is set to 100 and a FHIR transaction is processed with a sub-request for Patient?gender=male, the server will throw an error (and the transaction will fail) if there are more than 100 resources on the server which match this query.

        The default value is null, which means that there is no limit.

      • setMaximumSearchResultCountInTransaction

        public void setMaximumSearchResultCountInTransaction​(Integer theMaximumSearchResultCountInTransaction)
        Provides the maximum number of results which may be returned by a search (HTTP GET) which is executed as a sub-operation within within a FHIR transaction or batch operation. For example, if this value is set to 100 and a FHIR transaction is processed with a sub-request for Patient?gender=male, the server will throw an error (and the transaction will fail) if there are more than 100 resources on the server which match this query.

        The default value is null, which means that there is no limit.

      • getReindexThreadCount

        public int getReindexThreadCount()
        This setting controls the number of threads allocated to resource reindexing (which is only ever used if SearchParameters change, or a manual reindex is triggered due to a HAPI FHIR upgrade or some other reason).

        The default value is set to the number of available processors (via Runtime.getRuntime().availableProcessors()). Value for this setting must be a positive integer.

      • setReindexThreadCount

        public void setReindexThreadCount​(int theReindexThreadCount)
        This setting controls the number of threads allocated to resource reindexing (which is only ever used if SearchParameters change, or a manual reindex is triggered due to a HAPI FHIR upgrade or some other reason).

        The default value is set to the number of available processors (via Runtime.getRuntime().availableProcessors()). Value for this setting must be a positive integer.

      • getExpungeThreadCount

        public int getExpungeThreadCount()
        This setting controls the number of threads allocated to the expunge operation

        The default value is set to the number of available processors (via Runtime.getRuntime().availableProcessors()). Value for this setting must be a positive integer.

      • setExpungeThreadCount

        public void setExpungeThreadCount​(int theExpungeThreadCount)
        This setting controls the number of threads allocated to the expunge operation

        The default value is set to the number of available processors (via Runtime.getRuntime().availableProcessors()). Value for this setting must be a positive integer.

      • setResourceEncoding

        public void setResourceEncoding​(ResourceEncodingEnum theResourceEncoding)
      • getResourceMetaCountHardLimit

        public Integer getResourceMetaCountHardLimit()
        If set, an individual resource will not be allowed to have more than the given number of tags, profiles, and security labels (the limit is for the combined total for all of these things on an individual resource).

        If set to null, no limit will be applied.

        The default value for this setting is 1000.

      • setResourceMetaCountHardLimit

        public void setResourceMetaCountHardLimit​(Integer theResourceMetaCountHardLimit)
        If set, an individual resource will not be allowed to have more than the given number of tags, profiles, and security labels (the limit is for the combined total for all of these things on an individual resource).

        If set to null, no limit will be applied.

        The default value for this setting is 1000.

      • setResourceClientIdStrategy

        public void setResourceClientIdStrategy​(DaoConfig.ClientIdStrategyEnum theResourceClientIdStrategy)
        Controls the behaviour when a client-assigned ID is encountered, i.e. an HTTP PUT on a resource ID that does not already exist in the database.

        Default is DaoConfig.ClientIdStrategyEnum.ALPHANUMERIC

        Parameters:
        theResourceClientIdStrategy - Must not be null
      • getResourceServerIdStrategy

        public DaoConfig.IdStrategyEnum getResourceServerIdStrategy()
        This setting configures the strategy to use in generating IDs for newly created resources on the server. The default is DaoConfig.IdStrategyEnum.SEQUENTIAL_NUMERIC.

        This strategy is only used for server-assigned IDs, i.e. for HTTP POST where the client is requesing that the server store a new resource and give it an ID.

      • setResourceServerIdStrategy

        public void setResourceServerIdStrategy​(DaoConfig.IdStrategyEnum theResourceIdStrategy)
        This setting configures the strategy to use in generating IDs for newly created resources on the server. The default is DaoConfig.IdStrategyEnum.SEQUENTIAL_NUMERIC.

        This strategy is only used for server-assigned IDs, i.e. for HTTP POST where the client is requesing that the server store a new resource and give it an ID.

        Parameters:
        theResourceIdStrategy - The strategy. Must not be null.
      • getReuseCachedSearchResultsForMillis

        public Long getReuseCachedSearchResultsForMillis()
        If set to a non null value (default is non null) if an identical search is requested multiple times within this window, the same results will be returned to multiple queries. For example, if this value is set to 1 minute and a client searches for all patients named "smith", and then a second client also performs the same search within 1 minute, the same cached results will be returned.

        This approach can improve performance, especially under heavy load, but can also mean that searches may potentially return slightly out-of-date results.

        Note that if this is set to a non-null value, clients may override this setting by using the Cache-Control header. If this is set to null, the Cache-Control header will be ignored.

      • setReuseCachedSearchResultsForMillis

        public void setReuseCachedSearchResultsForMillis​(Long theReuseCachedSearchResultsForMillis)
        If set to a non null value (default is non null) if an identical search is requested multiple times within this window, the same results will be returned to multiple queries. For example, if this value is set to 1 minute and a client searches for all patients named "smith", and then a second client also performs the same search within 1 minute, the same cached results will be returned.

        This approach can improve performance, especially under heavy load, but can also mean that searches may potentially return slightly out-of-date results.

        Note that if this is set to a non-null value, clients may override this setting by using the Cache-Control header. If this is set to null, the Cache-Control header will be ignored.

      • getTranslationCachesExpireAfterWriteInMinutes

        public Long getTranslationCachesExpireAfterWriteInMinutes()
        Specifies the duration in minutes for which values will be retained after being written to the terminology translation cache. Defaults to 60.
      • setTranslationCachesExpireAfterWriteInMinutes

        public void setTranslationCachesExpireAfterWriteInMinutes​(Long translationCachesExpireAfterWriteInMinutes)
        Specifies the duration in minutes for which values will be retained after being written to the terminology translation cache. Defaults to 60.
      • getTreatReferencesAsLogical

        public Set<String> getTreatReferencesAsLogical()
        This setting may be used to advise the server that any references found in resources that have any of the base URLs given here will be treated as logical references instead of being treated as real references.

        A logical reference is a reference which is treated as an identifier, and does not neccesarily resolve. See references for a description of logical references. For example, the valueset valueset-quantity-comparator is a logical reference.

        Values for this field may take either of the following forms:

        • http://example.com/some-url (will be matched exactly)
        • http://example.com/some-base* (will match anything beginning with the part before the *)
        See Also:
        Default values for this property
      • setTreatReferencesAsLogical

        public DaoConfig setTreatReferencesAsLogical​(Set<String> theTreatReferencesAsLogical)
        This setting may be used to advise the server that any references found in resources that have any of the base URLs given here will be treated as logical references instead of being treated as real references.

        A logical reference is a reference which is treated as an identifier, and does not neccesarily resolve. See references for a description of logical references. For example, the valueset valueset-quantity-comparator is a logical reference.

        Values for this field may take either of the following forms:

        • http://example.com/some-url (will be matched exactly)
        • http://example.com/some-base* (will match anything beginning with the part before the *)
        See Also:
        Default values for this property
      • isAllowExternalReferences

        public boolean isAllowExternalReferences()
        If set to true (default is false) the server will allow resources to have references to external servers. For example if this server is running at http://example.com/fhir and this setting is set to true the server will allow a Patient resource to be saved with a Patient.organization value of http://foo.com/Organization/1.

        Under the default behaviour if this value has not been changed, the above resource would be rejected by the server because it requires all references to be resolvable on the local server.

        Note that external references will be indexed by the server and may be searched (e.g. Patient:organization), but chained searches (e.g. Patient:organization.name) will not work across these references.

        It is recommended to also set setTreatBaseUrlsAsLocal(Set) if this value is set to true

        See Also:
        setTreatBaseUrlsAsLocal(Set), setAllowExternalReferences(boolean)
      • setAllowExternalReferences

        public void setAllowExternalReferences​(boolean theAllowExternalReferences)
        If set to true (default is false) the server will allow resources to have references to external servers. For example if this server is running at http://example.com/fhir and this setting is set to true the server will allow a Patient resource to be saved with a Patient.organization value of http://foo.com/Organization/1.

        Under the default behaviour if this value has not been changed, the above resource would be rejected by the server because it requires all references to be resolvable on the local server.

        Note that external references will be indexed by the server and may be searched (e.g. Patient:organization), but chained searches (e.g. Patient:organization.name) will not work across these references.

        It is recommended to also set setTreatBaseUrlsAsLocal(Set) if this value is set to true

        See Also:
        setTreatBaseUrlsAsLocal(Set), setAllowExternalReferences(boolean)
      • setAllowInlineMatchUrlReferences

        public void setAllowInlineMatchUrlReferences​(boolean theAllowInlineMatchUrlReferences)
        Should references containing match URLs be resolved and replaced in create and update operations. For example, if this property is set to true and a resource is created containing a reference to "Patient?identifier=12345", this is reference match URL will be resolved and replaced according to the usual match URL rules.

        Default is true beginning in HAPI FHIR 2.4, since this feature is now specified in the FHIR specification. (Previously it was an experimental/proposed feature)

        Since:
        1.5
      • isAllowMultipleDelete

        public boolean isAllowMultipleDelete()
      • setAllowMultipleDelete

        public void setAllowMultipleDelete​(boolean theAllowMultipleDelete)
      • isAutoCreatePlaceholderReferenceTargets

        public boolean isAutoCreatePlaceholderReferenceTargets()
        When creating or updating a resource: If this property is set to true (default is false), if the resource has a reference to another resource on the local server but that reference does not exist, a placeholder resource will be created.

        In other words, if an observation with subject Patient/FOO is created, but there is no resource called Patient/FOO on the server, this property causes an empty patient with ID "FOO" to be created in order to prevent this operation from failing.

        This property can be useful in cases where replication between two servers is wanted. Note however that references containing purely numeric IDs will not be auto-created as they are never allowed to be client supplied in HAPI FHIR JPA.

      • setAutoCreatePlaceholderReferenceTargets

        public void setAutoCreatePlaceholderReferenceTargets​(boolean theAutoCreatePlaceholderReferenceTargets)
        When creating or updating a resource: If this property is set to true (default is false), if the resource has a reference to another resource on the local server but that reference does not exist, a placeholder resource will be created.

        In other words, if an observation with subject Patient/FOO is created, but there is no resource called Patient/FOO on the server, this property causes an empty patient with ID "FOO" to be created in order to prevent this operation from failing.

        This property can be useful in cases where replication between two servers is wanted. Note however that references containing purely numeric IDs will not be auto-created as they are never allowed to be client supplied in HAPI FHIR JPA.

      • isEnforceReferentialIntegrityOnDelete

        public boolean isEnforceReferentialIntegrityOnDelete()
        If set to false (default is true) resources will be permitted to be deleted even if other resources currently contain references to them.

        This property can cause confusing results for clients of the server since searches, includes, and other FHIR features may not behave as expected when referential integrity is not preserved. Use this feature with caution.

        See Also:
        CascadingDeleteInterceptor
      • setEnforceReferentialIntegrityOnDelete

        public void setEnforceReferentialIntegrityOnDelete​(boolean theEnforceReferentialIntegrityOnDelete)
        If set to false (default is true) resources will be permitted to be deleted even if other resources currently contain references to them.

        This property can cause confusing results for clients of the server since searches, includes, and other FHIR features may not behave as expected when referential integrity is not preserved. Use this feature with caution.

        See Also:
        CascadingDeleteInterceptor
      • isEnforceReferentialIntegrityOnWrite

        public boolean isEnforceReferentialIntegrityOnWrite()
        If set to false (default is true) resources will be permitted to be created or updated even if they contain references to local resources that do not exist.

        For example, if a patient contains a reference to managing organization Organization/FOO but FOO is not a valid ID for an organization on the server, the operation will be blocked unless this propery has been set to false

        This property can cause confusing results for clients of the server since searches, includes, and other FHIR features may not behave as expected when referential integrity is not preserved. Use this feature with caution.

      • setEnforceReferentialIntegrityOnWrite

        public void setEnforceReferentialIntegrityOnWrite​(boolean theEnforceReferentialIntegrityOnWrite)
        If set to false (default is true) resources will be permitted to be created or updated even if they contain references to local resources that do not exist.

        For example, if a patient contains a reference to managing organization Organization/FOO but FOO is not a valid ID for an organization on the server, the operation will be blocked unless this propery has been set to false

        This property can cause confusing results for clients of the server since searches, includes, and other FHIR features may not behave as expected when referential integrity is not preserved. Use this feature with caution.

      • isExpireSearchResults

        public boolean isExpireSearchResults()
        If this is set to false (default is true) the stale search deletion task will be disabled (meaning that search results will be retained in the database indefinitely). USE WITH CAUTION.

        This feature is useful if you want to define your own process for deleting these (e.g. because you are running in a cluster)

      • setExpireSearchResults

        public void setExpireSearchResults​(boolean theDeleteStaleSearches)
        If this is set to false (default is true) the stale search deletion task will be disabled (meaning that search results will be retained in the database indefinitely). USE WITH CAUTION.

        This feature is useful if you want to define your own process for deleting these (e.g. because you are running in a cluster)

      • isExpungeEnabled

        public boolean isExpungeEnabled()
        If set to true (default is false), the $expunge operation will be enabled on this server. This operation is potentially dangerous since it allows a client to physically delete data in a way that can not be recovered (without resorting to backups).

        It is recommended to not enable this setting without appropriate security in place on your server to prevent non-administrators from using this operation.

      • setExpungeEnabled

        public void setExpungeEnabled​(boolean theExpungeEnabled)
        If set to true (default is false), the $expunge operation will be enabled on this server. This operation is potentially dangerous since it allows a client to physically delete data in a way that can not be recovered (without resorting to backups).

        It is recommended to not enable this setting without appropriate security in place on your server to prevent non-administrators from using this operation.

      • getExpungeBatchSize

        public int getExpungeBatchSize()
        The expunge batch size (default 800) determines the number of records deleted within a single transaction by the expunge operation.
      • setExpungeBatchSize

        public void setExpungeBatchSize​(int theExpungeBatchSize)
        The expunge batch size (default 800) determines the number of records deleted within a single transaction by the expunge operation.
      • isIndexContainedResources

        public boolean isIndexContainedResources()
        Should contained IDs be indexed the same way that non-contained IDs are (default is true)
      • setIndexContainedResources

        public void setIndexContainedResources​(boolean theIndexContainedResources)
        Should contained IDs be indexed the same way that non-contained IDs are (default is true)
      • isMarkResourcesForReindexingUponSearchParameterChange

        public boolean isMarkResourcesForReindexingUponSearchParameterChange()
        Should resources be marked as needing reindexing when a SearchParameter resource is added or changed. This should generally be true (which is the default)
      • setMarkResourcesForReindexingUponSearchParameterChange

        public void setMarkResourcesForReindexingUponSearchParameterChange​(boolean theMarkResourcesForReindexingUponSearchParameterChange)
        Should resources be marked as needing reindexing when a SearchParameter resource is added or changed. This should generally be true (which is the default)
      • isSchedulingDisabled

        public boolean isSchedulingDisabled()
      • setSchedulingDisabled

        public void setSchedulingDisabled​(boolean theSchedulingDisabled)
      • isSuppressUpdatesWithNoChange

        public boolean isSuppressUpdatesWithNoChange()
        If set to true (default is true), if a client performs an update which does not actually result in any chance to a given resource (e.g. an update where the resource body matches the existing resource body in the database) the operation will succeed but a new version (and corresponding history entry) will not actually be created. The existing resource version will be returned to the client.

        If set to false, all updates will result in the creation of a new version

      • setSuppressUpdatesWithNoChange

        public void setSuppressUpdatesWithNoChange​(boolean theSuppressUpdatesWithNoChange)
        If set to true (default is true), if a client performs an update which does not actually result in any chance to a given resource (e.g. an update where the resource body matches the existing resource body in the database) the operation will succeed but a new version (and corresponding history entry) will not actually be created. The existing resource version will be returned to the client.

        If set to false, all updates will result in the creation of a new version

      • isUniqueIndexesCheckedBeforeSave

        public boolean isUniqueIndexesCheckedBeforeSave()
        When using unique indexes, if this setting is set to true (default is true) the system will test for the existence of a particular unique index value prior to saving a new one.

        This causes friendlier error messages to be generated, but adds an extra round-trip to the database for eavh save so it can cause a small performance hit.

      • setUniqueIndexesCheckedBeforeSave

        public void setUniqueIndexesCheckedBeforeSave​(boolean theUniqueIndexesCheckedBeforeSave)
        When using unique indexes, if this setting is set to true (default is true) the system will test for the existence of a particular unique index value prior to saving a new one.

        This causes friendlier error messages to be generated, but adds an extra round-trip to the database for each save so it can cause a small performance hit.

      • isUniqueIndexesEnabled

        public boolean isUniqueIndexesEnabled()
        If set to true (default is true), indexes will be created for search parameters marked as SearchParamConstants.EXT_SP_UNIQUE. This is a HAPI FHIR specific extension which can be used to specify that no more than one resource can exist which matches a given criteria, using a database constraint to enforce this.
      • setUniqueIndexesEnabled

        public void setUniqueIndexesEnabled​(boolean theUniqueIndexesEnabled)
        If set to true (default is true), indexes will be created for search parameters marked as SearchParamConstants.EXT_SP_UNIQUE. This is a HAPI FHIR specific extension which can be used to specify that no more than one resource can exist which matches a given criteria, using a database constraint to enforce this.
      • isValidateSearchParameterExpressionsOnSave

        public boolean isValidateSearchParameterExpressionsOnSave()
        If true (default is true), before allowing a SearchParameter resource to be stored (create, update, etc.) the expression will be performed against an empty resource to ensure that the FHIRPath executor is able to process it.

        This should proabably always be set to true, but is configurable in order to support some unit tests.

      • setValidateSearchParameterExpressionsOnSave

        public void setValidateSearchParameterExpressionsOnSave​(boolean theValidateSearchParameterExpressionsOnSave)
        If true (default is true), before allowing a SearchParameter resource to be stored (create, update, etc.) the expression will be performed against an empty resource to ensure that the FHIRPath executor is able to process it.

        This should proabably always be set to true, but is configurable in order to support some unit tests.

      • setHardSearchLimit

        @Deprecated
        public void setHardSearchLimit​(int theHardSearchLimit)
        Deprecated.
        This method does not do anything. Configure the page size on your paging provider instead. Deprecated in HAPI FHIR 2.3 (Jan 2017)
        Do not call this method, it exists only for legacy reasons. It will be removed in a future version. Configure the page size on your paging provider instead.
      • setIncludeLimit

        @Deprecated
        public void setIncludeLimit​(int theIncludeLimit)
        Deprecated.
        Deprecated in HAPI FHIR 3.2.0 as this method doesn't actually do anything
        This is the maximum number of resources that will be added to a single page of returned resources. Because of includes with wildcards and other possibilities it is possible for a client to make requests that include very large amounts of data, so this hard limit can be imposed to prevent runaway requests.
      • setSubscriptionEnabled

        @Deprecated
        public void setSubscriptionEnabled​(boolean theSubscriptionEnabled)
        Deprecated.
        As of HAPI FHIR 3.0.0, subscriptions no longer use polling for detecting changes, so this setting has no effect
      • setSubscriptionPollDelay

        @Deprecated
        public void setSubscriptionPollDelay​(long theSubscriptionPollDelay)
        Deprecated.
        As of HAPI FHIR 3.0.0, subscriptions no longer use polling for detecting changes, so this setting has no effect
      • setSubscriptionPurgeInactiveAfterMillis

        @Deprecated
        public void setSubscriptionPurgeInactiveAfterMillis​(Long theMillis)
        Deprecated.
        As of HAPI FHIR 3.0.0, subscriptions no longer use polling for detecting changes, so this setting has no effect
      • setSubscriptionPurgeInactiveAfterSeconds

        public void setSubscriptionPurgeInactiveAfterSeconds​(int theSeconds)
      • getSearchPreFetchThresholds

        public List<Integer> getSearchPreFetchThresholds()
        This setting sets the number of search results to prefetch. For example, if this list is set to [100, 1000, -1] then the server will initially load 100 results and not attempt to load more. If the user requests subsequent page(s) of results and goes past 100 results, the system will load the next 900 (up to the following threshold of 1000). The system will progressively work through these thresholds.

        A threshold of -1 means to load all results. Note that if the final threshold is a number other than -1, the system will never prefetch more than the given number.

      • setSearchPreFetchThresholds

        public void setSearchPreFetchThresholds​(List<Integer> thePreFetchThresholds)
        This setting sets the number of search results to prefetch. For example, if this list is set to [100, 1000, -1] then the server will initially load 100 results and not attempt to load more. If the user requests subsequent page(s) of results and goes past 100 results, the system will load the next 900 (up to the following threshold of 1000). The system will progressively work through these thresholds.

        A threshold of -1 means to load all results. Note that if the final threshold is a number other than -1, the system will never prefetch more than the given number.

      • getDisableHashBasedSearches

        public boolean getDisableHashBasedSearches()
        If set to true (default is false) the server will not use hash based searches. These searches were introduced in HAPI FHIR 3.5.0 and are the new default way of searching. However they require a very large data migration if an existing system has a large amount of data so this setting can be used to use the old search mechanism while data is migrated.
        Since:
        3.6.0
      • setDisableHashBasedSearches

        public void setDisableHashBasedSearches​(boolean theDisableHashBasedSearches)
        If set to true (default is false) the server will not use hash based searches. These searches were introduced in HAPI FHIR 3.5.0 and are the new default way of searching. However they require a very large data migration if an existing system has a large amount of data so this setting can be used to use the old search mechanism while data is migrated.
        Since:
        3.6.0
      • isEnableInMemorySubscriptionMatching

        public boolean isEnableInMemorySubscriptionMatching()
        If set to false (default is true) the server will not use in-memory subscription searching and instead use the database matcher for all subscription criteria matching.

        When there are subscriptions registered on the server, the default behaviour is to compare the changed resource to the subscription criteria directly in-memory without going out to the database. Certain types of subscription criteria, e.g. chained references of queries with qualifiers or prefixes, are not supported by the in-memory matcher and will fall back to a database matcher.

        The database matcher performs a query against the database by prepending ?id=XYZ to the subscription criteria where XYZ is the id of the changed entity

        Since:
        3.6.1
      • setEnableInMemorySubscriptionMatching

        public void setEnableInMemorySubscriptionMatching​(boolean theEnableInMemorySubscriptionMatching)
        If set to false (default is true) the server will not use in-memory subscription searching and instead use the database matcher for all subscription criteria matching.

        When there are subscriptions registered on the server, the default behaviour is to compare the changed resource to the subscription criteria directly in-memory without going out to the database. Certain types of subscription criteria, e.g. chained references of queries with qualifiers or prefixes, are not supported by the in-memory matcher and will fall back to a database matcher.

        The database matcher performs a query against the database by prepending ?id=XYZ to the subscription criteria where XYZ is the id of the changed entity

        Since:
        3.6.1
      • isSubscriptionMatchingEnabled

        public boolean isSubscriptionMatchingEnabled()
        If set to true (default is true) the server will match incoming resources against active subscriptions and send them to the subscription channel. If set to false no matching or sending occurs.
        Since:
        3.7.0
      • setSubscriptionMatchingEnabled

        public void setSubscriptionMatchingEnabled​(boolean theSubscriptionMatchingEnabled)
        If set to true (default is true) the server will match incoming resources against active subscriptions and send them to the subscription channel. If set to false no matching or sending occurs.
        Since:
        3.7.0
      • isAllowContainsSearches

        public boolean isAllowContainsSearches()
        If enabled, the server will support the use of :contains searches, which are helpful but can have adverse effects on performance.

        Default is false (Note that prior to HAPI FHIR 3.5.0 the default was true)

        Note: If you change this value after data already has already been stored in the database, you must for a reindexing of all data in the database or resources may not be searchable.

      • setAllowContainsSearches

        public void setAllowContainsSearches​(boolean theAllowContainsSearches)
        If enabled, the server will support the use of :contains searches, which are helpful but can have adverse effects on performance.

        Default is false (Note that prior to HAPI FHIR 3.5.0 the default was true)

        Note: If you change this value after data already has already been stored in the database, you must for a reindexing of all data in the database or resources may not be searchable.

      • getTreatBaseUrlsAsLocal

        public Set<String> getTreatBaseUrlsAsLocal()
        This setting may be used to advise the server that any references found in resources that have any of the base URLs given here will be replaced with simple local references.

        For example, if the set contains the value http://example.com/base/ and a resource is submitted to the server that contains a reference to http://example.com/base/Patient/1, the server will automatically convert this reference to Patient/1

        Note that this property has different behaviour from getTreatReferencesAsLogical()

        See Also:
        getTreatReferencesAsLogical()
      • setTreatBaseUrlsAsLocal

        public void setTreatBaseUrlsAsLocal​(Set<String> theTreatBaseUrlsAsLocal)
        This setting may be used to advise the server that any references found in resources that have any of the base URLs given here will be replaced with simple local references.

        For example, if the set contains the value http://example.com/base/ and a resource is submitted to the server that contains a reference to http://example.com/base/Patient/1, the server will automatically convert this reference to Patient/1

        Parameters:
        theTreatBaseUrlsAsLocal - The set of base URLs. May be null, which means no references will be treated as external
      • isDefaultSearchParamsCanBeOverridden

        public boolean isDefaultSearchParamsCanBeOverridden()
        If set to true the default search params (i.e. the search parameters that are defined by the FHIR specification itself) may be overridden by uploading search parameters to the server with the same code as the built-in search parameter.

        This can be useful if you want to be able to disable or alter the behaviour of the default search parameters.

        The default value for this setting is false

      • setDefaultSearchParamsCanBeOverridden

        public void setDefaultSearchParamsCanBeOverridden​(boolean theDefaultSearchParamsCanBeOverridden)
        If set to true the default search params (i.e. the search parameters that are defined by the FHIR specification itself) may be overridden by uploading search parameters to the server with the same code as the built-in search parameter.

        This can be useful if you want to be able to disable or alter the behaviour of the default search parameters.

        The default value for this setting is false

      • addSupportedSubscriptionType

        public DaoConfig addSupportedSubscriptionType​(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType theSubscriptionChannelType)
        This setting indicates which subscription channel types are supported by the server. Any subscriptions submitted to the server matching these types will be activated.
      • getSupportedSubscriptionTypes

        public Set<org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType> getSupportedSubscriptionTypes()
        This setting indicates which subscription channel types are supported by the server. Any subscriptions submitted to the server matching these types will be activated.
      • clearSupportedSubscriptionTypesForUnitTest

        public void clearSupportedSubscriptionTypesForUnitTest()
      • getEmailFromAddress

        public String getEmailFromAddress()
        If e-mail subscriptions are supported, the From address used when sending e-mails
      • setEmailFromAddress

        public void setEmailFromAddress​(String theEmailFromAddress)
        If e-mail subscriptions are supported, the From address used when sending e-mails
      • getWebsocketContextPath

        public String getWebsocketContextPath()
        If websocket subscriptions are enabled, this defines the context path that listens to them. Default value "/websocket".
      • setWebsocketContextPath

        public void setWebsocketContextPath​(String theWebsocketContextPath)
        If websocket subscriptions are enabled, this defines the context path that listens to them. Default value "/websocket".
      • isFilterParameterEnabled

        public boolean isFilterParameterEnabled()
        If set to true the _filter search parameter will be enabled on this server. Note that _filter is very powerful, but also potentially dangerous as it can allow a user to create a query for which there are no indexes or efficient query plans for the database to leverage while performing the query. As a result, this feature is recommended only for servers where the querying applications are known in advance and a database administrator can properly tune the database for the resulting queries.
      • setFilterParameterEnabled

        public void setFilterParameterEnabled​(boolean theFilterParameterEnabled)
        If set to true the _filter search parameter will be enabled on this server. Note that _filter is very powerful, but also potentially dangerous as it can allow a user to create a query for which there are no indexes or efficient query plans for the database to leverage while performing the query. As a result, this feature is recommended only for servers where the querying applications are known in advance and a database administrator can properly tune the database for the resulting queries.
      • isPreExpandValueSets

        public boolean isPreExpandValueSets()

        If set to true, ValueSets and expansions are stored in terminology tables. This is to facilitate optimization of the $expand operation on large ValueSets.

        The default value for this setting is true.

        Since:
        4.1.0
      • setPreExpandValueSets

        public void setPreExpandValueSets​(boolean thePreExpandValueSets)

        If set to true, ValueSets and expansions are stored in terminology tables. This is to facilitate optimization of the $expand operation on large ValueSets.

        The default value for this setting is true.

        Since:
        4.1.0
      • getPreExpandValueSetsDefaultOffset

        public int getPreExpandValueSetsDefaultOffset()

        This is the default value of offset parameter for the ValueSet $expand operation when isPreExpandValueSets() returns true.

        The default value for this setting is 0.

        Since:
        4.1.0
      • getPreExpandValueSetsDefaultCount

        public int getPreExpandValueSetsDefaultCount()

        This is the default value of count parameter for the ValueSet $expand operation when isPreExpandValueSets() returns true.

        The default value for this setting is 1000.

        Since:
        4.1.0
      • setPreExpandValueSetsDefaultCount

        public void setPreExpandValueSetsDefaultCount​(int thePreExpandValueSetsDefaultCount)

        This is the default value of count parameter for the ValueSet $expand operation when isPreExpandValueSets() returns true.

        If thePreExpandValueSetsDefaultCount is greater than getPreExpandValueSetsMaxCount(), the lesser value is used.

        The default value for this setting is 1000.

        Since:
        4.1.0
      • getPreExpandValueSetsMaxCount

        public int getPreExpandValueSetsMaxCount()

        This is the max value of count parameter for the ValueSet $expand operation when isPreExpandValueSets() returns true.

        The default value for this setting is 1000.

        Since:
        4.1.0
      • setPreExpandValueSetsMaxCount

        public void setPreExpandValueSetsMaxCount​(int thePreExpandValueSetsMaxCount)

        This is the max value of count parameter for the ValueSet $expand operation when isPreExpandValueSets() returns true.

        If thePreExpandValueSetsMaxCount is lesser than getPreExpandValueSetsDefaultCount(), the default count is lowered to the new max count.

        The default value for this setting is 1000.

        Since:
        4.1.0