# Link a device to a location

## Overview

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

This flow describes how to link a [device](https://docs.ohc.network/concepts/facility/device.md) to a [location](https://docs.ohc.network/concepts/facility/location.md) of the facility. It also describes how to move the device to another location, and how to unlink it from its location.

Care keeps each placement of the device, with its start and end, in the **Location History**.

To set the department that manages the device, see [Set a device's managing department](https://docs.ohc.network/flows/facility/device/set-device-managing-department.md).

## Pre-requisites

* The device is registered in the facility. 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.
* The location is in the same facility as the device.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Manage Devices on Facility | Link the device to a location, move it, or unlink it from its location. You must hold it in a department of the device. By default, the Facility Admin, Staff and Pharmacist roles hold this permission. |
| Can Create/Update Facility Locations | Link the device to a location. You do not need it to unlink the device. You must hold it in a department of the location that you link the device to. By default, the Facility Admin and Staff roles hold this permission. |
| Can List Facility Locations | See a location in the location picker. You must hold it in a department of the location. By default, the Facility Admin, Administrator, Staff, Doctor, Nurse and Pharmacist roles hold this permission. |
| Can List Devices on Facility | See the **Location History** in the location sheet. You must hold it in a department of the device, or of its current location. By default, the Facility Admin, Staff, Doctor, Nurse and Pharmacist roles hold this permission. |

Note: By default, the Facility Admin and Staff roles can link a device to a location. The role must be in a department of the device and in a department of the location.

Note: By default, the Pharmacist role can unlink a device from its location, but cannot link one. The role must be in a department of the device.

Note: Care shows **Associate** and **Change** on the **Location** row to every user who can open the device page. Only users with the permissions above can save the change.

## Steps

### 1. Open the device

1. In the facility sidebar, select **Settings**.
2. Under **Facility**, select **Devices**.
3. Select the card of the device. Care opens the device page.

![The device page of Nebulizer NB-05, with its name, the user friendly name Ward Nebulizer 5 and its status badges outlined](/assets/images/link-device-to-location-1-4929675f0c353cb4090c89a553a10309.webp)

### 2. Open the location sheet

On the **Overview** tab, find the **Location** row in **Device Information**.

* If the device has no location, the row shows **No location associated**. Select **Associate**.
* If the device has a location, the row shows its name. Select **Change**.

Care opens the **Associate Location** sheet.

![The Location row of the Device Information card outlined, showing No location associated and the Associate button](/assets/images/link-device-to-location-2-c1180a626f7cd5ac00c3d5c67d86ba09.webp)

### 3. Link the device to a location

If the device has no location, the top of the sheet shows the location picker.

1. Open **Select Location**.
2. In **Search locations...**, search for the location.
3. Select the location.
4. Select **Associate**.

Care shows **Location associated successfully**. The sheet stays open and shows the new location.

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

Note: The picker lists locations of every kind in the facility. It shows only the locations where you hold "Can List Facility Locations".

![The Associate Location sheet with the location picker open, Medical searched for, and the option Medical Ward outlined](/assets/images/link-device-to-location-3-b0ef96ecde2c34b56d615442609ac291.webp)

![The Associate Location sheet with Medical Ward selected in the picker and the Associate button outlined](/assets/images/link-device-to-location-4-97fac1bf3ed2e6adaf4e5fd7930eea99.webp)

![The sheet after linking, with the message Location associated successfully and the Current Location box outlined, showing Medical Ward and the Disassociate button; Location History lists Medical Ward to now](/assets/images/link-device-to-location-5-f084bc9bce2d702e2847028791faa946.webp)

### 4. Move the device to another location

If the device has a location, the sheet shows the **Current Location** and **Disassociate** in place of the location picker. To move the device, unlink it from the current location first.

1. Select **Disassociate**. Care shows **Location disassociated successfully**.
2. Care now shows the location picker. Select the new location, as in step 3.
3. Select **Associate**. Care shows **Location associated successfully**.

![After Disassociate, the location picker is back; Bed 3 is searched for and the option Bed 3, Medical Ward is outlined among the beds of other wards](/assets/images/link-device-to-location-6-92fc909ba4d6f28b2f7a09390359d9a5.webp)

![The sheet after associating again, with the Current Location box outlined, showing Bed 3; Location History lists Bed 3 to now and Medical Ward with an end date](/assets/images/link-device-to-location-7-ef0dd9d2083d5848bb00f1d55bb13c5e.webp)

### 5. Unlink the device from its location

1. On the **Location** row, select **Change**.
2. Select **Disassociate**.

Care shows **Location disassociated successfully**. The device now has no location.

Note: To unlink a device from its location, you need only "Can Manage Devices on Facility".

![The device page with the Location row outlined, showing Bed 3 and the Change button](/assets/images/link-device-to-location-8-6bc61fae6f984ba999c749887a297c61.webp)

![The Associate Location sheet with Current Location Bed 3 and the Disassociate button outlined](/assets/images/link-device-to-location-9-a66ffcee47afcbb93a67d410108424a8.webp)

![The message Location disassociated successfully outlined; the sheet shows the location picker again because the device has no location](/assets/images/link-device-to-location-10-b515e35cff540f4456efe3fdd9614880.webp)

### 6. Check the Location History

The sheet lists the placements of the device under **Location History**, below the current location or the location picker.

Each placement shows:

* The name of the location, as a link.
* The location form of the location.
* The text "Associated by" with the name of the user who linked the device.
* The start date, and the end date or **now** for the current placement.

If the device has no placements, the list shows **No locations found**.

![The Location History list outlined, with two ended placements: Bed 3, a bed, and Medical Ward, a ward, each Associated by Rohan Kapoor with start and end dates](/assets/images/link-device-to-location-11-a38020c5292d9d2011cfe46421f081be.webp)

## Expected Outcome

* The **Location** row of the device page shows the name of the location as a link.
* Care starts a new placement for the device in the **Location History**. It shows **now** as its end.
* When you unlink or move the device, Care ends the earlier placement at that time.
* If you unlink the device, the **Location** row shows **No location associated**.

## Related

Concepts:

* [Device](https://docs.ohc.network/concepts/facility/device.md)
* [Locations](https://docs.ohc.network/concepts/facility/location.md)

Flows:

* [View devices](https://docs.ohc.network/flows/facility/device/view-devices.md)
* [Set a device's managing department](https://docs.ohc.network/flows/facility/device/set-device-managing-department.md)
* [Link a device to an encounter](https://docs.ohc.network/flows/facility/device/link-device-to-encounter.md)
* [View locations](https://docs.ohc.network/flows/facility/location/view-locations.md)
* [Create a location](https://docs.ohc.network/flows/facility/location/create-location.md)
