# Manage a location's organizations

## Overview

This flow describes how to link [departments](https://docs.ohc.network/concepts/facility/department.md) to a [location](https://docs.ohc.network/concepts/facility/location.md), and how to unlink them. Care lists the linked departments under **Departments**, and you change them with **Manage Organizations**.

Linking a department gives the people with a role in it access to the location and every location inside that location, as their role allows.

[Video: Manage a location's organizations](https://www.youtube.com/watch?v=fxxn88tVNzs)

## Pre-requisites

* You can open the facility in Care. You hold a role in the facility, or you belong to a government organization that covers the facility.
* The location is set up in the facility. To set it up, see [Create a location](https://docs.ohc.network/flows/facility/location/create-location.md).
* The departments that you want to link are set up in this facility.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Create/Update Facility Locations | Lets you link and unlink departments on this location. You need it on the location. By default, the Facility Admin and Staff roles hold it. |
| Can Manage Facility Organizations | Needed for each department that you link or unlink. You need it in that department, in one of its parent departments, or in the facility's root department, Administration. By default, the Facility Admin and Administrator roles hold it. |
| Can View Facility Organizations | Lets the **Select Department** picker list the facility's departments. You need it in any department of the facility. By default, the Facility Admin, Staff, Doctor, Nurse, Administrator and Volunteer roles hold it. |
| Can List Facility Locations | Lets you find and open the location, and see its linked departments. You need it on the location. Without it, Care cannot find the location, even if you hold the other permissions. By default, the Doctor, Nurse, Staff, Pharmacist, Administrator and Facility Admin roles hold it. |

You hold a permission on a location when a role in one of these places gives it to you:

* A department linked to the location, or to a location that holds the location.
* A parent department of such a department.
* The facility's root department, Administration. A role there reaches every location of the facility.

By default, only the Facility Admin role holds all four permissions. If you hold that role in the root department, you can manage the departments of every location.

## Steps

### 1. Find the location

Open the facility.

In the facility sidebar, select **Settings**.

In the settings sidebar, under **Facility**, select **Locations**.

Find the location in the location tree or in the list. See [View locations](https://docs.ohc.network/flows/facility/location/view-locations.md).

![The page of Ward 3, selected in the location tree under Main Block, with the Edit button next to its details.](/assets/images/manage-location-organizations-1-65bcd8d300cca230d1db2c92de37c805.webp)

### 2. Open the Edit Location sheet

Open the sheet in one of these ways:

* For a location in the list, select the pencil button **Edit Location** on its row.
* For a bed, select its tile in the **Beds** section.
* For the location that is open, select **Edit** next to its details.

For more about this sheet, see [Edit a location](https://docs.ohc.network/flows/facility/location/edit-location.md).

### 3. Open Manage Organizations

1. In the sheet, find the **Departments** row. The row shows the linked departments, or **No departments assigned**.
2. Select **Manage Organizations**.

![The Edit Location sheet of Ward 3, with the Departments row showing No departments assigned and the Manage Organizations button.](/assets/images/manage-location-organizations-3-d8ef5e0e9d9700c6930d204c62c062cd.webp)

Care opens the **Manage Organizations** sheet. Its description is "Add or remove organizations from this location".

The sheet lists the linked departments under **Current Organizations**. If no department is linked, it shows **No organizations added yet**.

![The Manage Organizations sheet, with the Select Department picker, Administration selected below it, and No organizations added yet under Current Organizations.](/assets/images/manage-location-organizations-4-609151f38123e23318af52601b9979b5.webp)

### 4. Link departments

1. Open the **Select Department** picker.
2. Check the departments that are already selected. Care can select your own department for you. Clear any department that you do not want to link.
3. To find a department, type its name.
4. Select each department that you want to link.
5. Select **Add Organizations**.

![The Select Department picker open, with Administration ticked under My departments and more departments under All departments.](/assets/images/manage-location-organizations-5-c6d93255cd338ab1f7199cfedb4f9124.webp)

![The Select Department picker with Emergency typed in the search box and the Emergency department ticked.](/assets/images/manage-location-organizations-6-c60d23d65010a8002a0c0766e7e7a0a9.webp)

![The Manage Organizations sheet with Emergency selected and the Add Organizations button.](/assets/images/manage-location-organizations-7-a0d0d1b169b3e404daf69ba7a1d83b15.webp)

The picker shows your own departments under "My departments", above "All departments".

A department that is already linked shows **Linked**, and you cannot select it.

Care links each selected department and shows **Organization added successfully**. Care then closes the **Manage Organizations** sheet.

![The message Organization added successfully, and Emergency shown in the Departments row of the Edit Location sheet.](/assets/images/manage-location-organizations-8-1acf0aeacb7e6c465e3d97343a376a56.webp)

### 5. Unlink a department

1. If the **Manage Organizations** sheet is closed, select **Manage Organizations** again.
2. Under **Current Organizations**, find the department that you want to unlink.
3. Select the trash icon next to the department.

![The Manage Organizations sheet with Emergency under Current Organizations and a trash icon next to it.](/assets/images/manage-location-organizations-9-a50ebc9946710b2991619c7eeb59b708.webp)

Care unlinks the department at once and shows **Organization removed successfully**.

![The message Organization removed successfully, and No organizations added yet under Current Organizations.](/assets/images/manage-location-organizations-10-ea92d2dab866508f6b8905c3f563b1e6.webp)

Note: Department changes save at once. You do not need to select **Update** in the **Edit Location** sheet.

## Expected Outcome

* The **Departments** row and the **Current Organizations** list show the linked departments.
* The opened location lists the linked departments under **Departments**.
* People with a role in a linked department get access to the location and the locations inside it.
* A role in a parent department of a linked department gives the same access.
* What each person can do there depends on the permissions of their role.
* Unlinking a department removes the access that the link gave, for the location and the locations inside it.

## Related

Concepts:

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

Flows:

* [Edit a location](https://docs.ohc.network/flows/facility/location/edit-location.md)
* [Manage a location's tags](https://docs.ohc.network/flows/facility/location/manage-location-tags.md)
* [View locations](https://docs.ohc.network/flows/facility/location/view-locations.md)
