SMART App Launch

Mint a SMART launch

  • Sandbox: available
  • On your own host? Choose https://{host} in the playground.
POST
/v1/smart/launches

Mints the launch value an app opened from Ovok passes to authorize, so its token carries this patient (and encounter) and its patient/ scopes reach this patient's data only.

Scope: the caller's project (from the token). The caller must be able to read the patient and the encounter themself; Ovok stores the launch in the caller's project.

Behaviour

  • Open the app's launch URL with iss and launch: <launch URL>?iss=<iss>&launch=<launch>. The app sends launch to authorize, and its token answer names the patient (and encounter).
  • The encounter, when given, must be the patient's.
  • A token whose SMART scopes are all patient/ ones may not call this.

Example

curl -X POST 'https://api.sandbox.ovok.com/v1/smart/launches' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \  -H 'Content-Type: application/json' -d '{"patient":"Patient/3a7f2c1e-0b4d-4f6a-9c2e-1d8b5a6f7e90"}'

Authorization

bearer
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
patient*string

The patient the app opens with, as Patient/<id>.

Match^Patient\/[A-Za-z0-9\-.]{1,64}$
encounter?string

The patient's encounter the app opens with, as Encounter/<id>, or null.

Match^Encounter\/[A-Za-z0-9\-.]{1,64}$
Defaultnull

Response Body

The launch and iss to open the app with.

application/json
  1. response
launch*string

The launch value: pass it to the app's launch URL, which hands it to authorize.

iss*string

The FHIR base URL the app's launch URL takes as iss.

Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/smart/launches' \  -H 'Content-Type: application/json' \  -d '{  "patient": "string"}'
Example Response
{  "launch": "string",  "iss": "string"}

Update location in zone PUT

Updates a location in a zone: its name, floor, room and bed, the devices assigned to it, and the resident on those devices. **Auth:** The access policy must grant `Location:update` and `Device:update` (an admin or super admin who holds no access policy skips this check). **Scope:** The zone must belong to the caller's project (from the token), its parent project, or one of its sub-projects. The location must be in the caller's project, and its managing organization must be the zone. Devices and residents named in the body must be in your project or a sub-project. ## Behaviour - `name` is required and must be unique among the locations your token can search, not counting this one. - `floor`, `room` and `bed` replace only the values you send; omitted ones keep their stored value. The resulting floor, room and bed must not match another location in the zone. - `deviceId` (one UUID or a list) sets the devices at the location to exactly that set: devices not listed are removed from it, new ones are added. `null` removes every device. Omit `deviceId` to leave the devices unchanged. - `patientId` assigns that resident to the devices named in `deviceId`, or, without `deviceId`, to the location's single device. A resident assigned there before is unassigned from those devices. - **Omitting `patientId` unassigns the current resident from every device at the location** (and from the devices in `deviceId`). Send the current `patientId` to keep the resident. - A discharged resident cannot be assigned. - A location holds one resident. A save that would leave a second resident in it is refused with 409 `location_has_resident`, names the location in `params.locationId`, and writes nothing. - The write is atomic and takes a short write lock on the devices and locations it touches. - The response is the updated location, in the same shape as `GET /v1/slim/location/{id}`. ## Example ```bash curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/zones/c3499c27-2973-0a7f-807e-fb8676a92dcb/locations/87ea5dfc-8b8e-384d-8489-79496e706390' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "Room 101 Bed 1", "room": "101", "bed": "1", "deviceId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "patientId": "87ea5dfc-8b8e-384d-8489-79496e706390" }' ``` **Who can call it:** a practitioner, a project admin or a System Owner session. See [roles](/access-policies#who-can-call-a-route).

Check a SMART authorize request POST

Checks a SMART app's `authorize` request before the user signs in, and names the app and the scopes it gets. **Scope:** none; anyone may call it. The SMART sign-in page on www.ovok.com calls it with the parameters Ovok's `authorize` handed it. ## Behaviour - The request must pass the store's own `authorize` rules: a known `client_id`, a `redirect_uri` the app registered exactly, `response_type=code`, a scope, an `aud` on Ovok's host, and PKCE with `S256` unless the app is exempt. Otherwise 400 `SMART_AUTHORIZE_INVALID`, whose detail names the RFC 6749 error, and nothing reaches the app. - An EHR launch (`launch` set) signs in at the store instead: 400. - `scopes` are what the app will get: `patient/` writes are granted as reads. - `cancel` is the app's `redirect_uri` with `error=access_denied` and its `state`.