# Importing Data

{% hint style="info" %}
This page applies to SanteDB Version 3.0
{% endhint %}

## Import Dashboard

The import dashboard is accessed under the **Reference Data** menu in the **Import** screen.&#x20;

<figure><img src="/files/lGzZ1BhIABqkiG2bz7q8" alt=""><figcaption></figcaption></figure>

The dashboard shows the foreign data files which have been upload to the SanteDB server.

<figure><img src="/files/AYuDX7ySrc9ok4n6PZ9C" alt=""><figcaption></figcaption></figure>

The status column indicates the state of the file:

* Completed Successfully- The import has been completed and no errors or issues were detected.
* Completed with Warnings - The import was partially completed, however there were issues with the source data.
* Rejected - The import was rejected - and cannot be imported.
* Staged - The import data is uploaded on the server, however it has not been scheduled for import
* Scheduled - The import data will be processed when the foreign data import job is next run.
* Running - The import data is currently being imported into the SanteDB database..

## Uploading an Import File

Imports for data are processed on the server in the background. To begin the process, access the upload screen and select the source file for import.

{% hint style="info" %}
Currently only CSV is supported as a data import format.
{% endhint %}

<figure><img src="/files/VCsiSVLnrqHzkox9PUrt" alt=""><figcaption></figcaption></figure>

1. Select the file which should be imported. Your file should be within the allowable file upload limit for your environment.
2. Select the import mapping which has been created by your development team. The **ONC Patient Matching Dataset** is included standard with SanteDB (<https://github.com/onc-healthit/patient-matching>)
3. Provide a friendly name for the import. This acts as the label for the import.

## Running the Import

After upload, the imports are placed into a **Staged** state. This state indicates that the file is valid and ready to be executed. The import process is executed by the **Import Foreign Data** background process, which is automatically run at midnight every night.&#x20;

The user can manually initiate the import process.

## Reviewing and Correcting Issues

After import, the file may be placed in the **Completed With Errors** state. This indicates that not all records could be processed in the file. Users can view the issues by clicking on the import details screen.

<figure><img src="/files/CS2I9AMXukClOK41f7xl" alt=""><figcaption></figcaption></figure>

To correct import errors, you may download the **Rejected Records** file to your hard disk. This file matches the format of the original import file, with an additional column named `import_error`. This column indicates the issue that needs to be corrected.&#x20;

After all errors have been corrected, you may upload the corrected reject file, and repeat the process.


---

# Agent Instructions: 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:

```
GET https://help.santesuite.org/operations/cdr-administration/santedb-administration-panel/cdr-administration/importing-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
