The Bulk Load application generates templates (an Excel sheet) and imports multiple data values for DHIS2 v2.30 instances. Some notes:
- Settings are only visible for superusers (
ALLauthority) or users that belong to the settings groups. - The generation box is only visible for users that belong to the configurable
Template Generationgroups (initial value:HMIS Officers).
Install dependencies:
$ yarn install
Start the development server:
$ PORT=8081 VITE_DHIS2_BASE_URL="http://localhost:8080" VITE_DHIS2_AUTH="" yarn start
Now in your browser, go to http://localhost:8081.
Notes:
-
Requests to DHIS2 will be transparently proxied from
http://localhost:8081/dhis2/pathtohttp://localhost:8080/path(seevite.config.ts) to avoid CORS and cross-domain problems. -
The optional environment variable
VITE_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 atVITE_DHIS2_BASE_URL. -
The optional environment variable
VITE_PROXY_LOG_LEVELcan be helpful to debug the proxied 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 loaded in development to help debug re-renders.
$ yarn test
$ 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