Skip to main content

Overview of available extensibility features

This page provides an overview of the extensibility features available for building on top of and alongside DHIS2.

Web API

The whole Web REST API is available to use. Operations on data and metadata are generic and available to be used by any extension.

  • Metadata API: Provides a set of endpoints for managing all metadata entities, such as data elements, organisation units, indicators, and more. It uses standard CRUD operations via REST. Each metadata type has its own endpoint (e.g., /api/dataElements) supporting JSON and XML formats, and the bulk metadata endpoint supports both import and export with filtering, ordering, and transformation options.
  • Data API: Lets external systems send and retrieve aggregate data values, i.e the actual numeric or textual observations collected against data elements, organisation units and periods. It uses standard HTTP methods (GET, POST) over REST. Data can be exchanged in JSON, XML, or CSV formats.
  • OpenAPI specification: A machine-readable description of the Web API that can be used to generate API clients in different languages and to explore the API interactively.
  • Routes and the accompanying Routes Manager App: Routes are an API feature where the backend can securely perform credentialled requests to other services, so client-side extensions don't have to manage those credentials.
  • Datastore and the accompanying Datastore Management App: Arbitrary data can be saved in JSON format on a DHIS2 instance using the datastore. There is a global datastore, where objects are subject to sharing settings, and a user datastore, where objects are available to the individual user. Objects are organized into namespaces.
  • SQL views: These provide the option of defining custom SQL queries to the database, that can then be executed via the web API to get the result. They can accept variables and parameters to be customized at runtime.
  • Event hooks: These can be set up to trigger events based on metadata changes or scheduler events. Upon triggering, they can trigger a webhook request, send a message to an Apache Artemis JMS or Apache Kafka instance, or log something to the console.

Custom web apps

In addition to the core apps bundled with DHIS2, like the Maintenance, Dashboard and Capture apps, custom frontend apps can be developed and installed in an instance. It's easiest to create these apps with the DHIS2 App Platform, mentioned below.

Core libraries

  • App Platform: The @dhis2/cli-app-scripts package sets up an app scaffold and handles the development and build tooling, including bundling and transpilation, manifest generation, app shell encapsulation, i18n extract and generate, tests infrastructure, and publication. It is the recommended starting point for any new DHIS2 web app.
  • App Runtime: The @dhis2/app-runtime package provides React hooks and components for the things every app does at runtime: data queries and mutations, alerts, configuration, server discovery, online/offline status, and authentication.
  • UI Library: The @dhis2/ui package is a library of reusable, accessible React components that follow the DHIS2 design system, so apps look and behave consistently with the rest of the platform.

CLI tooling

  • DHIS2 CLI: The d2 command-line tool. The d2 app subcommand wraps the App Platform scripts, and there are additional subcommands for cluster management and style configuration. You can also use these scripts to bootstrap new apps. See the DHIS2 Web app page for more information.
  • d2 style: Shared Prettier and ESLint configuration for DHIS2 projects, so all apps use a consistent code style.

Helper libraries

  • Multi-calendar dates: The @dhis2/multi-calendar-dates package handles DHIS2 Periods across every calendar DHIS2 supports, which makes apps work for implementations that don't use the Gregorian calendar. The UI library exposes Calendar and CalendarInput components that build on top of this library.
  • Translation support (d2-i18n): The internationalization helper used by the App Platform's i18n pipeline. Most apps interact with it via i18n.t(...) after running the platform's extract/generate scripts. If you're using the DHIS2 App Platform, much of the setup is handled automatically.
  • Analytics: The @dhis2/analytics package provides helper functions and shared React components used by the analytics apps (Data Visualizer, Line Listing, Pivot Tables) for interacting with the analytics API. Valuable components include Data, Period, and Organisation Unit dimension selectors.

Plugins

Plugins let you embed custom UI inside one of the core DHIS2 apps. They are themselves App Platform apps, but they expose a plugin entry point rather than a full standalone UI, so the host app can render your component at a specific extension point without having to fork the host app. For more information, see the general plugin guide.

The plugins leverage the App Runtime <Plugin> component. This is useful if you want to understand how plugins communicate with their host app, or if you want to embed a plugin inside another app you're building yourself.

Plugin types

  • Dashboard plugins: Add a custom item type to dashboards. Once installed, users can drop your plugin onto a dashboard and configure it like any other dashboard item. Supported from DHIS2 v40.5 onwards, with plugin support introduced in version 101.0.0 of the Dashboard app.
  • Capture plugins: Embed custom UI inside the Capture app. Three plugin extension points are currently supported: Form Field Plugins, which replace a single data element field with a custom input, Enrollment Plugins, which inject custom UI into the enrollment flow, and Bulk Data Entry Plugins, which enable bulk operations in Capture (e.g., updating data across multiple tracked entities).

Reference implementations

Global Shell features

The Global Shell is a shared wrapper that loads all DHIS2 apps inside it, introduced in v42. It provides the redesigned header bar, the Command Palette for navigation (Cmd/Ctrl+K), and shared infrastructure for routing and PWA updates. Most apps work in the Global Shell unchanged, but it also opens up new extension points for apps that opt in.

Extension points

  • Shortcuts: Apps can declare shortcuts in d2.config.js that appear in the Command Palette and link directly into specific pages in the app, so users can jump straight to those pages from anywhere in DHIS2. Requires @dhis2/cli-app-scripts v12.4.0 or later.

Android

For mobile use cases there are several options, depending on how much of the off-the-shelf DHIS2 Android experience you want to keep.

Apps

  • DHIS2 Android Capture app: The official Android Capture app is open source. Implementations sometimes fork it to add organisation-specific behavior. This is the heaviest option but starts from a complete, working app.

Libraries

  • Android SDK: A library that abstracts the complexity of interacting with the DHIS2 Web API on Android. It handles metadata and data synchronization, the local offline-first database, and the same program rule and indicator engines that the server uses, so apps work offline.
  • Mobile UI library: A design system based on Compose Multiplatform, so the same UI code can target Android and desktop with minimal changes while staying visually consistent with DHIS2.
  • Program rule engine: A standalone library that evaluates DHIS2 program rules. It is shared between the backend and the Android SDK, which means both server-side jobs and Android apps apply the same rule logic.

Integrations

Applications can integrate with DHIS2 either through its RESTful Web API or PostgreSQL database. The Web API is strongly recommended as it provides a stable, documented interface with better tooling support. See the Integration Overview for detailed guidance on integration approaches and technologies.

Documentation and Guides

  • Integration Overview: Provides an overview covering API vs database integration, the recommended integration stack (Java, Spring Boot, Apache Camel) and key components for building DHIS2 integrations.
  • The DHIS2 integration & interoperability web page highlights the different technologies that can help you integrate DHIS2 into your architecture. The page also provides non-technical practical advice when formulating your integration & interoperability strategy together with links to integration code examples.
  • Apache Camel: Introduction to Apache Camel as middleware for DHIS2 integrations. The documentation includes the fundamentals of routes, endpoints, processors and getting started with the Maven Camel DHIS2 Archetype.
  • Camel DHIS2 Component: Documentation for the official Camel component that leverages the DHIS2 Java SDK, covering endpoint configuration, HTTP query parameters and CRUD operations.
  • DHIS2 Java SDK: Lightweight Java library providing a fluent API and type-safe models for DHIS2 Web API interactions, including client creation, fetching resources, and error handling.
  • FHIR Integration Strategy: Overview of DHIS2's approach to HL7 FHIR interoperability, including how to map DHIS2 data models to FHIR profiles using transformation layers.
  • Standing up a FHIR Gateway: Blog post containing a step-by-step guide to creating an Implementation Guide-driven FHIR facade for DHIS2 using Apache Camel.

Reference Implementations

  • Reference DHIS2-MOSIP Integration: Demonstrates integration between DHIS2 and MOSIP for linking national digital ID systems with health data.
  • Reference Civil Registry Lookup: Capture App form field plugin that queries external civil registration systems to auto-fill demographic data and prevent duplicate records.
  • Reference Organisation Unit Synchronisation: Event-driven implementation using change data capture (PostgreSQL logical replication and Debezium) to sync organization units across multiple DHIS2 instances.
  • FHIR IG Generator App: DHIS2 web app that generates FHIR Implementation Guides from Tracker metadata, creating FHIR Logical Models, Questionnaires and ValueSets as documentation for FHIR-based integrations. The app is meant to help kickstart the FHIR Implementation Guide authoring process for DHIS2 metadata.

Tools and Examples

  • Integration Examples Repository: Collection of small, focused examples covering scenarios like exporting DHIS2 data as FHIR resources and syncing between DHIS2 instances.
  • Camel Archetype DHIS2: Maven archetype for quickly creating Apache Camel 4 applications with Spring Boot that use the DHIS2 component.