# Signals flows with Ovok

Canonical page: https://docs.ovok.com/signals/with-ovok/flows

Two [settings](/signals/with-ovok/settings) and one operation give you a handful of flows. Pick by where your readings come from and where your app wants the alerts.

## What each combination does [#what-each-combination-does]

`SIGNALS_ANNOTATE_OBSERVATIONS` follows `SIGNALS_SEND_AUTO` until you save it yourself, so saving send-auto on turns both on.

| `SIGNALS_SEND_AUTO` | `SIGNALS_ANNOTATE_OBSERVATIONS` | What happens |
| --- | --- | --- |
| Off | Off (the default) | Ovok sends nothing from FHIR and writes nothing back. Readings reach Signals only through [Data Ingestion](/data-ingestion) or the [standalone API](/signals/standalone). |
| On | Not saved, so on | Every Observation created through FHIR is judged, and alerts, episodes and derived readings are written back. The complete setup. |
| On | Saved off | Readings are sent, results stay in Signals. Read them through webhooks or the Signals API. |
| Off | Saved on | Results of readings that reach Signals another way, such as ingest, are written into FHIR. |

Both need a project with its own Signals tenant. A project on the shared tenant answers `409` `SETTING_NOT_AVAILABLE`.

## Send everything automatically [#send-everything-automatically]

Save `SIGNALS_SEND_AUTO` on. Each Observation of a Patient created through the FHIR API is sent, and the first one enrols its patient. It applies to every patient of the project; there is no per-patient filter.

Use it when your app already writes Observations and you want alerts without changing it. Updates are not sent, so correct a reading by creating a new Observation.

## Enrol patients one by one [#enrol-patients-one-by-one]

Call `$enable-signals` to enrol a Patient before its first reading, for example to set thresholds first. It enrols only: with `SIGNALS_SEND_AUTO` off, FHIR Observations are still not sent, so pair it with ingest or the standalone API as the source of readings.

| Method | Path |
| --- | --- |
| `POST` | `/fhir/R4/Patient/:id/$enable-signals` |

```bash
curl --request POST \
  --url 'https://api.sandbox.ovok.com/fhir/R4/Patient/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21/$enable-signals' \
  --header "Authorization: Bearer ${OVOK_TOKEN}"
```

- **Access:** `signals_config:update` and Patient `update`. See [Signals route policies](/access-policies/signals).
- **Request:** no body. The unversioned and R5 paths work too: `/fhir/Patient/:id/$enable-signals`, `/fhir/R5/Patient/:id/$enable-signals`.
- **Success:** `200` with `patientId`, `signalsPatientId` and `enabled: true`.
- **Retries:** idempotent. An enrolled Patient returns the same Signals id, and missing setup is completed.
- **Failures:** `403` without permission, `404` when the Patient is not in your project, and `503` [`signals_mint_failed`](/errors/signals-mint-failed) when provisioning fails. Nothing is left half enrolled, so retry.

The same operation is listed in the [primitives reference](/primitives/enable-signals-patient).

## Get results back [#get-results-back]

Choose one, or combine them. They read the same alerts.

| Where | Use it when |
| --- | --- |
| [FHIR write-backs](/signals/with-ovok/fhir-annotations) (annotations on) | Your app and its access policies already work on FHIR, or you want alerts in the patient record. Search `DetectedIssue` and `Flag`. |
| [Signals webhooks](/signals/standalone/webhooks) | You need a push the moment an alert opens or an episode closes. Add your own subscriber; it works beside the one annotations use. |
| [Signals API](/signals/standalone) | You need Signals' own shape, such as acknowledging an alert or listing by episode. Needs a Manager application. |

Write-backs and webhooks together suit a record in FHIR plus a notification to a worker. Poll FHIR only when no push channel is available.

## Related [#related]

- [Signals with Ovok](/signals/connected-ovok)
- [Signals settings](/signals/with-ovok/settings)
- [Gotchas](/signals/with-ovok/gotchas)
