Projects

Get project patient counts

Get project patient counts using Ovok’s Slim API.

MethodPath
GET/v1/slim/project/:id/patient-counts

Authentication · Access policies

Returns summary counts of the residents in a project by state: active, recently discharged, discharged and archived. Use it for project overview tiles.

Auth: Bearer token. The caller's access policy must grant Patient:search and Patient:read (project admins skip this check). Scope: The project in the path. It must be the caller's project (from the token) or a direct child of it.

Request

Path parameters

NameTypeRequiredDescription
idstringYesProject id. Your own project or a direct child of it.

Behaviour

  • Counts come from the project's live device list, so only residents linked to a device row are counted. A resident without a device is not included.
  • Each resident is counted once, even when linked to several devices.
  • A row is left out when its device, resident, location or organization belongs to another project.
  • The device list is cached, so a change can take a moment to show. If the list fails to build, the last complete list is used. When there is none, the route answers 503. When there is none, the route answers 503.

Example

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/project/b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68/patient-counts' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response

200 — Patient counts retrieved successfully.

{
  "projectId": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68",
  "totalPatientCount": 36,
  "activePatientCount": 34,
  "dischargedRecentPatientCount": 2,
  "dischargedPatientCount": 0,
  "archivedPatientCount": 0
}
FieldTypeDescription
projectIdstring (uuid)The project id from the path.
totalPatientCountintegerResidents linked to a device. Each is counted once.
activePatientCountintegerResidents in state active.
dischargedRecentPatientCountintegerResidents in state discharged-recent.
dischargedPatientCountintegerResidents in state discharged.
archivedPatientCountintegerResidents in state archived.

Errors

StatusMeaning
400The project is neither the caller's project nor a direct child of it.
401The bearer token is missing or invalid.
403The session has no profile, or its access policy lacks Patient:search or Patient:read.
422id is empty.
503The device list cannot be built and no earlier complete list exists. Retry shortly.

Last updated on

On this page