> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/health/v2.0/design/architecture/low-level-design/services/console-services/excel-ingestion.md).

# Excel Ingestion

### Overview

The service generates localized Excel templates with built-in validations such as dropdowns and hierarchy checks, and it processes uploaded Excel data asynchronously.

### &#x20;**Dependencies**

* Access Control
* Boundary
* Facility
* File Store
* Individual
* Localisation
* MDMS
* Project Factory

### API Specification

```
Base Path: /excel-ingestion/
```

API Contract :&#x20;

### Data Model

DB Schema Diagram

{% tabs %}
{% tab title="Generate" %}

```
TABLE eg_ex_in_generated_files (
    id                VARCHAR(100)  PRIMARY KEY,
    referenceId       VARCHAR(100)  NOT NULL,
    referenceType     VARCHAR(100),      
    tenantId          VARCHAR(100)  NOT NULL,
    type              VARCHAR(50)   NOT NULL,
    hierarchyType     VARCHAR(100),
    fileStoreId       VARCHAR(200),
    status            VARCHAR(20)   NOT NULL,
    additionalDetails JSONB,
    locale            VARCHAR(64),
    createdBy         VARCHAR(100),
    lastModifiedBy    VARCHAR(100),
    createdTime       BIGINT,
    lastModifiedTime  BIGINT
)
```

{% endtab %}

{% tab title="Process" %}

```
TABLE eg_ex_in_excel_processing (
    id                    VARCHAR(100)  PRIMARY KEY,
    referenceId           VARCHAR(100)  NOT NULL,
    referenceType         VARCHAR(100),             
    tenantId              VARCHAR(100)  NOT NULL,
    type                  VARCHAR(50)   NOT NULL,
    hierarchyType         VARCHAR(100)  NOT NULL,
    fileStoreId           VARCHAR(200)  NOT NULL,
    processedFileStoreId  VARCHAR(200),
    processedStatus       VARCHAR(200),          
    status                VARCHAR(20)   NOT NULL,
    additionalDetails     JSONB,
    createdBy             VARCHAR(100),
    lastModifiedBy        VARCHAR(100),
    createdTime           BIGINT,
    lastModifiedTime      BIGINT
)
```

{% endtab %}

{% tab title="Sheet Data Temp" %}

```
TABLE eg_ex_in_sheet_data_temp (
    referenceId         VARCHAR(100)    NOT NULL,
    tenantId            VARCHAR(100)    NOT NULL,
    fileStoreId         VARCHAR(100)    NOT NULL,
    sheetName           VARCHAR(100)    NOT NULL,
    rowNumber           INTEGER         NOT NULL,
    rowJson             JSONB           NOT NULL,
    createdBy           VARCHAR(100)    NOT NULL,
    createdTime         BIGINT          NOT NULL,
    deleteTime          BIGINT          NOT NULL DEFAULT (EXTRACT(EPOCH FROM NOW()) * 1000 + 86400000),
    PRIMARY KEY (referenceId, fileStoreId, sheetName, rowNumber)
)
```

{% endtab %}
{% endtabs %}

### Web Sequence Diagrams

{% tabs %}
{% tab title="Generate" %}

```
/excel-ingestion/v1/data/generate/_init
```

<figure><img src="https://3976166735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmb5VUHEnO0msarLMPz6q%2Fuploads%2FeWEG1oSQTijCjiMDfXVm%2Fgenerate.png?alt=media&amp;token=a453cdcf-d24f-4367-a935-7c8cc2e4184f" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Process-Validation" %}

```
/excel-ingestion/v1/data/process/_validation
```

<figure><img src="https://3976166735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmb5VUHEnO0msarLMPz6q%2Fuploads%2F4EYYBbsfQPYN242U3TW0%2Fprocess_validarion.png?alt=media&amp;token=e25b3803-0c24-4ece-b870-26971e6cd4fc" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Process Create" %}

```
/excel-ingestion/v1/data/process/_create
```

<figure><img src="https://3976166735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmb5VUHEnO0msarLMPz6q%2Fuploads%2FJ9VEeIkkAa17CY3Xpy0d%2Fprocess_create.png?alt=media&amp;token=b1f03459-a684-48e9-8fc4-3800cada6a1c" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Sheet Search" %}

```
/excel-ingestion/v1/data/sheet/_search
```

<figure><img src="https://3976166735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmb5VUHEnO0msarLMPz6q%2Fuploads%2FGVezRvgJlqSLxEvqqFuH%2Fsheet.png?alt=media&amp;token=055fdc50-d2f0-42d3-951f-b33fd55b50a5" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digit.org/health/v2.0/design/architecture/low-level-design/services/console-services/excel-ingestion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
