# Run a staffed measurement kiosk

Canonical page: https://docs.ovok.com/guides/staffed-kiosk

<Effort complexity={3} clients="Web" time="45–90 minutes, plus a Supabase instance" />

Build a measurement station that nurses share during a shift. A nurse signs in once, scans each patient's card, checks the patient's name and date of birth, and saves a blood-pressure reading to Ovok. Patients never sign in.

The patient register (names, dates of birth and card codes) lives in your own self-hosted Supabase. Ovok holds a [Patient](/api/fhir/r4/patient) that carries only a pseudonym, plus the readings. Measurements, [Signals](/signals) and [EHR connections](/guides/connect-your-ehr) work on that Patient as they do on any other.

The finished example is [Ovok-Dev/staffed-kiosk-example](https://github.com/Ovok-Dev/staffed-kiosk-example).

## What each system holds [#what-each-system-holds]

| | Supabase (yours) | Ovok |
| --- | --- | --- |
| Patient | Name, date of birth, card code, pseudonym | A Patient with only `identifier` = the pseudonym |
| Readings | Nothing | Blood-pressure Observations on that Patient |
| Staff | Nothing | Practitioner accounts; each reading records the nurse who saved it in `meta.author` |
| Who can read it | The `patients` Edge Function, with Supabase's service role | Practitioners of the project, under their [access policy](/access-policies) |

The pseudonym is the register row's `id`. Only the register can turn it back into a person.

## Set up [Console] [#set-up-console]

You need:

- An Ovok sandbox project and a practitioner account in it.
- Docker, to run Supabase on your machine. In production you self-host Supabase the same way.
- Node.js 24 or newer.

## Build the kiosk [#build-the-kiosk]

1. [Set up the patient register](/guides/staffed-kiosk/set-up-the-patient-register)
2. [Configure the Ovok project](/guides/staffed-kiosk/configure-the-ovok-project)
3. [Add the patients function](/guides/staffed-kiosk/add-the-patients-function)
4. [Build the kiosk app](/guides/staffed-kiosk/build-the-kiosk-app)
5. [Run it on the ward](/guides/staffed-kiosk/run-it-on-the-ward)
6. Optional: [Receive readings over HL7 v2](/guides/staffed-kiosk/receive-readings-over-hl7)

## How a reading flows [#how-a-reading-flows]

1. The nurse signs in to Ovok as a practitioner. The kiosk keeps the session until the browser tab closes.
2. A scanner types the card code. The kiosk sends it, with the nurse's Ovok token, to the `patients` Edge Function.
3. The function asks Ovok who the token belongs to (`GET /v1/auth/me`) and refuses anyone who is not a practitioner of your project. It returns the patient's name, date of birth and Ovok Patient id.
4. The nurse checks name and date of birth with the patient, then enters the reading.
5. The kiosk saves it with `ovok.measurements.save({ patientId })`. Ovok stores the Observations. For a Patient enrolled in Signals, Ovok forwards eligible readings as [Data Ingestion](/data-ingestion) describes.

When a patient is registered, the function creates the Ovok Patient with a [conditional create](/web-sdk/core/namespaces/fhir#create-update-patch-delete), so a retry never creates a second one.

## Optional: send readings to a clinical system [#optional-send-readings-to-a-clinical-system]

The kiosk's readings are ordinary Observations, so any system can take them through [Connect to your EHR](/guides/connect-your-ehr):

- **Your own Supabase over HL7 v2:** make the connection with the register's identifier system, and every reading comes back with the pseudonym in `PID-3`. See [Receive readings over HL7 v2](/guides/staffed-kiosk/receive-readings-over-hl7).
- **A FHIR-native EHR** pulls or subscribes to Observations. It finds the patient by the pseudonym, which only your register can resolve.
- **A hospital's HL7 v2 system** matches on its own MRN. Store the MRN in the register, add it as a second `identifier` when the function creates the Patient, and make the connection with the hospital's MRN system. The message carries the MRN with the name and date of birth fields empty; confirm with the hospital's interface team that their system matches on MRN alone.

## Test your integration [#test-your-integration]

1. Register a patient at the kiosk with a test card code.
2. Scan the card, confirm the identity, and save a reading.
3. Search Patients in your Ovok project and open the new one.

| Scenario | How to trigger it | Expected result |
| --- | --- | --- |
| Reading saved | Save a reading for a scanned patient | It appears under "Recent readings in Ovok" |
| No patient details in Ovok | Read the Patient in Ovok | It has `identifier` and `active` only |
| Unknown card | Scan a code nobody has | The kiosk offers to register the card |
| Card taken | Register a code another patient has | The kiosk says the card is taken (`409`) |
| Patient token | Call the function with a patient's token | `403` |
| Station left open | Leave a patient on screen for 90 seconds | The kiosk returns to scanning |

## See also [#see-also]

- [ovok.measurements](/web-sdk/core/namespaces/measurements)
- [Sign users in](/web-sdk/core/guides/sign-in)
- [Access policies](/access-policies)
- [Connect to your EHR](/guides/connect-your-ehr)
