DataMigration

@Singleton
class DataMigration @Inject constructor(val defaultRepository: DefaultRepository, val configurationRegistry: ConfigurationRegistry, val preferenceDataStore: PreferenceDataStore, val parser: IParser, val dispatcherProvider: DispatcherProvider, val resourceDataRulesExecutor: ResourceDataRulesExecutor, val fhirPathDataExtractor: FhirPathDataExtractor, val eventBus: EventBus, val context: Context)

The main functionalities of the DataMigration class are:

  • Migrating data by updating resources based on a set of data queries and key-value configurations.

  • Retrieving the latest migration version from shared preferences.

  • Performing the migration only if the new version is greater than or equal to the latest migration version.

Constructors

Link copied to clipboard
@Inject
constructor(defaultRepository: DefaultRepository, configurationRegistry: ConfigurationRegistry, preferenceDataStore: PreferenceDataStore, parser: IParser, dispatcherProvider: DispatcherProvider, resourceDataRulesExecutor: ResourceDataRulesExecutor, fhirPathDataExtractor: FhirPathDataExtractor, eventBus: EventBus, context: Context)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val parser: IParser

Functions

Link copied to clipboard
suspend fun migrate()

suspend fun migrate(migrationConfigs: List<MigrationConfig>?, previousVersion: Int)

This function is responsible for migrating data by updating the resources based on the provided data queries and key-value configurations. It retrieves the latest migration version from shared preferences and performs the migration only if the new version is greater than or equal to the latest migration version.