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.
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
For this fork, please contact the PAHO/CIM team for maintenance and VPD-SMART related updates.
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.
Install dependencies:
$ yarn install
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) fromhttp://localhost:8081/dhis2/pathtohttp://localhost:8080/pathto avoid CORS and cross-domain problems. -
The optional environment variable
REACT_APP_DHIS2_AUTH=USERNAME:PASSWORDforces some credentials to be used by the proxy. This variable is usually not set, so the app has the same user logged in atREACT_APP_DHIS2_BASE_URL. -
The optional environment variable
REACT_APP_PROXY_LOG_LEVELcan 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 runyarn start. -
why-did-you-render is installed, but it does not work when using standard react scripts (
yarn start). Instead, useyarn craco-startto debug re-renders with WDYR. Note that hot reloading does not work out-of-the-box with craco.
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/trackerwith these defaults: importStrategy=CREATE_AND_UPDATEatomicMode=OBJECTskipProgramRules=trueimportReportMode=ERRORSasync=false- Tracker import response handling supports both:
- Synchronous inline reports (common in v42 with
async=false) - Asynchronous job-based reports (
/api/tracker/jobs/...)
$ yarn test
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
$ yarn build
$ yarn localize
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.
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