# Link a device to an encounter

## Overview

[Video: Link a device to an encounter](https://www.youtube.com/watch?v=gdS1FhpK8Tk)

This flow describes how to link a [device](https://docs.ohc.network/concepts/facility/device.md) to the [encounter](https://docs.ohc.network/concepts/clinical/encounter.md) of a patient, and how to unlink it. You do this from the **Devices** tab of the encounter.

The device page shows the linked encounter and its history, but it has no control to link an encounter.

## Pre-requisites

* The patient has an encounter at the facility. The encounter is not completed, cancelled, entered in error or discontinued.
* You open the encounter from the facility. If you select another encounter of the patient to view, Care does not show the buttons of this flow.
* You can open the encounter of the patient. See [Encounter](https://docs.ohc.network/concepts/clinical/encounter.md).
* The device is registered in the same facility as the encounter.
* To see the device, you hold a role in a department of the device.
* The departments of a device are the Administration department of the facility, its managing department and that department's parents.
* If the device has no managing department, only members of the Administration department can see it and link it. A role in the department of the encounter is not enough.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Manage Device Associations to Encounters | Link the device to the encounter, and unlink it. You must hold it in a department of the device. By default, the Facility Admin, Staff, Doctor and Nurse roles hold this permission. |
| Update Encounter non clinical | Link the device to the encounter. You do not need it to unlink a device. You must hold it in one of the [departments of the encounter](https://docs.ohc.network/concepts/clinical/encounter.md#departments), or in a department of its current location. By default, the Facility Admin, Doctor and Nurse roles hold this permission. |

Note: By default, the Facility Admin, Doctor and Nurse roles can link and unlink a device. The role must be in a department of the device. It must also be in a department of the encounter or of its current location.

Note: By default, the Staff role can unlink a device, if the role is in a department of the device. The Staff role cannot link a device.

Note: Care shows **Associate a device to this encounter** and **Disassociate** without a check of your permissions. For a user with only the Staff role, Care refuses the link with "You do not have permission to associate encounter to this device".

Note: If the device and the encounter are in the same department, a Nurse there can link the device.

## Steps

### 1. Open the Devices tab

1. Open the encounter of the patient from the facility.
2. Select the **Devices** tab.

Note: Press `g` then `v` to go to the **Devices** tab.

The tab lists the devices that are linked to this encounter. It shows only the devices that you can see.

| Column | What it shows |
| - | - |
| **Name** | The registered name and the user friendly name of the device, as a link to the device page. |
| **Type** | The type of the device. |
| **Actions** | The **Disassociate** button. |

If no device is linked, the tab shows **No devices available**.

![The Devices tab of Sara Thomas\&#39;s in-patient encounter, opened from the facility, with the empty devices card outlined, showing No devices available](/assets/images/link-device-to-encounter-1-bc87f3fb2210b23dba3ce492534c644e.webp)

### 2. Open the Associate device sheet

Below the table, select **Associate a device to this encounter**. Care opens the **Associate device** sheet.

![The Devices tab with the button Associate a device to this encounter, below the table, outlined](/assets/images/link-device-to-encounter-2-ebd6c92515cc5b1da23c6fa4045ac520.webp)

### 3. Select the device

1. Open **Select device...**.
2. In **Search devices...**, type the registered name or the user friendly name of the device.
3. Select the device.

Note: The picker lists the devices of the facility that you can see, whatever their **Status** or **Availability Status**. The picker does not leave out devices that are linked to another encounter.

Note: If the device is linked to another encounter, Care moves it to this encounter. Care ends the link to the other encounter.

![The Associate device sheet with the device picker open, Syringe searched for, and the option Syringe Pump SP-09 outlined](/assets/images/link-device-to-encounter-3-fcfcda9c8aca474c1e03dde948d6dfbd.webp)

### 4. Save the link

Select **Associate**.

Care shows **Device associated successfully** and closes the sheet.

Note: **Associate** stays disabled until you select a device.

Note: If the device is already linked to this encounter, Care refuses the link with "Encounter already associated".

![The Associate device sheet with Syringe Pump SP-09 selected and the Associate button outlined](/assets/images/link-device-to-encounter-4-21838560df71923954a23a75ac13064b.webp)

![The Devices tab with the message Device associated successfully and the new row outlined: Syringe Pump SP-09, Ward Syringe Pump 9, type -, and Disassociate](/assets/images/link-device-to-encounter-5-8c7b1d93b065b7e60bf3e2083ee31f4f.webp)

### 5. Unlink a device

In the row of the device, select **Disassociate**.

Care unlinks the device at once. Care does not ask you to confirm, and shows no message.

Note: To unlink a device, you need only "Can Manage Device Associations to Encounters".

![The row of Syringe Pump SP-09 with its red Disassociate button outlined](/assets/images/link-device-to-encounter-6-5692f8b127f45ca43a7ea18957d168e0.webp)

![The Devices tab after unlinking, with the devices card outlined, showing No devices available again; no message is shown](/assets/images/link-device-to-encounter-7-d0e8d9357c2f48751885f10fd6c127fc.webp)

## Expected Outcome

* The device shows in the table of the **Devices** tab.
* On the device page, the **Encounter** row shows the name of the patient, as a link to the encounter.
* On the device page, **View History** opens the **Device Encounter History**. Each link shows the name of the patient, the user who linked the device, and when the link started.
* When you unlink the device, Care ends the link, and the device leaves the table.
* When the encounter is completed, cancelled, entered in error or discontinued, Care unlinks all its devices. If you restart the encounter, Care does not link them again.

## Related

Concepts:

* [Device](https://docs.ohc.network/concepts/facility/device.md)
* [Encounter](https://docs.ohc.network/concepts/clinical/encounter.md)

Flows:

* [View devices](https://docs.ohc.network/flows/facility/device/view-devices.md)
* [Link a device to a location](https://docs.ohc.network/flows/facility/device/link-device-to-location.md)
* [Create an encounter](https://docs.ohc.network/flows/clinical/encounter/create-encounter.md)
* [Manage encounter departments](https://docs.ohc.network/flows/clinical/encounter/manage-encounter-departments.md)
* [Complete an encounter](https://docs.ohc.network/flows/clinical/encounter/complete-encounter.md)
* [Restart an encounter](https://docs.ohc.network/flows/clinical/encounter/restart-encounter.md)
