# Country input facility data set

The workbook of monthly health facility data by district and indicator, exported from HMIS/DHIS2, and how it is loaded.

The country input facility data set is the country's *DHIS2* (District Health Information Software 2, the software most countries use as their health management information system (HMIS); health facilities' monthly reports are entered in it, and the facility data workbook is exported from it.) data by month, district and
indicator, in an Excel workbook. The app reads it, checks it and saves it as the master facility crude data set, the
starting point of the [data quality assessment](https://datasuite.damurka.com/en/methodology/data-quality.md) and every later step.

> **Note**
>
> **At a glance**
> - **Holds:** the monthly service numbers, reporting completeness, population and administrative data of every district.
> - **Format:** an Excel workbook (`.xlsx` or `.xls`) from the [Data Extractor](https://datasuite.damurka.com/en/apps/data-extractor.md) the first time; the saved `.rds` afterwards.
> - **In the app:** the **Upload Data** step of [Getting started](https://datasuite.damurka.com/en/apps/countdown/getting-started.md#upload-data).

## Why

Routinely reported health facility data are an important data source for health indicators at facility and population
level. The data are reported by health facilities on events such as immunizations given, or live births attended. They
give the numerators of the coverage statistics, for the country and for every region and district, year after year.

## What

The workbook, in the format produced by the [Data Extractor](https://datasuite.damurka.com/en/apps/data-extractor.md), must contain these sheets:

| Sheet | What it holds |
| --- | --- |
| `Admin_data` | The country, its first administrative level (*Admin 1* (The first level below the national level, such as a region, province or department. Districts (Admin 2) are the level below it.)) and districts, with the number of facilities and health workers (*Admin data* (District, region, country; hospitals, health centres, all facilities, private for-profit and non-profit facilities; physicians, nurses/midwives, clinical officers, non-clinician physicians; hospital beds.)) |
| `Population_data` | Population, births and target groups by district and year (*Population data* (By district and year: growth rate, total population, under-5, under-1, projected live births and total births (census-based), women 15-49.)) |
| `Reporting_completeness` | Monthly reports expected and received, and the reporting rate, for each reporting form (*Reporting completeness data* (Monthly expected, received and rate for ANC, institutional delivery, vaccinations, OPD and IPD.)) |
| `Service_data` (at least one) | Monthly numbers of services, such as antenatal care visits, deliveries, vaccinations and outpatient visits (*Service data 1* (BCG, Penta1, Penta3, Measles1, Measles2; OPD total and under-5 (new and re-visits); IPD total and under-5; under-5 and all-age facility deaths.), *Service data 2* (ANC1, first-trimester ANC, ANC4, IPT2, IPT3, IFA90, syphilis and HIV tests, SBA, institutional deliveries and live births, C-sections, low birth weight (&lt;2500 g), PNC within 48 hours, stillbirths (total, fresh, macerated), maternal and neonatal deaths.), *Service data 3* (OPV1-3, Penta2, PCV1-3, rotavirus 1-2, IPV1-2, HPV1-2, measles cases.)) |

Each indicator is defined in the [DHIS2 data indicator definitions](https://datasuite.damurka.com/en/methodology/indicator-definitions.md).

The app accepts these files for the facility data:

| Format | When to use it |
| --- | --- |
| Excel workbook: `.xlsx` or `.xls` | The first time: the workbook with the required sheets. |
| Stata dataset: `.dta` | A single, already merged dataset. |
| A dataset already saved by the app: `.rds` | Every later time: it opens without the checks. |

## Working folder

Prepare a dedicated working folder before loading the data. It is where you keep the input files for the app, and where
the app creates the saved data file used for faster loads.

- Choose a clear folder name that you can easily remember and reference, preferably on your computer.
- Place the Excel workbook in that folder before starting the app.
- Keep any related documentation, data or country-specific files together, so the working folder is self-contained.

> **Note**
>
> **Best practice**
> - Use one working folder per country or DHIS2 export batch.
> - Keep the original Excel source file and the generated `.rds` file together.
> - Do not rename the `.rds` file: the app manages it.

## Loading the data

For the first load, use the Excel workbook generated from the HMIS/DHIS2 exports. For later loads, use the
[saved `.rds` file](#rds), which the app creates in the working folder when the workbook is loaded.

## The saved .rds file

- When you load an Excel workbook for the first time, the app converts it and saves a companion [[RDS file|`.rds` file]] in the same working folder.
- On later loads, the app looks for that `.rds` file and uses it, which is much faster.
- When you open the same Excel or Stata file again, the saved copy is loaded instead. Delete it if you changed the workbook and want to load it afresh.

The first load may therefore take a little longer, while the workbook is read and transformed.

## Interpretation

- **Does the workbook cover every year and district you want to analyse?** Missing years or districts cannot be added later in the app.
- **Did you change the workbook since the last load?** Then delete the saved `.rds` copy first, or the app opens the old data.
- **Is the dataset for the right analysis?** A dataset saved by the RMNCAH app cannot be opened in the Vaxx app, and the other way round.

## After the setup

When loaded, the workbook goes through the [checks on the uploaded data](https://datasuite.damurka.com/en/methodology/analysis-setup/data-checks.md).
Once they pass and loading is finished, the data quality assessment can start.
