This utility copies data between a DHIS2 server and a Sync Endpoint server.
- for building a JAR,
- for building a Docker Image
- Docker 17.06.1 or newer
- Download this repository, DHIS2-ODK2-Bridge.zip
Or clone it,git clone https://github.com/uw-ictd/DHIS2-ODK2-Bridge.git
- Run
mvn validate package
in project root directory - After the command returns, the JAR will be available under
dhis2-odk2-bridge-cli/target
docker build --pull -t odk/dhis2-odk2-bridge https://github.com/uw-ictd/DHIS2-ODK2-Bridge.git
Run CLI jar with path to your configuration file as the first argument.
For example, to run this tool with a configuration file located at $HOME/configuration.properties
java -jar dhis2-odk2-bridge-cli-1.0-SNAPSHOT-jar-with-dependencies.jar $HOME/configuration.properties
Or using Docker,
docker run \
-v $HOME/configuration.properties:/config \
odk/dhis2-odk2-bridge /config
See example.properties for detail on the configuration file.
This bridge utility only performs a one time transfer of data. If you wish to periodically transfer data, you will need to setup the scheduling using other tools such as cron.
- Sync Endpoint tables and DHIS2 data sets must have the same names
- Columns of Sync Endpoint tables and DHIS2 data elements must have the same names
- Sync Endpoint tables must have the columns
period
andorgUnit
, these columns are necessary to correctly place and locate data values - Sync Endpoint tables to be transfered to DHIS2 data sets must have the columns
period
andorgUnit
. Sync Endpoint tables to be transfered to DHIS2 tracked entities must have the columnsorgUnit
andtrackedEntityInstance
. - DHIS2 servers must have the tracked entity attribute
SyncEndpointRowId
for this tool to copy data to a tracked entity. - Data conflict (on either DHIS2 or Sync Endpoint) must be resolved prior to running this utility, or choose to override with available value
- DHIS2 asynchronous data import is not supported
- Data sets, data elements, and tables, must be created prior to using this utility
This tool was tested with a DHIS2 server setup using Docker Compose scripts provided by DHIS2 API Tests. A standalone installation of DHIS2 would work as well.
Make sure you have the prerequisite softwares before proceding. In addition to the ones in the prerequisite, you will also need App Designer, ODK Services, ODK Tables
- Setup
- Deploy a DHIS2 server
- Deploy a Sync Endpoint server
- Configure the DHIS2 instance
- Configure your organization units as following:
OU ├── Province 1 │ ├── District 1 │ │ ├── Catchment 1 │ │ └── Catchment 6 │ └── District 2 │ ├── Catchment 2 │ └── Catchment 7 └── Province 2 ├── District 3 │ └── Catchment 3 └── District 4 ├── Catchment 4 └── Catchment 5
-
Configure these tracked entity attributes:
- SyncEndpointRowId - Text
- comment - Long Text
- data_selected - Text
- exclude - Integer
- head_name - Text
- house_number - Integer
- location_accuracy - Number
- location_altitude - Number
- location_latitude - Number
- location_longitude - Number
- questionnaire_status - Text
- random_number - Number
- sample_frame - Integer
- selected - Integer
- valid - Integer
All of them should have Aggregation Type set of None and set to display in list without program.
-
Configure a tracked entity called census
- Configure the Sync Endpoint instance
- Extract
malaria-app.zip
located inmalaria-app
directory to your app-designer'sapp/config
directory replacing it. - Use
grunt adbpush
to upload the malaria app to your Android phone - Configure ODK Services to use your Sync Endpoint instance
- Reset app server using ODK Services
- Extract
- Enter data
- Enter data using ODK Tables
- Sync to Sync Endpoint using ODK Services
- Use this bridge
example.properties
is configured with sample values that should work with the malaria demo. Fill in DHIS2 and Sync Endpoint server detail in the file- Run the bridge using this configuration file, refer to above for detail.