- π Dhanvantari rose out of the water with his four hands, holding a pot full of elixirs!
TL; DR: dhti-cli is for quick prototyping, developing, sharing and testing of Gen AI applications, models, and UI elements within the context of an electronic health record. Paper coming soon!
Gen AI can transform medicine. But it needs a framework for collaborative research and practice. DHTI is a reference architecture and an implementation for such a framework that integrates an EMR (OpenMRS), π Gen AI application server (LangServe), self-hosted LLMs for privacy (Ollama), tools on MCP server, vector store for RAG (redis), monitoring (LangFuse), π₯ FHIR repository with CQL support (HAPI) and graph utilities (Neo4j) in one docker-compose! DHTI is inspired by Bahmni and aims to facilitate GenAI adoption and research in areas with low resources. The MCP server hosts pluggable, agent-invokable tools (FHIR query, summarization, terminology lookup, custom analytics, etc.) that you can extend without modifying core services.
The essence of DHTI is modularity with an emphasis on configuration! It is non-opinionated on LLMs, hyperparameters and pretty much everything. DHTI supports installable Gen AI routines through LangChain templates (which we call π elixir) and installable UI elements through OpenMRS O3 React container (which we call π conch). π₯ FHIR is used for backend and CDS-Hooks for frontend communication, decoupling conches from OpenMRS, making them potentially usable with any health information system. We have a fork of the cds-hook sandbox for testing that uses the order-select hook, utilizing the contentString from the FHIR CommunicationRequest within the cds-hook context for user inputs (recommended).
π dhti-cli is a CLI tool for quick prototyping and testing of elixirs and conches. You can create a new docker-compose with required modules, start/stop services, install Elixirs and conch, create Docker images for them, and more. π This helps to test new ideas and share them with others quickly. π Once tested, you can transition them to the production team for deployment. Adoption of standards makes this transition easier!
βοΈ Pitched at Falling Walls Lab Illinois and released on 09/12/2025.
Why | How |
---|---|
I know LangChain, but I donβt know how to build a chain/agent based on data in our EHR. | This template adopts FHIR and cds-hooks as standards for data retrieval and display. The base class provides reusable artifacts |
I need a simple platform for experimenting. | This repository provides everything to start experimenting fast. The command-line tools help to virtualize and orchestrate your experiments using Docker |
I am a UI designer. I want to design helpful UI for real users. | See this template. It shows how to build interface components (conches) for OpenMRS an open-source EMR used by many. Read more about OpenMRS UI |
We use another EMR | Your EMR may support CDS-Hook for displaying components. In that case, you can use cds-hooks-sandbox for testing |
Our IT team is often unable to take my experiments to production. | Use DHTI, follow the recommended patterns, and you will make their lives easier. |
- Modular: Supports installable Gen AI routines and UI elements.
- Quick prototyping: CLI helps in quick prototyping and testing of Gen AI routines and UI elements.
- Easy to use: Can be installed in a few minutes.
- Developer friendly: Copy working files to running containers for testing.
- Dependency Injection: Dependency injection for models and hyperparameters for configuring elixirs.
- Generate synthetic data: DHTI supports generating synthetic data for testing.
- CQL support: CQL for clinical decision support.
- FHIR: Data exchange with FHIR schema.
- MCP: Built in MCP server for pluggable tools.
- EMR: Built in EMR, OpenMRS, for patient records.
- Vector store: Redis for vector store.
- Monitoring: LangFuse for monitoring.
- Graph utilities: Neo4j for graph utilities.
- LLM: Ollama for self-hosting LLM models.
Developers can build elixirs and conchs for DHTI.
π Elixirs are LangChain templates for backend GenAI functionality. By convention, Elixirs are prefixed with dhti-elixir- and all elixirs depend on dhti-elixir-base which provides some base classes and defines dependencies. You can use this template or the cookiecutter to build new elixirs, and license it the way you want (We β€οΈ open-source!).
π Conches are OpenMRS O3s and follow the standard naming convention openmrs-esm-. You can use this template to build new conches.
β
- Developer friendly: Copy working files to running containers for testing.
- Dependency Injection: Dependency injection for models and hyperparameters for configuring elixirs.
DHTI provides a platform to deploy language models and Gen AI applications in the context of an electronic health record.
DHTI serves as a platform for testing prompts, chains and agents in healthcare applications. Since the stack uses the π₯ FHIR data model, it is easy to load synthetic data.
Tools to fine-tune language models for the stack are on our roadmap. We encourage all language models built for this platform to be open sourced on HuggingFace with the names starting with dhti-.
β
- Generate synthetic data: DHTI supports generating synthetic data for testing.
- CQL support: CQL for clinical decision support.
- FHIR: Data exchange with FHIR schema and CDS-Hooks for frontend-backend communication.
- EMR: Built in EMR, OpenMRS, for patient records.
π Join us to make the Gen AI equitable and help doctors save lives!
- dhti-elixir-base: Base classes for dhti-elixir
- dhti-elixir-template: A template for creating new dhti-elixirs.
- fhir-mcp-server: A MCP server for hosting FHIR-compliant tools.
- dhti-elixir-fhire: An elixir for extracting embeddings from FHIR resources for Q&A on patient records.
- dhti-elixir-fhirs: An elixir for text to FHIR search query conversion.
- dhti-elixir-upload: Upload documents to the vector store for clinical knowledgebase and clinical trial matching.
- openmrs-esm-qa: A sample conch for Q&A on patient records using the dhti-elixir-fhire elixir.
-
You only need Node.js and Docker installed to run this project. Optionally, you can install Python if you want to develop new elixirs. We use a fake LLM script for testing purposes, so you don't need an OpenAI key to run this project. It just says "Paris" or "I don't know" to any prompt. You can replace it with any internal or external LLM service later.
-
npx dhti-cli help
to see all available commands. -
npx dhti-cli compose add -m openmrs -m langserve
to add OpenMRS and Langserve elixirs to your docker-compose.yml at ~/dhti. Other available modules:ollama, langfuse, cqlFhir, redis, neo4j and mcpFhir
. You can read the newly created docker-compose by:npx dhti-cli compose read
-
npx dhti-cli elixir install -g https://github.com/dermatologist/dhti-elixir-template.git -n dhti-elixir-template
to install a sample elixir from github. (Optionally) You may configure the hyperparameters in~/dhti/elixir/app/bootstrap.py
. You can install multiple elixirs. -
npx dhti-cli docker -n yourdockerhandle/genai-test:1.0 -t elixir
to build a docker image for the elixir. -
npx dhti-cli conch install -g https://github.com/dermatologist/openmrs-esm-dhti-template.git -n openmrs-esm-dhti-template
to install a simple OpenMRS ESM module (conch)from github. You can install multiple conches. -
npx dhti-cli docker -n yourdockerhandle/conch-test:1.0 -t conch
to build a docker image for the conches. -
npx dhti-cli docker -u
to start all the docker images in your docker-compose.yml.
- Go to
http://localhost/openmrs/spa/home
- Login with the following credentials:
- Username: admin
- Password: Admin123
You will see the new conch in the left margin. Click on Dhti app to see the UI. This is just a template, though. You can build your own conchs!
Add some text to the text area and click on Submit. You will see the text above the textbox.
npx dhti-cli docker -d
to stop and delete all the docker containers.
Read more in notes/steps.md. Complete documentation is in progress.
The demo uses a template with mock LLM. Check out how to add real LLM support using Google Gemini.
π€ Thank you for trying out DHTI!
If you find this project useful, give us a star. It helps others discover the project.