Signals API - Alerts

List alerts, or the episodes they were folded into

  • Sandbox: available
  • Staging: available
  • Production: unknown
GET
/v1/signals/api/alert

The dashboard view.

By default this is one row per breach, in v1's alert shape plus every nest alert field, inside v1's paginate envelope (items, totalItems, page, totalPages, …) with nest's nextCursor beside it. Page with v1's page and limit (a page may start at most 10000 rows in), or walk with cursor: pass nextCursor back verbatim. sort is v1's time-desc (the default) or time-asc; ids narrows to those patients. It works whether or not the tenant has episodicAlerts. Without project it is tenant-wide: a per-facility view must send project, which keeps only patients stamped with it.

?episodes=true answers with episodes instead, as {items, nextCursor}: one row per clinical event, which opens on the first breaching reading, absorbs the rest, and closes on recovery, on going stale, or by hand. That grain REQUIRES project. It defaults to the tenant's feedCodes (PATCH /api/tenant), every code when it lists none; alerts have no code default.

codes, since and acknowledged filter either grain. until, page and ids are alerts only: sending one with episodes=true is a 422, not a filter that silently did nothing. status reads ACTIVE/RESOLVED for alerts and OPEN/CLOSED for episodes.

Episodes are newest first by sort: openedAt, the default, or lastFiringAt, the newest firing reading (the opening, for an episode that has none). since and the cursor use the same time. openedAt never changes, so walking every page lists each episode once. On lastFiringAt an episode that fires mid-walk moves above the cursor: it is never listed twice, but that walk misses it. A sort value from the other grain is a 422.

Through ovok

  • Who can call it: Manager apps, and users whose access policy grants the capabilities.
  • Capabilities, all required: signals_alerts:read. Project admins have every capability; client applications get no admin bypass.
  • ovok sets project to your project, so you can leave it out.
  • If your access covers only some patients (anyone but project admins, manager or submitter apps, and anyone whose Patient access has no criteria), name them with patientId or ids, each one you can read, at most 100. Signals then pages over just those patients, so pages and totals stay true. A patient is named by its Signals id, or by its Medplum Patient id where Signals takes a refId; ovok asks Signals which patient a Signals id is.

Authorization

headerAuthorizationBearer <JWT>

Query Parameters

episodes?boolean

Return episodes rather than the individual breaches they were folded from.

An episode is one continuous clinical event for a (patient, code) pair: it opens on the first breaching reading, absorbs the rest, and closes on recovery, on going stale, or by hand. The default answers one row per breach, which is the duplication episodes exist to collapse.

Requires project, and changes which of the filters below are accepted.

patientId?string
Lengthlength <= 200
ids?array<string>

v1's patient filter: only these patients' alerts, by Signals id. Repeat the parameter or separate with commas. Alerts only.

status?string

ACTIVE or RESOLVED for alerts; OPEN or CLOSED with episodes=true.

Value in"ACTIVE""RESOLVED""OPEN""CLOSED"
codes?array<string>

Restrict to these LOINC codes.

On episodes it defaults to the tenant's feedCodes, every code when it lists none. Alerts have no default: absent, every alert, including those that carry no code.

Itemsitems <= 32
since?string

Alerts raised, or episodes whose sort time is, at or after this instant: opened by default, last fired with sort=lastFiringAt.

until?string

Alerts raised before this instant. Alerts only.

acknowledged?boolean

Filter on whether the episode, or the alert, has been acknowledged.

sort?string

On alerts, v1's order: time-desc (the default) or time-asc.

On episodes, which time they are listed by, newest first; since and cursor use it too. openedAt (the default) never changes, so a walk of every page sees each episode once. lastFiringAt is the newest firing reading, or the opening for an episode that has none; an episode that fires mid-walk moves above the cursor.

Value in"time-desc""time-asc""openedAt""lastFiringAt"
page?number

v1's 1-based page of limit alerts. A page may start at most 10000 rows in; walk further with cursor. Alerts only.

Range1 <= value
limit?number
Range1 <= value
cursor?string
Lengthlength <= 512
tags[key]?string

v1's tag filter: only patients whose tags.key equals one of the comma-separated values, or holds one in an array. Repeat with other keys to require them all. Keys are alphanumeric; tags.key= is accepted too.

Response Body

A page of alerts, or of episodes, plus the cursor for the next one.

application/json
  1. response
totalItems*number
limit*number
page*number

1-based.

totalPages*number

At least 1, even for an empty list.

pagingCounter*number

The 1-based position of the first item on this page.

hasPrevPage*boolean
hasNextPage*boolean
prevPage*number
nextPage*number
nextCursor*string

Opaque keyset cursor. Pass it back as cursor for the next page; null means this page was the last. Do not construct or parse it.

items*array<>
Example Request
curl -X GET 'https://api.sandbox.ovok.com/v1/signals/api/alert'
Example Response
{  "totalItems": 0,  "limit": 0,  "page": 0,  "totalPages": 0,  "pagingCounter": 0,  "hasPrevPage": true,  "hasNextPage": true,  "prevPage": 0,  "nextPage": 0,  "nextCursor": "string",  "items": [    {      "id": "string",      "tenantId": "string",      "patientId": "string",      "observationId": "string",      "status": "ACTIVE",      "code": "string",      "dedupKey": "string",      "message": "string",      "valueNumber": 0,      "valueString": "string",      "triggerCode": "string",      "triggerVersion": 0,      "createdAt": "2019-08-24T14:15:22Z",      "resolvedAt": "2019-08-24T14:15:22Z",      "acknowledgedAt": "2019-08-24T14:15:22Z",      "acknowledgedBy": "string",      "acknowledgedActor": {        "reference": "string",        "display": "string"      },      "observationEffectivePeriod": {        "start": "2019-08-24T14:15:22Z",        "end": "2019-08-24T14:15:22Z"      },      "limitSeconds": 0,      "_id": "string",      "reason": "trigger",      "observation": "string",      "component": {        "code": {},        "valueQuantity": {},        "valueString": "string"      },      "trigger": {},      "updatedAt": "2019-08-24T14:15:22Z",      "patient": {        "id": "string",        "tags": {},        "metadata": {},        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    }  ]}

Reset user password with the information from the email. POST

Sets a new password using the `id` and `secret` from a reset email. Use it when your app handles the reset itself instead of sending the user to the emailed link. **Auth:** none. The reset request `id` and `secret` are the credential. ## Behaviour - The `id` and `secret` come from the email sent by `POST /v2/auth/reset-password`. The `password` is the new password. - The password must have at least 12 characters, not counting spaces at either end, and must not be on Ovok's list of common and breached passwords. Any character is allowed and none is required. A refused password answers 422 with the error on `password`. - An invite link (from `POST /auth/invite` or a practitioner invite) sets a password for 7 days after it was sent. After that it answers 410 `This invite link has expired. Ask for a new invite.`, and inviting the user again sends a fresh link. Reset links are not limited this way. - A request can be used once. Ovok marks it used before it changes the password, so a request whose password change then fails cannot be retried and the user must ask for a new email. - Setting the password also marks the user's email as verified, because the secret came by email. - The response is a minimal `User` with `resourceType`, `id` and `email`. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v2/auth/reset-password/process' \ -H 'Content-Type: application/json' \ -d '{ "id": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "secret": "k3J9xQ2mV7", "password": "Ex4mple-Passw0rd" }' ```

Get one alert, or one episode with its readings GET

The path segment is an alert id, or an episode id with `episodes=true`. An alert reads whether or not the tenant has `episodicAlerts`. An episode comes with its summary, its acknowledgement and every value recorded for its code while it ran. The series starts at the first breaching reading. A long episode returns a capped series and sets `truncated`. ### Through ovok - **Who can call it:** Manager apps, and users whose access policy grants the capabilities. - **Capabilities, all required:** `signals_alerts:read`. Project admins have every capability; client applications get no admin bypass. - ovok sets `project` to your project, so you can leave it out. - If your access covers only some patients (anyone but project admins, manager or submitter apps, and anyone whose Patient access has no criteria), the alert's patient must be one you can read: ovok reads the alert first. A patient is named by its Signals id, or by its Medplum Patient id where Signals takes a `refId`; ovok asks Signals which patient a Signals id is.