d2-reports than can be used as an standalone DHIS2 webapp or an standard HTML report (App: Reports). DHIS2 versions tested: 2.34.
This report shows data values for data sets NHWA Module ...
. There are two kinds of data values displayed in the report table:
-
Data values that have comments.
-
Data values related pairs (value/comment), which are rendered as a single row. The pairing criteria is:
- Comment data element
NHWA_Comment of Abc
. - Value data element:
NHWA_Abc
.
- Comment data element
The API endpoint /dataValueSets
does not provide all the features we need, so we use a custom SQL View instead.
$ yarn install
Start the development server at http://localhost:8082
using https://play.dhis2.org/2.34
as a backend:
$ PORT=8082 REACT_APP_DHIS2_BASE_URL="https://play.dhis2.org/2.34" yarn start
Create an standard report:
$ yarn build-report # Creates dist/index.html
$ yarn build-<key>-metadata -u 'user:pass' --url http://dhis2-server.org # Creates dist/metadata.json (key is a particular report group, e.g. nhwa)
$ yarn post-<key>-metadata -u 'user:pass' --url http://dhis2-server.org # Posts dist/metadata.json (key is a particular report group, e.g. nhwa)
Create an standalone DHIS2 webapp app:
$ yarn build-webapp # Creates dist/d2-reports.zip