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

# Configure Appointment Workflows and Transitions in Prvaha

> Customise how appointments progress through your clinic by creating workflow stages and transition rules in Prvaha's Appointments and Preferences pages.

A workflow in Prvaha is the sequence of stages that an appointment moves through from the moment it is booked until it is fully complete. Rather than forcing every clinic into a single fixed process, Prvaha lets you define the exact steps that match how your practice operates — whether that means a straightforward two-step flow for walk-in consultations or a multi-stage process that includes triage, billing review, and follow-up scheduling.

## Default workflow

Every Prvaha clinic starts with a built-in set of appointment transitions that cover the most common clinical journey. Out of the box, staff with the right role can:

* **Confirm** a booked appointment once a doctor is assigned.
* **Mark ready for billing** once the clinical work is complete and a workflow is attached.
* **Put an appointment on hold** at any point before it is confirmed or marked ready.
* **Cancel** an appointment from any active status.

In addition, Prvaha applies several automatic (system-driven) transitions behind the scenes — for example, automatically confirming an appointment the moment a doctor is assigned, or automatically moving it to **Billed** once an invoice is generated. These system transitions run without any manual action from your team.

You can extend, replace, or layer on top of this default configuration by creating custom workflows and transition rules tailored to your clinic's needs.

<Note>
  Workflow changes apply across your entire clinic. Any new appointments created after you update a workflow will follow the updated rules. Appointments already in progress continue on the workflow that was active when they were created.
</Note>

## Create a custom workflow

<Steps>
  <Step title="Open the Workflows page">
    From the main navigation, go to **Appointments → Workflows**. This page shows all workflows that have been created for your clinic.
  </Step>

  <Step title="Click New Workflow">
    Select the **New Workflow** button. A form opens where you can define the structure of the new workflow.
  </Step>

  <Step title="Name the workflow and add stages">
    Give the workflow a clear, descriptive name — for example, *Standard Outpatient* or *Specialist Referral*. Then add the stages that an appointment should move through. Each stage maps to a status in the appointment lifecycle, such as **Registered**, **Triaged**, **In Consultation**, or **Awaiting Results**.
  </Step>

  <Step title="Define transitions between stages">
    For each pair of adjacent stages, specify what triggers the move from one to the next. Transitions can be:

    * **Manual** — a staff member with the appropriate role clicks a button on the appointment detail page to advance the status.
    * **Automatic** — the system advances the status when a condition is met, such as a doctor being assigned or an invoice being generated.

    You can also set conditions that must be true before a transition is allowed — for example, requiring that a doctor is assigned before an appointment can be confirmed, or that a workflow is attached before billing can proceed.
  </Step>

  <Step title="Save and assign to appointments">
    Click **Save**. The workflow is now available across your clinic. When creating or editing an appointment, you can select this workflow so that the appointment follows the stages and transitions you have defined.
  </Step>
</Steps>

## Appointment transitions

Transition rules are the engine that powers your workflows. You can view and edit them independently at **Preferences → Appointment Transitions**.

Each transition rule defines:

* **From status** — the status the appointment must currently be in (or a wildcard to match any active status).
* **To status** — the status the appointment moves to when the transition fires.
* **Label** — the human-readable button label staff see on the appointment detail page, for example *Confirm appointment* or *Mark ready for billing*.
* **Allowed roles** — which staff roles can trigger this transition manually. Prvaha supports Admin, Receptionist, and Doctor roles for standard transitions; Admin and Doctor roles are required for billing-related transitions.
* **Conditions** — optional rules that must evaluate to true before the transition can fire. Common conditions include checking that a doctor is assigned or that a workflow is attached to the appointment.
* **Failure messages** — the message shown to staff when a condition is not met, explaining what is missing (for example, "Doctor is not assigned" or "Workflow is not created").
* **Priority** — when multiple transitions are available from the same status, priority determines the order in which they are presented.

<Note>
  Transition rules you create in **Appointment Transitions** apply to all appointments in your clinic, regardless of which specific workflow they are on. Use workflows to define the sequence of stages and transitions to control the rules for moving between them.
</Note>

## Role-based access to transitions

Not every staff member can trigger every transition. Prvaha enforces role-based access on each transition rule:

* **Admins** can trigger all manual transitions, including billing actions.
* **Receptionists** can confirm appointments, put them on hold, and cancel them, but cannot perform billing transitions.
* **Doctors** can confirm, hold, cancel, and perform billing transitions for their own appointments.

If a staff member does not have the required role for a transition, that action will not appear as an available option on the appointment detail page.
