Skip to main content
A dataset is your own catalog of one kind of clinical item: your drug formulary, your lab test menu, or your lists of symptoms and diagnoses. The Datasets API lets you load these catalogs into Eka, keep them in sync with your system, and switch Eka’s Medical Database search over to them. Every request acts only on the workspace your access token belongs to. You cannot read or change another workspace’s data.

Dataset types

Every endpoint takes a type query parameter: Records are identified by your id. Writing a record whose id already exists updates it.

Endpoints

For medications, use a form_name from the accepted drug forms so the drug is linked to Eka’s dosage form.

Keeping a catalog in sync

To mirror a catalog from your system on a schedule, send the whole catalog each time in reconcile mode. Records you no longer send are deactivated, not deleted, so sending them again restores them.
1

Dry run

POST /admin/datasets/v1/?type=medication&mode=reconcile&dry_run=true with the full catalog. Nothing is written; the response shows how many records would be inserted, updated, reactivated and deactivated.
2

Commit

If the counts look right, send the same request without dry_run. If more than half of your catalog would be deactivated, the request is rejected with a shrink_guard error, the usual sign of a truncated export. Pass confirm_shrink=true only if you really mean it.
3

Verify

For CSV uploads, GET /admin/datasets/v1/batches/?type=medication shows the latest batch and its row counts.
4

Enable search (first sync only)

POST /admin/datasets/v1/search-status/?type=medication with {"enabled": true}. Later syncs don’t need to repeat this. Set it back to false to roll back.

Writes are all-or-nothing

If any record or CSV row fails validation, nothing in the request is written. The errors list in the response names every failing record, field and value, so you can fix them all at once.

Limits

  • Request bodies are limited to 10 MB. For a larger catalog, send it as several upsert requests (a reconcile must contain the whole catalog in one request).
  • A request must finish within 29 seconds.
  • List and batch pages return at most 1000 items (limit, default 100).

Authentication

All endpoints require an access token in the Authorization header:
See Authorization for how to get one.