https://github.com/worldhealthorganization/ncd-e-registry
https://github.com/worldhealthorganization/ncd-e-registry
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/worldhealthorganization/ncd-e-registry
- Owner: WorldHealthOrganization
- Created: 2025-02-26T01:06:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-20T16:16:01.000Z (6 months ago)
- Last Synced: 2025-11-20T18:11:49.348Z (6 months ago)
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WHO NCD E-Registry
This repository contains WHO Noncommunicable Disease (NCD) E-Registry package developed by [Surveillance, Monitoring and Reporting (SMR)](https://www.who.int/teams/noncommunicable-diseases/surveillance).
## Services
1. **PostgreSQL with PostGIS:** Stores core data for NCD registry and reporting.
2. **NCD DHIS2 Backend**: Handles business logic, data processing, and API integration.
3. **NCD Web App (React/Frontend)**: User-facing web application for managing and reporting NCD data.
4. **NCD Dashboard (React/Analytics)**: Interactive dashboard for data visualization and monitoring.
## Pre-Setup Configuration
Before building images and running containers of the latest release, update the configuration files as described below:
**1. PostgreSQL Configuration**\
File: `ncd-tomcat/dhis_config/dhis.conf`\
Edit database connection details as per your configuration, for exmple:
```ini
connection.url = jdbc:postgresql://:/
```
\
**2. NCD Web App Configuration**\
_a. Update Environment Variables:_\
File: `ncd-webapp/.env`
```ini
REACT_APP_SERVICE_URL=https:///service/
REACT_APP_SERVICE_URL_API=https:///service/api/
REACT_APP_DASHBOARD_URL=https:///ncddashboardv3/
```
b. Update Homepage URL:\
File: `ncd-webapp/package.json`
```json
"homepage": "https:///ncd/"
```
\
**3. NCD Dashboard Configuration**\
_a. Update Environment Variables:_\
File: `ncd-dashboard/.env`
```ini
REACT_APP_URL_MAIN=https:///
REACT_APP_URL_SERVICE=https:///service/api/
```
_b. Update Homepage URL:_\
File: `ncd-dashboard/package.json`
```json
"homepage": "https:///ncddashboardv3/"
```
## Building & Running NCD E-Registry
From the project root directory, run `docker compose up -d --build` to:
1. Start PostgreSQL with PostGIS and populate it with data
2. Build and start the DHIS2 backend
3. Build and start the Web App and Dashboard
## Accessing the Applications
Nginx can be used as a frontend server to route domain traffic to Docker containers. Make sure your domain and SSL configurations are correctly set in your Nginx configuration files, for example:
```nginx
server {
server_name ;
location /service/ {
proxy_pass http://localhost:8080/service/;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
location /ncddashboardv3/ {
proxy_pass http://localhost:81/ncddashboardv3/;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
location /ncd/ {
proxy_pass http://localhost:82/ncd/;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
```
## Indicator API
### Overview
The Indicator API allows clients to fetch calculated indicator values based on:
- Report date
- Organization unit (facility or district)
- NCD program
- Disease type
- Organization level (facility vs district)
All endpoints require the same authentication used by the dashboard application.
### 1. Patient-level indicators API
**Endpoint Details:**
- **URL:** `https:///service/api/dashboardIndicator/getIndicatorsnd`
- **Method:** POST
- **Content-Type:** `application/json`
- **Authentication:** Uses the same credentials as the dashboard
**Purpose:**
Retrieves values for patient-level indicators based on specified criteria including organization unit (facility or district), program, disease type, and reporting date.
**Request Format:**
```json
{
"orguid": "ORG_UID",
"programuid": "eAHvg6zuxvK",
"typeofdisease": "All",
"reportdate": "REPORT_DATE",
"orgflag": "F"
}
```
**Request Parameters:**
| Parameter | Type | Required | Description |
| --------------- | ------ | -------- | ------------------------------------------------------------------ |
| `orguid` | string | Yes | Unique identifier for the organization unit (facility or district) |
| `programuid` | string | Yes | Unique identifier for the NCD program (default: eAHvg6zuxvK) |
| `typeofdisease` | string | Yes | Disease type filter - see available options below |
| `reportdate` | string | Yes | Report date in YYYY-MM-DD format |
| `orgflag` | string | Yes | Organization level flag: "F" for facility, "D" for district |
**Disease Type Options:**
- `"All"` - Returns indicators for all disease types
- `"Hypertension and cardiovascular disease"`
- `"General cancer"`
- `"Diabetes"`
- `"Chronic respiratory diseases"`
- `"Childhood cancer"`
- `"Breast cancer"`
**Usage Notes:**
- Use `"orgflag": "D"` to retrieve aggregated district-level data
- Use `"orgflag": "F"` to retrieve specific facility-level values
- The `typeofdisease` parameter allows filtering by individual diseases or viewing all diseases combined
### 2. Facility-level indicators API
**Endpoint Details:**
- **URL:** `https:///service/api/dashboardIndicator/getCustomFacilityDashboard`
- **Method:** GET
- **Content-Type:** `application/json`
- **Authentication:** Uses the same credentials as the dashboard
**Purpose:**
Retrieves facility-level indicators for a specific facility and quarter.
**Request Format:**
```
GET /service/api/dashboardIndicator/getCustomFacilityDashboard?orguid=ORG_UID&year=REPORT_DATE
```
**Query Parameters:**
| Parameter | Type | Required | Description |
| --------- | ------ | -------- | --------------------------------------------------------- |
| `orguid` | string | Yes | Unique identifier for the facility |
| `year` | string | Yes | Reporting quarter in YYYYQN format (e.g., 2022Q1, 2022Q2) |
**Example Request:**
```
https:///service/api/dashboardIndicator/getCustomFacilityDashboard?orguid=YUv0ube9634&year=2022Q1
```