It is highly recommended to test the whole configuration part including running over a period of time on a development/test server before implementing it in production.
Use pipenv (the recommended wrapper for virtualenvs and pip) to install this package.
It depends on Python 3.5+ and various packages as described in
Pipfile and DHIS2 2.28 as for now.
- Briefcase version: 1.10.1 Production (see ODK Github)
- smartva: SmartVA-Analyze, version 2.0.0-a8
- Min. 2GB RAM
- Min. 2 CPUs
Ubuntu installation (tested with 16.04 LTS)
sudo apt update sudo apt install python3 sudo apt install python3-venv python3-pip (As a non-root user) pip3 install pipenv --user git clone --depth=1 https://github.com/D4H-VA/smartva-dhis2 cd smartva-dhis2 pipenv install --ignore-pipfile --deploy
Refer to the configuration pages first before running it:
cd ~/smartva-dhis2 (adjust to path where you cloned the repository) pipenv run smartva-dhis2 [--options]
--manual Skip download of ODK aggregate file, provide local file path instead --all Pull ALL briefcases instead of relative time window
If you do not provide any argument, it will attempt to import ODK Aggregate records from last week (today minus 7 days).
e.g. if today is
2018-04-08 it attempts to download records for
This is scheduled to run every three hours (leading to messages that the record is already in DHIS2) but then it’s expected.
This application builds on the fact that Study ID numbers (SID) are always unique and not modified in DHIS2 after the import.
To run tests:
pipenv install --dev pipenv run python setup.py test
Make sure the script is running even after server reboots - how this is achieved depends on the Operating System. For systemd-based Operating Systems, you can install the following service.
[Unit] Description=smartva-dhis2 After=multi-user.target [Service] Type=simple Restart=always User=ubuntu WorkingDirectory=~/smartva-dhis2 ExecStart=~/.local/bin/pipenv run smartva-dhis2 [Install] WantedBy=multi-user.target
~/smartva-dhis2to where you’ve installed the repository
- Adjust the path to
pipenv- you can find out the path by calling
- Adjust the
ubuntuuser to the user that runs the script
~means expanding to the home folder of the user as specified in
Systemd service installation on Ubuntu:
sudo nano /etc/systemd/system/smartva-dhis2.service (adjust and paste above config) sudo systemctl enable smartva-dhis2.service sudo systemctl start smartva-dhis2.service (to see the status of the service:) sudo systemctl start smartva-dhis2.service (check log files:) tail -f smartva_dhis2.log