FhirEngineConfiguration

data class FhirEngineConfiguration(val enableEncryptionIfSupported: Boolean = false, val databaseErrorStrategy: DatabaseErrorStrategy = UNSPECIFIED, val serverConfiguration: ServerConfiguration? = null, val testMode: Boolean = false, val customSearchParameters: List<SearchParameter>? = null)

Configuration for the FHIR Engine, including database setup, error recovery, server connection, and custom search parameters.

Database Encryption:

Database encryption is only available on API 23 (Android 6.0) or above. If enableEncryptionIfSupported is true, the FHIR SDK will only enable database encryption on supported devices.

WARNING: If database encryption is enabled, devices that are on API 22 (Android 5.1) or lower will have an unencrypted database. If those devices are later updated to API 23 or newer, they will encounter an IllegalStateException. This is because the database was created without encryption on the older API level, and enabling encryption in the new release will not retroactively encrypt the existing database, causing the app to try to decrypt an unencrypted database.

Constructors

Link copied to clipboard
constructor(enableEncryptionIfSupported: Boolean = false, databaseErrorStrategy: DatabaseErrorStrategy = UNSPECIFIED, serverConfiguration: ServerConfiguration? = null, testMode: Boolean = false, customSearchParameters: List<SearchParameter>? = null)

Properties

Link copied to clipboard

Additional search parameters to be used for querying the FHIR engine with the Search API. These are in addition to the default search parameters defined in the FHIR specification. Custom search parameters must be unique and not change existing or default search parameters.

Note: The engine does not automatically reindex resources after new custom search parameters are added. You must manually reindex resources by updating them. Any new CRUD operations on a resource after adding new search parameters will automatically trigger reindexing.

Link copied to clipboard

The strategy to handle database errors. Defaults to DatabaseErrorStrategy.UNSPECIFIED.

Link copied to clipboard

Enables database encryption if supported by the device. Defaults to false.

Link copied to clipboard

Optional configuration for connecting to a remote FHIR server.

Link copied to clipboard
val testMode: Boolean = false

Whether to run the engine in test mode (using an in-memory database). Defaults to false.