> ## Documentation Index
> Fetch the complete documentation index at: https://ekacare-mintlify-dfb0ffc0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Milestone 3

> Consent management and health data retrieval flow for ABDM integration.

## M3 Flow — Consent & Health Data Retrieval

### HIU — Consent Management

```mermaid theme={null}
flowchart LR
  A["Create Consent"] --> B["Consent List"]
  B --> C["Consent Details"]
```

### PHR — Consent Actions

```mermaid theme={null}
flowchart LR
  A["Consent Approve"] --> B["Consent Deny"]
  B --> C["Consent Revoke"]
```

<Note>
  **Consent Approve** is triggered after the HIU creates a consent request. The PHR user can approve, deny, or later revoke the consent.
</Note>

### Data Retrieval

```mermaid theme={null}
flowchart TD
  A["Consent Approve"]
  A --> B{"Data stored by Eka Care?"}

  B -->|Yes| C["Retrieve Health Records"]
  B -->|No| D["Health Data Received from HIP ― Webhook"]
```

<Note>
  If data is **not** stored by Eka Care, the system waits for the HIP to push data. Your server will receive this via the \*\* Health Data Received from HIP\*\* webhook.
</Note>

| Step                          | Type    | Description                                                     |
| ----------------------------- | ------- | --------------------------------------------------------------- |
| Health Data Received from HIP | Webhook | Triggered when HIP pushes health records after consent approval |
