A generative AI application built on InterSystems IRIS for Health that enables natural language querying of patient clinical data.
The IRIS Clinical Assistant leverages vector embeddings and large language models to provide an intuitive way to query patient data stored in FHIR format. Using a Retrieval Augmented Generation (RAG) approach, the system enables natural language queries about patient conditions, medications, and procedures.
The solution follows a Retrieval Augmented Generation (RAG) architecture:
- Data Pipeline:
- Fetches FHIR resources (Conditions, Medications, Procedures)
 - Generates patient summaries
 - Creates vector embeddings using sentence-transformers
 
 - Storage Layer:
- Stores embeddings in IRIS database
 - Maintains connections between summaries and patient IDs
 
 - Query Processing:
- Converts natural language queries to embeddings
 - Performs hybrid search for relevant context
 - Generates responses using LLMs
 
 
- InterSystems IRIS for Health (Community Edition) - can be installed from docker directly with this application
 - Python 3.10 or higher
 - Hugging Face API token (for LLM access)
 - Note: The InterSystems IRIS DB-API package is required for Python applications to connect to IRIS databases. This package is not available on PyPI and must be downloaded from the InterSystems distribution repository. For convenience, the package was already downloaded and placed in the wheels folder for this application.
 
- Clone repository
 
git clone https://github.com/dianamindroc/iris-clinical-assistant.git
cd iris-clinical-assistant
- Create environment and install requirements
 
conda create --name intersystemscontest python=3.10
conda activate intersystemscontest
pip install -r requirements.txt 
- Start InterSystems IRIS for Health (you can use the provided docker-compose.yml)
 
docker-compose up -d
- The FHIR server needs to be installed inside the container:
 
docker exec -it <container_name> iris session iris
zn "<namespace>"
zpm "install fhir-server"
Now you can exit the container by entering HALT.
- 
Additionally, we need to make sure that Admin has SQL privileges. For this, go to dashboard, go to System Administration -> Security -> Users -> Go, click on Admin and Roles, Assign %All.
 - 
Install IRIS driver wheel (can be downloaded from IRIS website, it was already downloaded and placed in the wheels folder)
 
cd wheels
pip install intersystems_irispython-3.2.0-py3-none-any.whl
- In 
.env, make sure to update IRIS username, password, namespace and add a HuggingFace token for LLM inference. - Run app
 
cd ..
python -m app.app
- Access localhost:5000 and interact with the app