SlimSlim/Patient

Check patient name exists

  • Sandbox: available
  • Staging: available
  • Production: unknown
POST
/v1/slim/patient/check-name-exists

Checks whether a Resident ID (the resident's nickname) is already used in your project. Use it to validate the Resident ID field before you create or rename a resident.

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:read (an admin or super admin who holds no access policy skips this check). Scope: Residents in the caller's project (from the token).

Behaviour

  • Read-only.
  • Only the name entry with use: "nickname" is compared. Official and maiden names are ignored. Without a nickname entry the answer is exists: false.
  • A match needs the same given tokens in the same order and the same family (or no family on both sides). Tokens are trimmed and compared case-insensitively.
  • When you edit an existing resident, pass their id as excludePatientId so their own record does not count as a match.
  • The create and update routes run the same check, so a true here means those requests would be refused with a 422.

Example

curl -X POST 'https://api.sandbox.ovok.com/v1/slim/patient/check-name-exists' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \  -H 'Content-Type: application/json' \  -d '{    "name": [{ "use": "nickname", "given": ["Maxi"] }],    "excludePatientId": "c3499c27-2973-0a7f-807e-fb8676a92dcb"  }'
{ "exists": false }

Authorization

bearer
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
name*array<>
Items1 <= items
excludePatientId?string

Response Body

Result of the name existence check.

application/json
  1. response
exists*boolean
Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/slim/patient/check-name-exists' \  -H 'Content-Type: application/json' \  -d '{  "name": [    {      "use": "official"    }  ]}'
Example Response
{  "exists": true}

Update patient PUT

Updates a resident (patient): names, gender, birth date, placement on devices, room and zone, and resident state (discharge or reactivation). **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:update`, plus `Device:update` when the request changes which devices the resident is on (an admin or super admin who holds no access policy skips this check). **Scope:** The resident must belong to the caller's project (from the token). Devices, rooms and zones you reference must be in your project, its parent project, or one of its sub-projects. ## Behaviour The body is a full replacement of the editable fields, designed so that the result of `GET /v1/slim/patient/{id}` can be sent back unchanged. Fields the update does not declare, such as `id`, `floor` or `admissionDate`, are ignored. - `name` replaces all of the resident's names, each trimmed of leading and trailing spaces. It must contain a `nickname` entry with a non-blank first `given` value. If the nickname changes, it must be unique in the project. - `gender` and `birthDate` are replaced. Omitting them, or sending `""`, clears them. - **Placement depends on `locationId`:** - **`locationId` omitted or `""`: the resident is removed from all of their devices**, and `deviceId` and `organizationId` are ignored. Send the current `locationId` to keep the placement. - `locationId` with `deviceId`: the resident is placed on those devices, and the devices move to the room. The resident leaves any other device. A resident already on one of those devices is replaced. - `locationId` without `deviceId`: the resident is placed on the room's device. The room must have exactly one device. - `locationId` with `deviceId` `null`, `[]` or `""` is refused with 422 and changes nothing: a room is not a placement without a device. - A resident in a room is in the room's zone. An `organizationId` that differs from the zone of the room the resident stays in answers 422 with `path: ["organizationId"]` and changes nothing: move the room to that zone with `PUT /v1/slim/location/{id}`, or the resident to a room in it. A resident moving to another room takes that room's zone. When the room has no zone, `organizationId` re-zones the resident's devices. - A save that puts the resident on devices in more than one zone, when they were not in exactly those zones before, is refused with 422. - A discharged resident (`discharged` or `discharged-recent`) placed on a device they are not on is refused with 422 and nothing changes, with or without `deviceId`. Send `residentState: "active"` in the same save to reactivate and place them. - `residentState`: - `discharged` on an active resident: the resident is tagged discharged, `dischargeDate` is stored (default: now), the `EpisodeOfCare` is finished, and the resident is removed from all devices. `locationId` must be omitted or `""`. - `discharged` on a resident already discharged: only a different `dischargeDate` has an effect; it corrects the stored date. - `active` on a discharged resident: the resident is reactivated, the latest `EpisodeOfCare` is reopened and `dischargeDate` is removed. - Other values, or the current state, change nothing. - Any resident who loses a device in this request has their active out-of-bed notification revoked in the same write, and the device's live telemetry state is cleared afterwards. - Archived residents cannot be updated. - The write is atomic and takes a short write lock on the resident, the devices and, on a rename, the new Resident ID. - Change-history entries are added for each changed field and assignment. A resident replaced on a device gets one naming the device, and the room and zone they leave with it. - The response is the resident after the update, in the same shape as `GET /v1/slim/patient/{id}`. ## Example ```bash curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/patient/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": [{ "use": "nickname", "given": ["Maxi"] }], "gender": "male", "birthDate": "1940-05-01", "deviceId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "locationId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "organizationId": "87ea5dfc-8b8e-384d-8489-79496e706390", "residentState": "active" }' ```

List access policies GET

Lists the access policies (roles) of a project, each with the practitioners who hold it. Use it to render a roles table. **Auth:** Bearer token for a practitioner, project admin or System Owner session. The caller's access policy must grant `Practitioner:create`, the right to invite users (a project admin who holds no access policy skips this check). **Scope:** The caller's project (from the token), or `projectId` when given. `projectId` must be the caller's project or a direct child of it. ## Behaviour - Each row is `{ policy, members }`. `members` lists only `Practitioner` members, as `{ reference, display }`. - `profile` keeps only the policies held by that member, given as a reference such as `Practitioner/<id>`. - `sortBy` is `_id` (default), `_lastUpdated` or `name`; `orderBy` is `ASC` (default) or `DESC`. Rows with an empty sort value go last in `ASC` and first in `DESC`. - Paging is in memory: `page` (default `0`) and `count` (default `20`, 1 to 100). `total` counts the rows after filtering, before paging. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/slim/policy?sortBy=name&orderBy=ASC&page=0&count=20' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```