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

# Exam lifecycle (pendency)

> From exam request to ASO — and how dismissal, return and periodic generate pendencies.

The [Pendency](/public-api/en/concepts/exam-pendency_en) tracks the occupational exam from the
request to the **ASO** (Occupational Health Certificate) or cancellation. Through the public
API you **create**, **list** and **cancel** pendencies and track the `status`; clinic
scheduling and performing the exam are orchestrated internally by Salú.

## Lifecycle

```mermaid theme={null}
sequenceDiagram
    participant C as Your system
    participant API as Salú API
    participant S as Salú (internal)
    C->>API: create pendency (employee event or POST /v0/pendency)
    API-->>C: pendency in Pending status
    S-->>S: schedule exam at a clinic
    S-->>S: exam performed → ASO issued
    C->>API: GET /v0/pendency (track status)
    Note over C,API: To close without completion: POST /v0/pendency/cancel
```

## How pendencies arise

| Origin                               | Generated type      |
| ------------------------------------ | ------------------- |
| Employee hiring (`create_exam=true`) | `HIRING`            |
| Employee dismissal                   | `DISMISSAL`         |
| Return to work                       | `RETURN`            |
| Risk change (hierarchy)              | `RISK_CHANGE`       |
| Periodic (organization parameters)   | `PERIODIC`          |
| Direct creation                      | `POST /v0/pendency` |

## Available operations

<Steps>
  <Step title="Create a standalone pendency">
    `POST /v0/pendency` with `employee_id`, `type_exam` and `send_email` (and optionally
    `send_date`/`exam_date`).
  </Step>

  <Step title="List and filter">
    `GET /v0/pendency` with filters by `organization_id`, `employee_id`, `status` and
    `type_exam`, plus cursor pagination.
  </Step>

  <Step title="Cancel">
    `POST /v0/pendency/cancel` with `pendency_id` and, optionally, a `note` with the reason.
  </Step>
</Steps>

<Info>
  There is no public endpoint to **schedule** the exam: scheduling and performing happen inside
  the Salú platform. You track the result via the pendency `status`.
</Info>

## Endpoints

<CardGroup cols={3}>
  <Card title="List" icon="list" href="/public-api/en/endpoints/pendencies/public_list_pendencies_v0_pendency__get_en" />

  <Card title="Create" icon="plus" href="/public-api/en/endpoints/pendencies/public_create_pendency_v0_pendency__post_en" />

  <Card title="Cancel" icon="xmark" href="/public-api/en/endpoints/pendencies/public_cancel_pendency_v0_pendency_cancel_post_en" />
</CardGroup>
