List recent notifications
- Sandbox: available
- Staging: available
- Production: unknown
Lists the newest active notifications stored as CommunicationRequests for your project, of every type (such as out-of-bed, device alarms and attention presses). Use it for a notification bell. For filtered or paged history, use the out-of-bed and alarm feeds.
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 CommunicationRequest:read and CommunicationRequest:search (an admin or super admin who holds no access policy skips this check).
Scope: The caller's project (from the token).
Behaviour
- Returns at most
countrows (1 to 50, default 20), newest first by event time. - Rows come from a Redis copy of the active notifications when that copy is enabled and loaded, and from a FHIR store search otherwise.
warmistrueandsourceisredisfor the first case;warmisfalseandsourceisfhirStorefor the second. A cold read also starts loading the Redis copy in the background, so a later call can be warm. - The Medplum search returns
activenotifications updated within the last year. totalcounts the active notifications the source knows about, capped at the list result cap (1,000 by default). From Medplum it is an estimate.locationNameis the room's current name, read from the Location as on the notification lists, so a renamed room shows its new name on every row, old alerts and new. When rows come from Redis, that lookup is cached per caller for up to a minute and dropped when a room is renamed through this API. If the caller cannot read the Location, or the lookup takes more than 2 seconds, a row keeps the name it was raised with.- Rows whose notification type cannot be resolved are left out.
- Medical notifications (heart rate, respiratory rate and other vitals) are decided by Signals and served by
GET /v1/slim/notifications/recent/medical. To show one type only, useGET /v1/slim/notifications/recent/ooborGET /v1/slim/notifications/recent/alarms.
Example
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/notifications/recent?count=20' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'bearerAuthorizationBearer <JWT>count?integer1 <= value <= 5020Recent notifications retrieved successfully.
application/json- response
recent*array<>total*integer0 <= valuewarm*booleansource*string"redis""fhirStore""signals"curl -X GET 'https://api.sandbox.ovok.com/v1/slim/notifications/recent'{ "recent": [ { "commId": "string", "patientId": "string", "patientName": "string", "deviceId": "string", "deviceName": "string", "deviceStatus": "string", "locationId": "string", "locationName": "string", "color": "string", "trigger": "above", "type": "hr", "status": "draft", "details": { "threshold": 0, "value": 0, "level": "string" }, "authoredOn": "2019-08-24T14:15:22Z", "alertCount": 0, "occurrenceDateTime": "2019-08-24T14:15:22Z", "episodeEndedAt": "2019-08-24T14:15:22Z", "effectiveTimestamp": "2019-08-24T14:15:22Z", "latestObservationTimestamp": "2019-08-24T14:15:22Z", "alarm": { "episodeId": "string", "severity": "RED", "type": "string", "text": "string" }, "noteCount": 0, "closeReason": "string" } ], "total": 0, "warm": true, "source": "redis"}Update location PUT
Updates a location: its name, floor, room, bed and zone, the devices at it, and the resident on those devices. **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 `Location:update` and `Device:update` (an admin or super admin who holds no access policy skips this check). **Scope:** The location must belong to the caller's project (from the token). Devices and residents you attach must be in your project or one of its sub-projects. The zone must be in your project, a sub-project, or the parent project. ## Behaviour - `name` is required and must be unique among the locations your token can search, not counting this one. - `floor`, `room`, `bed`: an omitted field keeps its current value. If the zone, floor, room or bed changes, the new combination must not match another location's. - `organizationId`: - omitted: the zone is unchanged. - `null`: the zone is removed from the location and from every device at it. - an id: the location and every device at it move to that zone. Residents on those devices move too. - `deviceId` (one id or a list): - omitted: the devices at the location are unchanged. - a list: it becomes the full set of devices at the location. Devices not in the list are detached; new ones are attached. `null` or `[]` detaches all devices. - Devices that hold a discharged resident cannot be attached. - `patientId`: - an id: that resident is assigned to the devices in `deviceId`, or, when `deviceId` is omitted or empty, to the single device at the location. The resident is first removed from any other device. A resident already on a target device is replaced. A discharged resident is refused. - **omitted: every resident is removed from every device at the location and every device in `deviceId`.** To keep the current resident, send their `patientId`. - A resident who loses a device has their active out-of-bed notification revoked in the same write, and the device's live telemetry state is cleared afterwards. - Device use history is updated for every device whose resident changes. - The write is atomic and takes a short write lock. A concurrent write to the same resources, or a device reassigned by someone else while this request ran, gets a 409. - Every save adds a location-updated entry to the change history. Residents who move into a new zone, or lose a device, also get an entry in their own change history. - The response is the location after the update, in the same shape as `GET /v1/slim/location/{id}`. - If another location has the same zone, floor, room and bed, the request is refused with 409 and the body carries `existingLocationId` and `existingLocationName`. ## Example ```bash curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/location/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "Room 201", "floor": "2", "room": "201", "bed": "A", "organizationId": "87ea5dfc-8b8e-384d-8489-79496e706390", "deviceId": ["c3499c27-2973-0a7f-807e-fb8676a92dcb"], "patientId": "c3499c27-2973-0a7f-807e-fb8676a92dcb" }' ```
List recent medical notifications GET
Lists the newest open, unacknowledged medical notifications for your project. Use it for a medical notification bell. Medical episodes are decided by Signals; Ovok reads them from Signals and adds the resident context. **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`, `Device:read` and `Location:read` (an admin or super admin who holds no access policy skips this check). **Scope:** The caller's project (from the token), applied on both sides: Signals filters on the resident's project stamp, and Ovok checks each resolved resident against your project. ## Behaviour - The filter is fixed by the server: open, unacknowledged episodes, newest last notification first (`episode.lastFiringAt`, or `episode.openedAt` when that is null), at most `count` (1 to 50, default 20). Every row's `episode.status` is `OPEN`. An episode leaves the bell when it closes, whether or not anyone acknowledged it. Closed episodes stay in `GET /v1/slim/notifications/medical`, where they can still be acknowledged with `POST /v1/slim/notifications/medical/{episodeId}/ack`. - An open episode is listed however many closed episodes fired after it. - Rows have the same shape as `GET /v1/slim/notifications/medical`, including `episode.firedBand`. - `nextCursor` is set when the page is full, so more open, unacknowledged episodes may exist. A bell can ignore it. - A resident who cannot be resolved into your project is left out, so a page can hold fewer than `count` rows. - A resident with no Signals project stamp matches no project and does not appear. - When the project's Signals tenant has episodic alerts switched off, the list is empty. - A 503 with `signals_unavailable` means Signals could not be reached, not that there are no notifications; retry after `retryAfterSec`. - Out-of-bed is not here; read `GET /v1/slim/notifications/recent/oob`. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/slim/notifications/recent/medical?count=20' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```