Get realtime trends graphs
| Method | Path |
|---|---|
GET | /v1/slim/trends/realtime |
Authentication · Access policies
Returns the same trend data as GET /v1/slim/trends/graphs, in the same shape, but read from the resident's readings in Signals instead of from Medplum Observations. Use it for the recent, live part of a chart.
Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Organization:read, Device:read, Patient:read and DocumentReference:read.
Scope: the resident must be in the caller's project or one of its sub-projects (not its parent). A resident outside that scope answers 404, the same as one that does not exist.
Behaviour
- The chart covers exactly
[startTime, endTime]. Unlike/graphs, it does not snap to monitoring days. - A window of up to 24 hours has 30-second buckets. A longer one has 5-minute buckets, each the mean of its readings. Buckets sit on a UTC-aligned grid and each covers the interval up to its timestamp, so the last bucket can end up to one bucket after
endTime. - Readings are charted under the resident's most recently assigned device, with the same device key, threshold and baseline values and
statsas/graphs. Signals readings carry no device, so a resident whose device changed inside the window shows one device key here where/graphsshows one per device. - Every graph type in the table below can be charted. Only
heartRateandrespiratoryRatecarry threshold and baseline values. endTimemust not be earlier than 24 hours ago,startTimemust not be afterendTime, and the window may span at most 14 days. A request that breaks one of these fails validation.- Readings are charted by when they were observed, or by when Signals stored them when no observed time exists. Late-arriving readings are included.
- A resident with no assigned device, or with no readings in the window, returns every requested graph type as
{}(andheartRateandrespiratoryRateas{}). - If Signals cannot be reached, does not answer within 25 seconds, or holds more readings than one request can page through, the route returns
503witherror: "signals_unavailable"and aretryAfterSecvalue, rather than a partial or empty chart. - Results are cached for up to 15 seconds, and the request times are rounded down to that interval for the cache key, so a repeated poll can show a window up to 15 seconds old.
Graph types
Each type charts every Signals reading recorded under one of its codes. The names are the dashboard telemetry's, so
pulse rate by pulse oximetry is pulseRate and never part of heartRate.
graphType | Codes |
|---|---|
heartRate | 8867-4, 43149-4 |
respiratoryRate | 9279-1 |
oxygenSaturation | 59408-5, 2708-6 |
pulseRate | 8889-8 (heart rate by pulse oximetry) |
perfusionIndex | 61006-3, PI (Kinderspitex's own vital code, not LOINC) |
bodyTemperature | 8310-5 |
systolicBloodPressure | 8480-6 |
diastolicBloodPressure | 8462-4 |
heartRateVariability | 80404-7 |
Example cURL request
curl -X GET \
'https://api.sandbox.ovok.com/v1/slim/trends/realtime?patientId=3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21&startTime=2026-09-27T09:00:00Z&endTime=2026-09-28T09:00:00Z&graphType=heartRate,respiratoryRate' \
-H "Authorization: Bearer ${OVOK_TOKEN}"
Successful response
200 — Successfully retrieved realtime trends data grouped by device and graph type
Errors
| Status | Meaning |
|---|---|
400 | Your session has no project. |
401 | Bearer token is missing, invalid or expired. |
403 | You are not a practitioner, admin or System Owner, or you lack Organization:read, Device:read, Patient:read or DocumentReference:read. |
404 | No resident with this patientId exists in your project or its sub-projects. |
422 | A query parameter fails validation, startTime is after endTime, endTime is more than 24 hours ago, or the window is longer than 14 days. |