Zones

Get zone detail

Get zone detail using Ovok’s Slim API.

MethodPath
GET/v1/slim/zones/:zoneId

Authentication · Access policies

Returns one zone with all of its locations and the devices and residents assigned to each location. A zone is a FHIR Organization. Use it for a zone drill-down view.

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:read and Location:read (admins and super admins skip this check). Scope: The zone must belong to the caller's project (from the token), its parent project, or one of its sub-projects.

Request

Path parameters

NameTypeRequiredDescription
zoneIdstring (uuid)YesZone (organization) id.

Behaviour

  • Returns every location whose managing organization is the zone; there is no paging.
  • Each location carries floor, room and bed when set, and its devices and residents. Devices and residents are sorted by name in natural order (so "Bed 2" sorts before "Bed 10").
  • A location with no devices has empty devices and residents lists.

Example

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/zones/1e6b8d30-2c4f-4a95-8d7e-b0a2c4e6f918' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response

200 — Zone detail with nested locations, devices and residents.

{
  "id": "1e6b8d30-2c4f-4a95-8d7e-b0a2c4e6f918",
  "name": "Zone A",
  "locations": [
    {
      "id": "5d2a9c64-7e1b-4830-b6f5-9a3c1e8d7b02",
      "name": "Room 101 Bed 1",
      "floor": "1",
      "room": "101",
      "bed": "1",
      "devices": [{ "id": "8c5e7a21-4b9d-4f36-a1c8-0d2e6b9f3a54", "name": "Demo/1000001" }],
      "residents": [{ "id": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21", "name": "demo-resident" }]
    }
  ]
}
FieldTypeDescription
idstring (uuid)Zone id.
namestringZone name.
locationsobject[]Every location in the zone.
locations[].idstring (uuid)Location id.
locations[].namestringLocation name.
locations[].floorstringFloor code. Left out when not set.
locations[].roomstringRoom code. Left out when not set.
locations[].bedstringBed code. Left out when not set.
locations[].devicesobject[]Devices at the location, sorted by name. Empty array when there are none.
locations[].devices[].idstring (uuid)Device id.
locations[].devices[].namestringDevice name. Left out when it has none.
locations[].residentsobject[]Residents on those devices, once each, sorted by name. Empty array when there are none.
locations[].residents[].idstring (uuid)Patient id.
locations[].residents[].namestringThe resident's Resident ID (nickname). Left out when the resident has no name.

Errors

StatusMeaning
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, you lack Organization:read or Location:read, your session has no project, or the zone is outside your project tree or carries no project.
404No zone with this zoneId exists.
422zoneId is not a UUID.

Last updated on

On this page