SlimSlim/Patient

List patients

  • Sandbox: available
  • Staging: available
  • Production: unknown
GET
/v1/slim/patient

Lists the residents (patients) of your project with their zone, room, device and settings tags. Use it for the residents table in the Slim dashboard.

Auth: Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant Patient:search, Patient:read, Device:read, Location:read and Organization:read (an admin or super admin who holds no access policy skips this check). Scope: The caller's project (from the token). A token without a project is refused.

Behaviour

  • Read-only.
  • One row per resident. When a resident is on several devices, the row shows one of them, so a resident is never listed twice.
  • residentState defaults to active, so discharged residents are hidden unless you ask for them. discharged-recent means discharged within the last 30 days; discharged means longer ago. all turns the filter off.
  • includeDischargedRecent=true widens residentState=active or residentState=discharged to also include discharged-recent residents.
  • organizationId keeps residents in that zone. hasDevice=true keeps residents with a device; hasDevice=false keeps residents without one.
  • medicalSettings and bedActivitySettings keep residents with that settings tag. These tags are null when Ovok could not read the project's threshold settings; such rows match no settings filter.
  • search is a case-insensitive substring match on the resident's name, nickname, room name and zone name.
  • Sort with sortBy (default patientName) and orderBy (ASC or DESC, any case, default ASC).
  • Pagination is zero-based: page (default 0) and count (default 20, max 100). total counts all matching rows.
  • Fields with no value are null.
  • Results are cached for up to 60 seconds per user. A change to a resident, device, room or zone made through Ovok clears the cache.

Example

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/patient?residentState=active&sortBy=patientNickname&orderBy=asc&page=0&count=20' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'

Authorization

bearer
headerAuthorizationBearer <JWT>

Query Parameters

page?string
Default"0"
count?string
Default"20"
sortBy?string
Default"patientName"
Value in"patientName""patientNickname""organizationName""locationName""admissionDate""dischargeDate""medicalSettings""bedActivitySettings"
orderBy?string
Default"ASC"
Value in"ASC""DESC"
search?string
Length1 <= length
residentState?string
Default"active"
Value in"active""discharged-recent""discharged""archived""all"
includeDischargedRecent?string
organizationId?string
Length1 <= length
hasDevice?string
medicalSettings?string
Value in"inactive""global""individual"
bedActivitySettings?string
Value in"inactive""global""individual"

Response Body

Patients retrieved successfully.

application/json
  1. response
total*number
Range0 <= value
page*number
Range0 <= value
count*number
Range1 <= value
resources*array<>
Example Request
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/patient'
Example Response
{  "total": 0,  "page": 0,  "count": 1,  "resources": [    {      "id": "string",      "name": "string",      "nickname": "string",      "residentState": "active",      "admissionDate": "string",      "dischargeDate": "string",      "organizationId": "string",      "organizationName": "string",      "locationId": "string",      "locationName": "string",      "deviceId": "string",      "deviceName": "string",      "medicalSettings": "inactive",      "bedActivitySettings": "inactive"    }  ]}

Create organization POST

Creates an organization (a zone in the Slim dashboard), optionally as a child of another zone. **Auth:** Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant `Organization:create` (an admin or super admin who holds no access policy skips this check). **Scope:** The organization is created in the caller's project (from the token). A super-admin caller can pass `?projectId=<uuid>` to create it in that project instead. Any other caller who passes `projectId` gets a 403. ## Behaviour - `name` must be unique. The check is an exact name match against the organizations your token can search. With `?projectId`, the check runs in that project only. - `parentOrganizationId`, when set, must name an organization in your own project. A sub-project's or parent project's organization is refused. The new zone's `partOf` points at it. - `description`, when non-empty, is stored as the organization's narrative text. `null` or an empty string stores nothing. - The write is atomic and takes a short write lock. A concurrent write to the same resources gets a 409. - A zone-created entry is added to the change history. A failure to write that entry does not fail the request. - The response is the created organization, in the same shape as `GET /v1/slim/organization/{id}`. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/slim/organization' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "Ward A", "parentOrganizationId": "87ea5dfc-8b8e-384d-8489-79496e706390", "description": "Ground floor" }' ```

Create patient POST

Creates a resident (patient), optionally placed on devices, in a room and in a zone, and registers them with Signals. **Auth:** Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant `Patient:create`, plus `Device:update` when `deviceId` is set (an admin or super admin who holds no access policy skips this check). **Scope:** The resident is created in the caller's project (from the token). A super-admin caller can pass `?projectId=<uuid>` to create it in that project instead. Any other caller who passes `projectId` gets a 403. Devices, rooms and zones you reference must be in your project, its parent project, or one of its sub-projects. ## Behaviour - `name` must contain an entry with `use: "nickname"` and a non-blank first `given` value. This is the Resident ID. - The Resident ID must be unique in the project, compared as in `POST /v1/slim/patient/check-name-exists`. - `admissionDate` defaults to now. It cannot be later than the start of the current day. - The resident is created as `active`, and an `EpisodeOfCare` is opened for the admission. - Placement: - `deviceId` (one id or a list): the resident is assigned to those devices. A device that already has a resident is reassigned to the new one, and the resident who had it loses it, with its room, as on `PUT /v1/slim/patient/{id}`. - `locationId` with `deviceId`: those devices are also moved to the room. - `locationId` without `deviceId`: the resident is assigned to the room's device. The room must have exactly one device. - `organizationId` without `locationId` or `deviceId` is refused with 422: a resident's zone is read from their device, so a zone alone would not show. - `organizationId`: the resident is placed in the zone. When `deviceId` is set, those devices and their rooms move to the zone too. - Without `organizationId`, the resident's zone is their device's: the room's zone, else the device's own. Devices in more than one zone are refused with 422. - The resident is registered with Signals in the same request. If that fails, everything this request wrote is rolled back and you get a 503 with `error: "signals_mint_failed"`. You can retry. - The write is atomic and locks the Resident ID and the devices, so two concurrent creates of the same Resident ID leave one resident. - Change-history entries are added for each assignment, including the zone the resident gets from their device, and for a resident who lost a device to the new one. - The response is the created resident, in the same shape as `GET /v1/slim/patient/{id}`. - If the resident cannot be registered with Signals, the create is rolled back and the request fails with 503. Retry it. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/slim/patient' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": [ { "use": "nickname", "given": ["Maxi"] }, { "use": "official", "given": ["Max"], "family": "Mustermann" } ], "gender": "male", "birthDate": "1940-05-01", "deviceId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "locationId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "organizationId": "87ea5dfc-8b8e-384d-8489-79496e706390" }' ```