> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phbhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Portal map

> Every kind of PHB user, where they sign in, and how they get an account.

PHB has several separate front doors. Each kind of user signs in at their own address and sees only their own workspace. If someone can't find their way in, start here.

## At a glance

| Who | Signs in at | Lands on | Role in the system |
| - | - | - | - |
| Patient | `/login` | `/home` | `patient` |
| Hospital owner or admin | `/hospital/login` | `/hospital` | `owner`, `admin` |
| Front desk | `/hospital/login` | `/hospital` → `/hospital/desk` | `receptionist` |
| Cashier | `/hospital/login` | `/hospital` → `/hospital/billing/cashier` | `cashier` |
| Finance, medical director | `/hospital/login` | `/hospital` | `finance`, `medical_director` |
| Nurse | `/hospital/login` | `/nursing` | `nurse` |
| Doctor | `/clinical/login` | `/clinical` | `clinician` |
| Pharmacist | `/pharmacy/login` | `/pharmacy` | `pharmacist` |
| Lab scientist | `/lab/login` | `/lab/orders` | `lab_tech` |

<Tip>
  Nurses sign in through the **hospital** sign-in page, not a nursing one.
</Tip>

## How each person gets an account

Accounts are created from the top down. PHB sets up the facility and invites its owner. The owner then invites their staff.

```mermaid theme={null}
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#16A34A1A", "primaryBorderColor": "#16A34A", "primaryTextColor": "#E5E7EB", "lineColor": "#07C983", "edgeLabelBackground": "#0B0C0E", "fontFamily": "Inter, sans-serif"}}}%%
flowchart TD
  PHB("PHB") -->|"sets up a facility and invites its owner"| OWN("Hospital owner<br/>/hospital/accept-invite")
  PHB -->|"reviews applications"| IP("Independent pharmacy")
  OWN -->|"invites staff<br/>/hospital/staff/invite"| STAFF("Front desk · cashier · finance<br/>nurse · doctor · pharmacist · lab")
  STAFF -->|"registers patients<br/>/hospital/desk/register"| PAT("Patient")
  SELF("Patient on their own phone") -->|"/register or USSD *347*731#"| PAT
```

### Patients

A patient can get an HPN in any of these ways:

* **On their own phone** at `/register`.
* **By USSD** on any phone, by dialling `*347*731#`. No smartphone or internet needed.
* **At a hospital front desk**, where staff register them at `/hospital/desk/register`.
* **At a pharmacy counter** that is on PHB.

Patients sign in at `/login` with their phone number and a one-time code sent by SMS. A patient who has lost access goes to `/recover`.

### Hospital staff

1. PHB sets up the hospital and sends the hospital owner an invite.
2. The owner opens the link in the email, which goes to `/hospital/accept-invite`, sets their own password, and sets up two-step sign-in.
3. The owner finishes the hospital's setup at `/hospital/setup`.
4. The owner or an admin invites everyone else at `/hospital/staff/invite` and picks each person's role.
5. Each person accepts their invite, sets their own password, and signs in at the address in the table above.

<Tip>
  Every staff member chooses their own password. A forgotten password is reset by an owner or admin, who sends the staff member a one-time link to set a new one. The owner or admin never sees the new password.
</Tip>

Some staff have an extra step before they can work:

* **Doctors** finish onboarding at `/clinical/onboarding`, where their MDCN licence is checked.
* **Nurses** finish onboarding at `/nursing/onboarding`, where their NMCN licence is checked.
* **Lab scientists** finish onboarding at `/lab/onboarding`.

### Pharmacies

* A pharmacy **inside a hospital** gets its pharmacists the same way as other hospital staff: an invite from the hospital owner or admin.
* An **independent pharmacy** applies at `/pharmacy/apply` with its documents. PHB reviews them by hand. Once approved, PHB creates the pharmacy and emails a set-password link.

## Help inside the app

The hospital, clinical, nursing and lab workspaces have a **Help & guides** link in the left sidebar. The pharmacy workspace has a **Help** link in its header. All of these open step-by-step guides at `/help/tutorials`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.