DHIS2 Developer Manual

DHIS2 Documentation Team

2.22

Warranty:  THIS DOCUMENT IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS MANUAL AND PRODUCTS MENTIONED HEREIN, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

License:  Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the source of this documentation, and is available here online: http://www.gnu.org/licenses/fdl.html.

Revision History
Revision Revision 1925
Version 2.22 2016-11-23 11:33:56

Table of Contents

1. Web API
1.1. Introduction
1.2. Authentication
1.2.1. Basic Authentication
1.2.2. OAuth2
1.3. Error and info messages
1.4. Date and period format
1.5. Identifier Schemes
1.6. Browsing the Web API
1.6.1. Translation
1.7. Working with the metadata API
1.7.1. Content types
1.7.2. Query parameters
1.7.3. Available strategies for import
1.7.4. Examples
1.8. Metadata object filter
1.9. Metadata field filter
1.9.1. Field transformers
1.9.2. Field converters
1.10. Metadata create, read, update, delete, validate
1.10.1. Create / update parameters
1.10.2. Creating and updating objects
1.10.3. Deleting objects
1.10.4. Adding and removing objects to/from collections
1.10.5. Validating payloads
1.10.6. Partial updates
1.11. CSV metadata import
1.11.1. Data elements
1.11.2. Organisation units
1.11.3. Validation rules
1.11.4. Option sets
1.11.5. Other objects
1.12. File resources
1.12.1. File resource constraints
1.13. Data values
1.13.1. Sending data values
1.13.2. Sending bulks of data values
1.13.3. Import parameters
1.13.4. CSV data value format
1.13.5. Generating data value set template
1.13.6. Sending, reading and deleting individual data values
1.13.7. Reading data values
1.14. ADX formatted data
1.14.1. The adx root element
1.14.2. The group element
1.14.3. Data values
1.14.4. Importing data - HTTP POST
1.14.5. Exporting data - HTTP GET
1.15. Events
1.15.1. Sending events
1.15.2. CSV Import / Export
1.15.3. Querying and reading events
1.16. Program rules
1.16.1. Program rules model
1.16.2. Posting rules through the API
1.17. Forms
1.18. Validation
1.19. Data integrity
1.19.1. Running data integrity
1.19.2. Fetching the result
1.20. Indicators
1.20.1. Aggregate indicators
1.20.2. Program indicators
1.20.3. Expressions
1.21. Complete data set registrations
1.21.1. Completing and un-completing data sets
1.21.2. Reading complete data set registrations
1.22. Data approval
1.22.1. Get approval status
1.22.2. Approve data
1.22.3. Bulk approve data
1.23. Auditing
1.23.1. Aggregate data value audits
1.23.2. Tracked entity data value audits
1.23.3. Tracked entity attribute value audits
1.24. Messages
1.24.1. Writing and reading messages
1.24.2. Managing messages
1.25. Interpretations
1.25.1. Reading interpretations
1.25.2. Writing interpretations
1.25.3. Creating, updating and removing interpretation comments
1.26. Viewing analytical resource representations
1.27. Plugins
1.27.1. Embedding pivot tables with the Pivot Table plug-in
1.27.2. Embedding charts with the Visualizer chart plug-in
1.27.3. Embedding maps with the GIS map plug-in
1.27.4. Creating a chart carousel with the carousel plug-in
1.28. SQL views
1.28.1. Criteria
1.28.2. Variables
1.29. Dashboard
1.29.1. Browsing dashboards
1.29.2. Searching dashboards
1.29.3. Creating, updating and removing dashboards
1.29.4. Adding, moving and removing dashboard items and content
1.30. Analytics
1.30.1. Dimensions and items
1.30.2. Request query parameters
1.30.3. Response formats
1.30.4. Constraints
1.30.5. Debugging
1.31. Event analytics
1.31.1. Dimensions and items
1.31.2. Request query parameters
1.31.3. Event query analytics
1.31.4. Event aggregate analytics
1.32. Geo features
1.32.1. GeoJSON
1.33. Generating resource and analytics tables
1.34. Maintenance
1.35. System resource
1.35.1. Generate identifiers
1.35.2. View system information
1.35.3. Check if username and password combination is correct
1.35.4. View asynchronous task status
1.35.5. Get appearance information
1.36. Locales
1.36.1. UI locales
1.36.2. Database content locales
1.37. Translations
1.37.1. Create translation
1.37.2. Get translations
1.38. Short Message Service (SMS)
1.38.1. Outbound SMS service
1.38.2. Inbound SMS service
1.38.3. SMS service administration
1.38.4. Gateway service administration
1.38.5. Gateway configuration
1.39. Users
1.39.1. User query
1.39.2. User account create and update
1.39.3. User account invitations
1.39.4. User replication
1.40. Current user information and associations
1.41. System settings
1.42. User settings
1.43. Organisation units
1.44. Static content
1.45. Configuration
1.46. Internationalization
1.47. SVG conversion
1.48. Tracked entity management
1.49. Tracked entity instance management
1.49.1. Creating a new tracked entity instance
1.49.2. Updating a tracked entity instance
1.49.3. Deleting a tracked entity instance
1.49.4. Enrolling a tracked entity instance into a program
1.49.5. Update strategies
1.50. Tracked entity instance query
1.50.1. Request syntax
1.50.2. Response format
1.51. Tracked entity instance grid query
1.51.1. Request syntax
1.51.2. Response format
1.52. Enrollment instance query
1.52.1. Request syntax
1.52.2. Response format
1.53. Tracker bulk deletion
1.54. Email
1.54.1. System notification
1.54.2. Test message
1.55. Sharing
1.56. Scheduling
1.57. Schema
1.58. UI customization with Javascript and CSS files
1.59. Synchronization
1.59.1. Data push
1.59.2. Metadata pull
1.60. Apps
1.60.1. Get apps
1.60.2. Install an app
1.60.3. Delete an app
1.60.4. Reload apps
1.60.5. Configure apps
1.61. App store
1.61.1. Get apps
1.61.2. Install apps
1.62. Data store
1.62.1. Data store structure
1.62.2. Get keys and namespaces
1.62.3. Create and update values
1.62.4. Delete keys
1.63. Metadata repository
1.64. FRED API
2. Apps
2.1. Purpose of packaged Apps
2.2. Creating Apps
2.3. Installing Apps into DHIS 2
2.4. Launching Apps
2.5. Adding the DHIS 2 menu to your app
3. Infrastructure
3.1. Release process
DHIS 2 Technical Architecture
1. Overview
2. Technical Requirements
3. Project Structure
4. Project Dependencies
5. The Data Model
6. The Persistence Layer
7. The Business Layer
7.1. The JDBC Service Project
7.2. The Data Mart Project
7.3. The Reporting Project
7.4. The System Support Project
8. The Presentation Layer
8.1. The Portal
9. Framework Stack
9.1. Application Frameworks
9.2. Development Frameworks
10. Definitions
A. R and DHIS 2 Integration
A.1. Introduction
A.2. Using ODBC to retrieve data from DHIS2 into R
A.3. Using R with MyDatamart
A.4. Mapping with R and PostgreSQL
A.5. Using R, DHIS2 and the Google Visualization API
A.6. Using PL/R with DHIS2
A.7. Using this DHIS2 Web API with R

List of Figures

1. Data value structure

List of Tables

1.1. WebMessage properties
1.2. Period format
1.3. Scheme Values
1.4. Query parameters
1.5. Translate options
1.6. Available Content-Types
1.7. Available Query Filters
1.8. Available Strategies
1.9. Available Operators
1.10. Property operators
1.11. Field presets
1.12. Field converters
1.13. Available Query Filters
1.14. Data Element CSV Format
1.15. Organisation Unit CSV Format
1.16. Validation Rule CSV Format
1.17. Option Set CSV Format
1.18. Data Element Group, Category Option, Category Option Group, Organisation Unit Group CSV Format
1.19. Import parameters
1.20. CSV format of DHIS 2
1.21. Data values query parameters
1.22. Data values query parameters
1.23. Data value set query parameters
1.24. Events resource format
1.25. CSV column
1.26. Events resource query parameters
1.27. programRule
1.28. programRuleAction
1.29. programRuleVariable
1.30. Form query parameters
1.31. Operators
1.32. Missing value strategies
1.33. Indicator variables
1.34. Program indicator variables
1.35. Complete data set registrations query parameters
1.36. Data value set query parameters
1.37. Data approval query parameters
1.38. Data approval query parameters
1.39. Data approval states
1.40. Data approval action parameters
1.41. Aggregate data value query parameters
1.42. Tracked entity data value query parameters
1.43. Tracked entity attribute value query parameters
1.44. Analytical resources
1.45. Data query parameters
1.46. Query parameters for png / image types (charts, maps)
1.47. Pivot table plug-in configuration
1.48. Visualizer chart plug-in configuration
1.49. GIS map plug-in configuration
1.50. Map plug-in configuration
1.51. Items content parameters
1.52. Dimensions and dimension items
1.53. Query parameters
1.54. Event dimensions
1.55. Query parameters for both event query and aggregate analytics
1.56. Query parameters for event query analytics only
1.57. Query parameters for aggregate event analytics only
1.58. Filter operators
1.59. Geo features response
1.60. Analytics tables optional query parameters
1.61. HTTP Status codes
1.62. Task categories
1.63. User query parameters
1.64. Gateway api end points
1.65. User query parameters
1.66. User settings
1.67. Organisation units query parameters
1.68. Static content keys
1.69. Configuration values
1.70. Query parameters
1.71. Available tracker strategies
1.72. Tracked entity instances query parameters
1.73. Organisation unit selection modes
1.74. Filter operators
1.75. Tracked entity instances query parameters
1.76. Organisation unit selection modes
1.77. Filter operators
1.78. Tracked entity instances query parameters
1.79. Organisation unit selection modes
1.80. Task strategies
1.81. Data store structure