Set the project's omni-channel alerts rule
- Sandbox: available
- On your own host? Choose https://{host} in the playground.
Sets your project's omni-channel alerts rule. With OMNICHANNEL_ALERTS_ENABLED on, Ovok runs it on each alert event Signals sends and tells the people it names by email and push.
Scope: the caller's project (from the token).
Behaviour
logicis JSON Logic answering up to 10 entries for one event:{ "notify": { "channels": [...], "to": [...] } }. An empty list ornulltells nobody of that event.- The rule reads
event(alert.triggered,alert.empty,alert.note,alert.inactive,alert.refired,alert.resolvedoralert.acknowledged),alert.id,alert.code,alert.reason,alert.message,alert.valueandpatient.id. channels:push,email.to:practitioner(general practitioners and practitioners the patient shares their record with),caregiver(active care team members),relatedPerson(the patient's related persons) andsharedWith(the people the patient shares readings with).- A written-out entry naming a channel or recipient Ovok does not know is refused with
UNKNOWN_NOTIFY_LABELS. A rule that fails on any event type is refused withINVALID_NOTIFICATIONS.
Example
curl -X PUT 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{"logic":{"if":[{"==":[{"var":"event"},"alert.triggered"]},{"notify":{"channels":["push","email"],"to":["practitioner","caregiver"]}},[]]}}'Who can call it: a project admin. See roles.
bearerAuthorizationBearer <JWT>application/json- body
logic*unknownThe rule as Ovok now runs it.
application/json- response
notifications*The rule Ovok runs for the project, or null when it has none and nobody is told.
curl -X PUT 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules' \ -H 'Content-Type: application/json' \ -d '{ "logic": null}'{ "notifications": { "property1": null, "property2": null }}Remove the project's omni-channel alerts rule DELETE
Removes your project's omni-channel alerts rule. From then on Ovok tells nobody of alert events, even with the setting on. **Scope:** the caller's project (from the token). ## Example ```bash curl -X DELETE 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ``` **Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).
Preview who an alert event would reach POST
Shows who a rule would tell about one alert event for one patient, and over which channels. Nothing is sent and nothing is stored. **Scope:** the caller's project (from the token). ## Behaviour - `patientId` is the FHIR Patient whose people are resolved. `event` is the Signals event to try, `alert.triggered` by default. `alert` is a sample alert: `reason`, and optionally `code`, `message` and `value`. - `notifications` tries a rule before you save it; without it, the project's own rule applies. - Each `notify` entry lists its `recipients`, each with `email` telling whether they have an address on file, and the `unknownChannels` and `unknownRoles` Ovok would skip. - `withheld` lists the people the entry names but Ovok would not tell, because their own access does not cover the alert. Each has a `reason`: - `no_account`: no active membership in the project. - `no_patient_access`: their access policy does not let them read the patient. - `no_alert_access`: it grants neither `signals_alerts:read` nor the alert's `DetectedIssue`. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/preview' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{"patientId":"PATIENT_ID","event":"alert.triggered","alert":{"code":"8867-4","value":132}}' ``` **Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).