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

# Overview

A Care Context represents a logical grouping of health records. Each HMIS, LMIS, or PHR system should determine how to organize data into one or more care contexts for a user. For example, a hospital system might create a care context for each hospital visit, a lab test is a care-context for LMIS, or user-uploaded records in a PHR app.

# Care Context Linking and Data Sharing

Enables health data exchange between Health Information Providers (HIPs) and Health Information Users (HIUs).

**1. Link Care Contexts (HIP)**

The HIP links a care context to the patient's ABHA address using the [Care Context Link API](https://developer.eka.care/api-sdk/hie-cm/care-contexts/link/hip-linking.md). This registers the care context with ABDM so it can be discovered and requested by HIUs.

You can optionally include the FHIR data as a base64-encoded string in the `data` field of the Link API request. If provided, Eka stores the data on its servers and handles data sharing automatically when an HIU requests it — you will **not** need to handle the `abha.hip_data_fetch` webhook.

**2. Receive Linking Confirmation**

Listen for the [`abha.link_care_context`](https://developer.eka.care/docs/hie-cm/webhooks/link-care-context) webhook to confirm whether the care context was successfully linked (`LINKED`) or failed (`ERRORED`).

**3. Handle Data Fetch Requests**

When an HIU requests data for a linked care context (after the user grants consent), you receive the [`abha.hip_data_fetch`](https://developer.eka.care/docs/hie-cm/webhooks/hip-data-fetch) webhook. This webhook is sent only if you are **not** storing the data on Eka servers and need to provide it yourself.

**4. Push Encrypted Data**

Prepare the ABDM-compliant FHIR bundle for the requested care contexts, encrypt it using the key information from the webhook, and push it via the [Care Context Data On-Fetch API](https://developer.eka.care/api-sdk/hie-cm/care-contexts/data-on-fetch.md).

> [!NOTE]
>
> If you store health data on Eka servers — either by passing base64-encoded FHIR data in the `data` field of the [Link API](https://developer.eka.care/api-sdk/hie-cm/care-contexts/link/hip-linking.md), or via the [Upload API](https://developer.eka.care/api-sdk/health-records/obtain-authorization.md) — Eka handles data sharing automatically and you will **not** receive the `abha.hip_data_fetch` webhook.

***

# Listing Care Contexts

> [!NOTE]
>
> This feature is useful for displaying a list of care contexts to a doctor (HMIS) or within a PHR app.

Listing linked Care Contexts involves two steps, as an ABHA address could have thousands of documents associated with multiple providers.

**1. List Linked Providers**

Use the [List Providers](https://developer.eka.care/api-sdk/hie-cm/care-contexts/providers/providers.md) API to retrieve all linked providers. This API returns a `hip_id` and the name for each linked provider.

**2. List Care Contexts for a Provider**

Using the `hip_id` obtained from the previous step, use the [List Care Contexts](https://developer.eka.care/api-sdk/hie-cm/care-contexts/records/records.md) API to retrieve all linked care contexts for that provider.

# Linking Care Contexts

## Creating a new Care Context

Care contexts can be linked to an ABHA in various ways, depending on the document type.

## HIP Initiated Linking

Use the [Link](https://developer.eka.care/api-sdk/hie-cm/care-contexts/link/hip-linking.md) API to create the care context. Once linked, you will receive the [`abha.link_care_context`](https://developer.eka.care/docs/hie-cm/webhooks/link-care-context) webhook with the linking status.

## Upload a Medical Record

Use the [Upload](https://developer.eka.care/api-sdk/health-records/obtain-authorization.md) API to upload a document and API will automatically create a care context.

## Discover Unlinked Care Contexts

ABDM allows a user to find their health records from any health facility they have visited via the discovery process.
[Detailed Documentation](https://developer.eka.care/docs/hie-cm/care-contexts/discover/introduction.md)


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