Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

logo_bulkload_eyeseetea_dhis2_suite_apps

DHIS2 Bulk Load

Bulk Load connects DHIS2 and Excel to simplify import and export workflows. It can generate templates from datasets/programs, upload data from completed files, and download DHIS2 data as Excel files.

This repository is a PAHO/CIM fork, updated to newer DHIS2-compatible versions to keep the app operational and adapted to VPD-SMART functionality.

Documentation

You can find a detailed user and developer guide at the wiki and also our road map You can download User Extended from the DHIS2 App Hub

For more links, see the Bulk Load App website

Feedback

For this fork, please contact the PAHO/CIM team for maintenance and VPD-SMART related updates.

About & Sponsorships

Original Bulk Load development was led by EyeSeeTea SL, with support from WHO and partners including Samaritan's Purse, MSF, NRC and CHAI. Source code and original documentation are available at the Bulk Load project page.

The PAHO/CIM fork focuses on keeping compatibility with current DHIS2 versions and adapting the app to VPD-SMART workflows.

Setup

Install dependencies:

$ yarn install

Development

Start the development server:

$ PORT=8081 REACT_APP_DHIS2_BASE_URL="http://localhost:8080" yarn start

Now in your browser, go to http://localhost:8081.

Notes:

  • Requests to DHIS2 will be transparently proxied (see src/setupProxy.js) from http://localhost:8081/dhis2/path to http://localhost:8080/path to avoid CORS and cross-domain problems.

  • The optional environment variable REACT_APP_DHIS2_AUTH=USERNAME:PASSWORD forces some credentials to be used by the proxy. This variable is usually not set, so the app has the same user logged in at REACT_APP_DHIS2_BASE_URL.

  • The optional environment variable REACT_APP_PROXY_LOG_LEVEL can be helpful to debug the proxyfied requests (accepts: "warn" | "debug" | "info" | "error" | "silent")

  • Create a file .env.local (copy it from .env) to customize environment variables so you can simply run yarn start.

  • why-did-you-render is installed, but it does not work when using standard react scripts (yarn start). Instead, use yarn craco-start to debug re-renders with WDYR. Note that hot reloading does not work out-of-the-box with craco.

VPD-SMART / DHIS2 2.42 compatibility

This repository is configured to work with the VPD-SMART tracker structure on DHIS2 2.42+:

  • App runtime API version is set to 42.
  • Tracker imports use /api/tracker with these defaults:
  • importStrategy=CREATE_AND_UPDATE
  • atomicMode=OBJECT
  • skipProgramRules=true
  • importReportMode=ERRORS
  • async=false
  • Tracker import response handling supports both:
  • Synchronous inline reports (common in v42 with async=false)
  • Asynchronous job-based reports (/api/tracker/jobs/...)

Tests

Unit tests

$ yarn test

Integration tests (Cypress)

Create the required users for testing (cypress/support/App.ts) in your instance and run:

$ export CYPRESS_EXTERNAL_API="http://localhost:8080"
$ export CYPRESS_ROOT_URL=http://localhost:8081

# non-interactive
$ yarn cy:e2e:run

# interactive UI
$ yarn cy:e2e:open

Build app ZIP

$ yarn build

i18n

$ yarn localize

App context

The file src/webapp/contexts/app-context.ts holds some general context so typical infrastructure objects (api, d2, ...) are readily available. Add your own global objects if necessary.

Import XLSX files (from filled templates)

You can use the script import-multiple-files.ts to import multiple xlsx files:

#!/bin/bash

npx ts-node src/scripts/import-multiple-files.ts \
    --dhis2-url="http://admin:district@localhost:8080" \
    --results-path="/path/to/folder/for/json_results" \
    file1.xlsx file2.xlsx

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages