Class ModelConfig

java.lang.Object
ca.uhn.fhir.jpa.model.entity.ModelConfig

public class ModelConfig extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • isIndexIdentifierOfType

      public boolean isIndexIdentifierOfType()
      If set to true (default is false) the :of-type modifier on token search parameters for identifiers will be supported. Enabling this causes additional indexing overhead (although very minor) so it is disabled unless it is actually needed.
      Since:
      5.7.0
    • setIndexIdentifierOfType

      public void setIndexIdentifierOfType(boolean theIndexIdentifierOfType)
      If set to true (default is false) the :of-type modifier on token search parameters for identifiers will be supported. Enabling this causes additional indexing overhead (although very minor) so it is disabled unless it is actually needed.
      Since:
      5.7.0
    • 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 true

    • 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 true

    • 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.

    • isAllowMdmExpansion

      public boolean isAllowMdmExpansion()
      If enabled, the server will support the use of :mdm search parameter qualifier on Reference Search Parameters. This Parameter Qualifier is HAPI-specific, and not defined anywhere in the FHIR specification. Using this qualifier will result in an MDM expansion being done on the reference, which will expand the search scope. For example, if Patient/1 is MDM-matched to Patient/2 and you execute the search: Observation?subject:mdm=Patient/1 , you will receive observations for both Patient/1 and Patient/2.

      Default is false

      Since:
      5.4.0
    • setAllowMdmExpansion

      public void setAllowMdmExpansion(boolean theAllowMdmExpansion)
      If enabled, the server will support the use of :mdm search parameter qualifier on Reference Search Parameters. This Parameter Qualifier is HAPI-specific, and not defined anywhere in the FHIR specification. Using this qualifier will result in an MDM expansion being done on the reference, which will expand the search scope. For example, if Patient/1 is MDM-matched to Patient/2 and you execute the search: Observation?subject:mdm=Patient/1 , you will receive observations for both Patient/1 and Patient/2.

      Default is false

      Since:
      5.4.0
    • 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:
    • 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:
    • 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:
    • 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
    • addTreatReferencesAsLogical

      public void addTreatReferencesAsLogical(String theTreatReferencesAsLogical)
      Add a value to the logical references list.
      See Also:
    • 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:
    • setTreatReferencesAsLogical

      public ModelConfig 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:
    • addSupportedSubscriptionType

      public ModelConfig 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

    • 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

      If websocket subscriptions are enabled, this specifies the context path that listens to them. Default value "/websocket".
    • setWebsocketContextPath

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

      Should searches use the integer field SP_VALUE_LOW_DATE_ORDINAL and SP_VALUE_HIGH_DATE_ORDINAL in ResourceIndexedSearchParamDate when resolving searches where all predicates are using precision of TemporalPrecisionEnum.DAY.

      For example, if enabled, the search of Observation?date=2020-02-25 will cause the date to be collapsed down to an integer representing the ordinal date 20200225. It would then be compared against ResourceIndexedSearchParamDate.getValueLowDateOrdinal() and ResourceIndexedSearchParamDate.getValueHighDateOrdinal()

      Default is true beginning in HAPI FHIR 5.0.0

      Since:
      5.0.0
    • setUseOrdinalDatesForDayPrecisionSearches

      public void setUseOrdinalDatesForDayPrecisionSearches(boolean theUseOrdinalDates)

      Should searches use the integer field SP_VALUE_LOW_DATE_ORDINAL and SP_VALUE_HIGH_DATE_ORDINAL in ResourceIndexedSearchParamDate when resolving searches where all predicates are using precision of TemporalPrecisionEnum.DAY.

      For example, if enabled, the search of Observation?date=2020-02-25 will cause the date to be collapsed down to an ordinal 20200225. It would then be compared against ResourceIndexedSearchParamDate.getValueLowDateOrdinal() and ResourceIndexedSearchParamDate.getValueHighDateOrdinal()

      Default is true beginning in HAPI FHIR 5.0.0

      Since:
      5.0.0
    • isSuppressStringIndexingInTokens

      If set to true (default is false), when indexing SearchParameter values for token SearchParameter, the string component to support the :text modifier will be disabled. This means that the following fields will not be indexed for tokens:
      • CodeableConcept.text
      • Coding.display
      • Identifier.use.text
      Since:
      5.0.0
    • setSuppressStringIndexingInTokens

      public void setSuppressStringIndexingInTokens(boolean theSuppressStringIndexingInTokens)
      If set to true (default is false), when indexing SearchParameter values for token SearchParameter, the string component to support the :text modifier will be disabled. This means that the following fields will not be indexed for tokens:
      • CodeableConcept.text
      • Coding.display
      • Identifier.use.text
      Since:
      5.0.0
    • getPeriodIndexStartOfTime

      public org.hl7.fhir.instance.model.api.IPrimitiveType<Date> getPeriodIndexStartOfTime()
      When indexing a Period (e.g. Encounter.period) where the period has an upper bound but not a lower bound, a canned "start of time" value can be used as the lower bound in order to allow range searches to correctly identify all values in the range.

      The default value for this is DEFAULT_PERIOD_INDEX_START_OF_TIME which is probably good enough for almost any application, but this can be changed if needed.

      Note the following database documented limitations:

      • JDBC Timestamp Datatype Low Value -4713 and High Value 9999
      • MySQL 8: the range for DATETIME values is '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999`
      • Postgresql 12: Timestamp [without time zone] Low Value 4713 BC and High Value 294276 AD
      • Oracle: Timestamp Low Value 4712 BC and High Value 9999 CE
      • H2: datetime2 Low Value -4713 and High Value 9999

      Since:
      5.1.0
      See Also:
    • setPeriodIndexStartOfTime

      public void setPeriodIndexStartOfTime(org.hl7.fhir.instance.model.api.IPrimitiveType<Date> thePeriodIndexStartOfTime)
      When indexing a Period (e.g. Encounter.period) where the period has an upper bound but not a lower bound, a canned "start of time" value can be used as the lower bound in order to allow range searches to correctly identify all values in the range.

      The default value for this is DEFAULT_PERIOD_INDEX_START_OF_TIME which is probably good enough for almost any application, but this can be changed if needed.

      Note the following database documented limitations:

      • JDBC Timestamp Datatype Low Value -4713 and High Value 9999
      • MySQL 8: the range for DATETIME values is '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999`
      • Postgresql 12: Timestamp [without time zone] Low Value 4713 BC and High Value 294276 AD
      • Oracle: Timestamp Low Value 4712 BC and High Value 9999 CE
      • H2: datetime2 Low Value -4713 and High Value 9999

      Since:
      5.1.0
      See Also:
    • getPeriodIndexEndOfTime

      public org.hl7.fhir.instance.model.api.IPrimitiveType<Date> getPeriodIndexEndOfTime()
      When indexing a Period (e.g. Encounter.period) where the period has a lower bound but not an upper bound, a canned "end of time" value can be used as the upper bound in order to allow range searches to correctly identify all values in the range.

      The default value for this is DEFAULT_PERIOD_INDEX_START_OF_TIME which is probably good enough for almost any application, but this can be changed if needed.

      Note the following database documented limitations:

      • JDBC Timestamp Datatype Low Value -4713 and High Value 9999
      • MySQL 8: the range for DATETIME values is '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999`
      • Postgresql 12: Timestamp [without time zone] Low Value 4713 BC and High Value 294276 AD
      • Oracle: Timestamp Low Value 4712 BC and High Value 9999 CE
      • H2: datetime2 Low Value -4713 and High Value 9999

      Since:
      5.1.0
      See Also:
    • setPeriodIndexEndOfTime

      public void setPeriodIndexEndOfTime(org.hl7.fhir.instance.model.api.IPrimitiveType<Date> thePeriodIndexEndOfTime)
      When indexing a Period (e.g. Encounter.period) where the period has an upper bound but not a lower bound, a canned "start of time" value can be used as the lower bound in order to allow range searches to correctly identify all values in the range.

      The default value for this is DEFAULT_PERIOD_INDEX_START_OF_TIME which is probably good enough for almost any application, but this can be changed if needed.

      Note the following database documented limitations:

      • JDBC Timestamp Datatype Low Value -4713 and High Value 9999
      • MySQL 8: the range for DATETIME values is '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999`
      • Postgresql 12: Timestamp [without time zone] Low Value 4713 BC and High Value 294276 AD
      • Oracle: Timestamp Low Value 4712 BC and High Value 9999 CE
      • H2: datetime2 Low Value -4713 and High Value 9999

      Since:
      5.1.0
      See Also:
    • getNormalizedQuantitySearchLevel

      Toggles whether Quantity searches support value normalization when using valid UCUM coded values.

      The default value is NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED which is current behavior.

      Here is the UCUM service support level

      Since:
      5.3.0
    • setNormalizedQuantitySearchLevel

      public void setNormalizedQuantitySearchLevel(NormalizedQuantitySearchLevel theNormalizedQuantitySearchLevel)
      Toggles whether Quantity searches support value normalization when using valid UCUM coded values.

      The default value is NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED which is current behavior.

      Here is the UCUM service support level

      Since:
      5.3.0
    • getAutoVersionReferenceAtPaths

      When set with resource paths (e.g. "Observation.subject"), any references found at the given paths will automatically have versions appended. The version used will be the current version of the given resource.
      Since:
      5.3.0
    • setAutoVersionReferenceAtPaths

      public void setAutoVersionReferenceAtPaths(String... thePaths)
      When set with resource paths (e.g. "Observation.subject"), any references found at the given paths will automatically have versions appended. The version used will be the current version of the given resource.

      Versions will only be added if the reference does not already have a version, so any versioned references supplied by the client will take precedence over the automatic current version.

      Note that for this setting to be useful, the ParserOptions DontStripVersionsFromReferencesAtPaths option must also be set.

      Parameters:
      thePaths - A collection of reference paths for which the versions will be appended 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.)
      Since:
      5.3.0
    • setAutoVersionReferenceAtPaths

      public void setAutoVersionReferenceAtPaths(Set<String> thePaths)
      When set with resource paths (e.g. "Observation.subject"), any references found at the given paths will automatically have versions appended. The version used will be the current version of the given resource.

      Versions will only be added if the reference does not already have a version, so any versioned references supplied by the client will take precedence over the automatic current version.

      Note that for this setting to be useful, the ParserOptions DontStripVersionsFromReferencesAtPaths option must also be set

      Parameters:
      thePaths - A collection of reference paths for which the versions will be appended 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.)
      Since:
      5.3.0
    • getAutoVersionReferenceAtPathsByResourceType

      Returns a sub-collection of getAutoVersionReferenceAtPaths() containing only paths for the given resource type.
      Since:
      5.3.0
    • isRespectVersionsForSearchIncludes

      Should searches with _include respect versioned references, and pull the specific requested version. This may have performance impacts on heavily loaded systems.
      Since:
      5.3.0
    • setRespectVersionsForSearchIncludes

      public void setRespectVersionsForSearchIncludes(boolean theRespectVersionsForSearchIncludes)
      Should searches with _include respect versioned references, and pull the specific requested version. This may have performance impacts on heavily loaded systems.
      Since:
      5.3.0
    • isIndexOnContainedResources

      public boolean isIndexOnContainedResources()
      Should indexing and searching on contained resources be enabled on this server. This may have performance impacts, and should be enabled only if it is needed. Default is false.
      Since:
      5.4.0
    • setIndexOnContainedResources

      public void setIndexOnContainedResources(boolean theIndexOnContainedResources)
      Should indexing and searching on contained resources be enabled on this server. This may have performance impacts, and should be enabled only if it is needed. Default is false.
      Since:
      5.4.0
    • isIndexOnContainedResourcesRecursively

      Should recursive indexing and searching on contained resources be enabled on this server. This may have performance impacts, and should be enabled only if it is needed. Default is false.
      Since:
      5.6.0
    • setIndexOnContainedResourcesRecursively

      public void setIndexOnContainedResourcesRecursively(boolean theIndexOnContainedResourcesRecursively)
      Should indexing and searching on contained resources be enabled on this server. This may have performance impacts, and should be enabled only if it is needed. Default is false.
      Since:
      5.6.0
    • isAutoSupportDefaultSearchParams

      If this is disabled by setting this to false (default is true), the server will not automatically implement and support search parameters that are not explcitly created in the repository.

      Disabling this can have a dramatic improvement on performance (especially write performance) in servers that only need to support a small number of search parameters, or no search parameters at all. Disabling this obviously reduces the options for searching however.

      Since:
      5.7.0
    • setAutoSupportDefaultSearchParams

      public void setAutoSupportDefaultSearchParams(boolean theAutoSupportDefaultSearchParams)
      If this is disabled by setting this to false (default is true), the server will not automatically implement and support search parameters that are not explcitly created in the repository.

      Disabling this can have a dramatic improvement on performance (especially write performance) in servers that only need to support a small number of search parameters, or no search parameters at all. Disabling this obviously reduces the options for searching however.

      Since:
      5.7.0
    • isCrossPartitionSubscription

      public boolean isCrossPartitionSubscription()
      If enabled, the server will support cross-partition subscription. This subscription will be the responsible for all the requests from all the partitions on this server. For example, if the server has 3 partitions, P1, P2, P3 The subscription will live in the DEFAULT partition. Resource posted to DEFAULT, P1, P2, and P3 will trigger this subscription.

      Default is false

      Since:
      7.5.0
    • setCrossPartitionSubscription

      public void setCrossPartitionSubscription(boolean theAllowCrossPartitionSubscription)
      If enabled, the server will support cross-partition subscription. This subscription will be the responsible for all the requests from all the partitions on this server. For example, if the server has 3 partitions, P1, P2, P3 The subscription will live in the DEFAULT partition. Resource posted to DEFAULT, P1, P2, and P3 will trigger this subscription.

      Default is false

      Since:
      7.5.0