Local Change Entity
data class LocalChangeEntity(id: Long, resourceType: String, resourceId: String, timestamp: String, type: LocalChangeEntity.Type, payload: String, versionId: String?)
Content copied to clipboard
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"
]
}
],
...
Content copied to clipboard
}
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"
}
Content copied to clipboard
] 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)
Content copied to clipboard