GuidesGuides

Send alerts by push and email

Name the people in a patient's project to be told of Signals alert events by push and email, with a rule Ovok runs on each event.

Complexity
2/5
Clients
HTTP
Time
30–60 minutes

Tell the people you choose about Signals alert events. Signals sends alert events. Omni-channel alerts in Ovok runs your rule on each one and tells the people it names, over the channels it names. See Omni-channel alerts for who does what.

You need a sandbox project with a Signals tenant of its own, a patient enrolled in Signals, and an email provider set up in Email templates.

Turn on Omni-channel alertsConsole

In the Console, open Omni-channel alerts and turn the switch on. Keep the default rule it offers, or edit it on Routing.

Or over HTTP:

curl -X PUT 'https://api.sandbox.ovok.com/v1/project/settings/OMNICHANNEL_ALERTS_ENABLED' \
  --header "Authorization: Bearer ${OVOK_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{"enabled": true}'

Save a ruleServer-side

curl -X PUT 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules' \
  --header "Authorization: Bearer ${OVOK_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{"logic":{"if":[{"==":[{"var":"event"},"alert.triggered"]},{"notify":{"channels":["push","email"],"to":["practitioner","caregiver"]}},{"==":[{"var":"event"},"alert.refired"]},{"notify":{"channels":["push","email"],"to":["relatedPerson","sharedWith"]}},[]]}}'

See Routing rules for the variables and more examples.

Record who to tellServer-side

Each recipient group reads the project's FHIR records:

  • practitioner: set Patient.generalPractitioner, or let the patient share their record.
  • caregiver: create a CareTeam with subject set to the patient and the carers as participant.member.
  • relatedPerson: create a RelatedPerson for the patient, with an email address in telecom.
  • sharedWith: let the patient share their readings.

Map the email templatesConsole

In Email templates, map ALERT_NOTIFICATION (for practitioners) and PATIENT_ALERT_NOTIFICATION (for everyone else). See the template catalogue for their parameters.

Preview itConsole

On Routing, pick a patient and a sample alert and run the preview. It lists the people the rule reaches and flags anyone without an email address. Over HTTP:

curl -X POST 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/preview' \
  --header "Authorization: Bearer ${OVOK_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{"patientId":"{{PATIENT_ID}}","event":"alert.triggered","alert":{"code":"8867-4","value":132}}'

Test your integration

  1. Send the patient a reading over their heart-rate threshold.
  2. Check that the practitioner and care team received an email and a push.
  3. Let the alert fire again: the family and the people the patient shares with are told, as your rule says.

See also

Last updated on

On this page