LocalChangeEntity

data class LocalChangeEntity(id: Long, resourceType: String, resourceId: String, timestamp: String, type: LocalChangeEntity.Type, payload: String, versionId: String?)

When a local change to a resource happens, the lastUpdated timestamp in ResourceEntity is updated and the diff itself is inserted in this table. The value of the diff depends upon the type of change and can be:

  • DELETE: The empty string, "".

  • INSERT: The full resource in JSON form, e.g. {

    "resourceType": "Patient",
"id": "animal",
"name": [
{
"use": "usual",
"given": [
"Kenzi"
]
}
],
...

}

  • UPDATE: A RFC 6902 JSON patch. e.g. a patch that changes the given name of a patient: [

    {
"op": "replace",
"path": "/name/0/given/0",
"value": "Binny"
}

] For resource that is fully synced with server this table should not have any rows.

Constructors

Link copied to clipboard
fun LocalChangeEntity(id: Long, resourceType: String, resourceId: String, timestamp: String = "", type: LocalChangeEntity.Type, payload: String, versionId: String? = null)

Types

Link copied to clipboard
enum Type : Enum<LocalChangeEntity.Type>

Properties

Link copied to clipboard
val id: Long
Link copied to clipboard
val payload: String
Link copied to clipboard
val resourceId: String
Link copied to clipboard
val resourceType: String
Link copied to clipboard
val timestamp: String
Link copied to clipboard
val type: LocalChangeEntity.Type
Link copied to clipboard
val versionId: String? = null