purge

abstract suspend fun purge(type: ResourceType, id: String, forcePurge: Boolean = false)

Purges a resource from the database without deleting data from the server.

Parameters

type

The ResourceType of the resource.

id

The resource ID.

forcePurge

If true, the resource will be purged even if it has local changes. Otherwise, an IllegalStateException will be thrown if local changes exist. Defaults to false.

If you need to purge resources in bulk use the method FhirEngine.purge(type: ResourceType, ids: Set, forcePurge: Boolean = false)


abstract suspend fun purge(type: ResourceType, ids: Set<String>, forcePurge: Boolean = false)

Purges resources of the specified type from the database identified by their IDs without any deletion of data from the server.

Parameters

type
ids

The resource ids Set<Resource.id>

forcePurge

If true, the resource will be purged even if it has local changes. Otherwise, an IllegalStateException will be thrown if local changes exist. Defaults to false.

In the case an exception is thrown by any entry in the list the whole transaction is rolled back and no record is purged.