bid— your business ID, provided by Eka Care when your account is set up.patientId— the OID of the logged-in user whose cases you are working with.
List Cases
listCases is cache-first: fires onStale immediately with IndexedDB data, then delta-syncs with the server and resolves the promise with fresh results.
Create a Case
Offline: the case is saved locally (
isRemoteCreated: false) and created
on the server on reconnect.Update a Case
Delete a Case
Deletes the case only — the records inside it are not deleted. They just lose the link to this case (the case ID is removed from each record’scaseIDs) and remain available in the record list.
Assigning Records to Cases
The case–record link lives on the document, not the case — every record carries acaseIDs: string[] array, and there is no case-side “add documents” method. Both directions are handled through the record APIs.
Assign at upload time
Passcases in the batch item of addDocument:
Assign / unassign an existing document
UseeditDocument with data.cases. This is local-first — the DB is patched immediately and synced to the server in the background.
Assign multiple documents to a case
There is nocase.addDocuments() — loop editDocument over the documents:
Reading the relationship
deleteCase strips that case ID from all linked records’ caseIDs, and deleteDocument removes the document from any linked cases.
