Update patient threshold (v2)

  • Sandbox: available
  • Staging: available
  • Production: unknown
PUT
/v2/slim/threshold/patient/{patientId}

Updates the patient threshold in the v2 contract. mode is required on every settings field, and dictates which values the branch requires:

  • mode: 'organization' — follow the org default; send no other values.
  • mode: 'patient' (HR/RR/OOB) — individual absolute bounds. HR/RR: enabled + min + max. OOB: enabled + maxDurationSeconds, plus an optional deviationPercent (integer 5–300, or null to switch it off) that alerts sooner when an exit runs that far past the resident's usual one. It only ever brings the limit forward: maxDurationSeconds stays the limit when there is no baseline yet. Leaving deviationPercent out keeps what is stored.
  • mode: 'baseline' (HR/RR only) — individual baseline-driven alerting. enabled + deviationPercent.
  • settings.bedTimePeriod: mode: 'organization' (follow org window) or mode: 'patient' + start + end.

Semantics:

  • Save = applied, all or nothing. Every save writes the resident's settings to Signals before it answers: signalsSync: { status: 'ok' } once Signals holds them, or 502 with saved: false and nothing changed (a 500 says putting the previous limits back failed too). Send the save again.
  • A second save of the same resident while one is still running answers 409 with saved: false and changes nothing. Send it again.
  • enabled: false preserves stored values (bounds or deviationPercent) — Disable round-trips untouched.
  • timezone never travels up on PUT bodies.
  • settings.oxygenSaturation, pulseRate, perfusionIndex, bodyTemperature (each optional): { mode: 'organization' } follows the home; { mode: 'patient', enabled, min, max } is the resident's own limit, either bound null for a one-sided one. Leaving one out, or sending null, keeps what is stored. Following a home that does not watch the vital removes the resident's rule in Signals.
  • A resident's own enabled limits, the four vitals' included, must sit inside the home's ranges (see GET). One outside answers 422 naming the field, and nothing is saved. A limit sent back unchanged is not re-checked, so a home that narrows its range does not block a resident's other edits. Ranges are the home's: set them on PUT /v2/slim/threshold; a ranges key here is ignored.

Authorization

bearer
headerAuthorizationBearer <JWT>

Path Parameters

patientId*string

The resident, as a Medplum Patient.id.

Request Body

application/json
  1. body
settings*

Response Body

Patient v2 threshold updated successfully.

application/json
  1. response
id*string
patientId*string
projectId*string
updatedAt*string
settings*
ranges*
signalsSync*|
Example Request
curl -X PUT 'https://api.sandbox.ovok.com/v2/slim/threshold/patient/string' \  -H 'Content-Type: application/json' \  -d '{  "settings": {    "heartRate": {      "mode": "organization"    },    "respiratoryRate": {      "mode": "organization"    },    "outOfBed": {      "mode": "organization"    },    "bedTimePeriod": {      "mode": "organization"    }  }}'
Example Response
{  "id": "string",  "patientId": "string",  "projectId": "string",  "updatedAt": "string",  "settings": {    "heartRate": {      "mode": "organization",      "enabled": true,      "min": 0,      "max": 0    },    "respiratoryRate": {      "mode": "organization",      "enabled": true,      "min": 0,      "max": 0    },    "outOfBed": {      "mode": "organization",      "enabled": true,      "maxDurationSeconds": 0,      "deviationPercent": 0,      "baselineAverage": 0,      "effectiveMaxDurationSeconds": 0    },    "bedTimePeriod": {      "mode": "organization",      "start": "string",      "end": "string",      "timezone": "string"    },    "oxygenSaturation": {      "mode": "organization",      "enabled": true,      "min": 0,      "max": 0    },    "pulseRate": {      "mode": "organization",      "enabled": true,      "min": 0,      "max": 0    },    "perfusionIndex": {      "mode": "organization",      "enabled": true,      "min": 0,      "max": 0    },    "bodyTemperature": {      "mode": "organization",      "enabled": true,      "min": 0,      "max": 0    }  },  "ranges": {    "heartRate": {      "min": 0,      "max": 0    },    "respiratoryRate": {      "min": 0,      "max": 0    },    "oxygenSaturation": {      "min": 0,      "max": 0    },    "pulseRate": {      "min": 0,      "max": 0    },    "perfusionIndex": {      "min": 0,      "max": 0    },    "bodyTemperature": {      "min": 0,      "max": 0    }  },  "signalsSync": {    "status": "ok"  }}