Introduction
Earlier this year, I set about creating kit to introduce young techy folk at a Health Tech hackathon to using InterSystems IRIS for health, particularly focusing on using FHIR and vector search.
I wanted to publish this to the developer community because the tutorials included in the kit make a great introduction to using FHIR and to building a basic RAG system in IRIS. Its an all inclusive set of tutorials to show in detail how to:
- Connect to IRIS with Python
- Use the InterSystems FHIR Server
- Convert FHIR data into relational data with the **FHIR-SQL builder**
- Use InterSystems **Vector Search**
- As a bonus using **Ollama** to prompt local AI models
This repo contains a full series of Jupyter Notebook tutorials for developing a medical history chatbot, as well as various other tutorials on using a FHIR server, so forgive me if this article is slightly light technical detail, but there's plenty of information in the linked Open Exchange Package!
Designing the Demo
The design brief I was given was to build a hackathon kit (which I defined as a fully-worked through, easy to follow demo app) that used FHIR data and AI.
The first question with this kind of project is where the data is coming from. I needed **FHIR Data** with some sort of **plain text** which could be vectorized for Vector Search. Here I had two problems:
1. Real Patient data isn't easy to come across.
- **Solution** - use synthetically generated patient data with Synthea
2. Plain text resources are generally clinical notes in Document Reference FHIR resources.
- **Solution** - Use GenAI to write my own clinical notes and load them into FHIR Resource bundles
Coming up with a source of plain text clinical data suitable for vectorization was my first major stumbling point, as I struggled to find anything worthwhile. The inspiration of using clinical notes to create a patient chatbot did not appear from nowhere. Instead, I saw a similar demonstration by @Simon Sha in the 2025 Demo Games. This was a great demo, so I wanted to create something similar to use for a fully guided tutorial!
Simplifying FHIR server set-up
The first step of the tutorial was running an instance of IRIS for Health with a FHIR server, ideally with data pre-loaded. For this, I decided to use an Open Exchange template. If you are lost at where to start on a project, the Open Exchange is often a great place to have a look!
I found two FHIR templates, [iris-fhir-template](https://openexchange.intersystems.com/package/iris-fhir-template) by @Evgeny, and [Dockerfhir](https://github.com/pjamiesointersystems/Dockerfhir) by @Patrick Jamieson. Both of these templates are excellent, and in my final version of the hackathon kit, I ended up using a combination of them. If I was starting over, I would recommend the [iris-fhir-template](https://openexchange.intersystems.com/package/iris-fhir-template) because this has a built in user interface and swagger-UI to test the FHIR endpoints. Trying to combine the two at a later date became a nightmare because the iris-fhir-template has the FHIR server endpoint hardcoded.
On the bright-side, the day I spent building and rebuilding docker containers made me much more confident on how a Dockerfile, module.xml and iris.script setup works. If you haven't already, I recommend breaking one of the many dev-templates available on the open exchange and learning how to rebuild or fix it. Its really useful to understand how these work when creating your own projects.
Vector Search
In my eyes, the remarkable thing about vector search is how easy it is to set-up and perform, particularly in IRIS. Sure, there's refinement that can be done later, like using a hybrid vector/keyword search or adding some sort of re-ranking system, but the basic steps of:
- Importing a model
- Creating Vectors from plain text
- Inserting vectors into a table in IRIS
- Converting a query to a vector
- Querying the database with the query vector
Can all be performed in ~50 lines of Python code.
This makes it a great place for newcomers to IRIS to start developing, which is why it was chosen for this hackathon kit.
Prompting with Ollama
I've always liked the idea of prompting local models, knowing that it will always be free, doesn't need any API key set-up, and doesn't involving sending your data elsewhere. This last point can be particularly important with medical records, when its important to keep data private, and restrict third-party access. In the past, I used models with Hugging Faces Transformer module, and the results were incredibly slow, and incredibly poor.
For this project I tried Ollama, which was a great improvement on Hugging Faces. Models that 'weigh' less than a Gigabyte, like gemma-1b give surprisingly coherent, and even accurate responses. The speed of response (at least on my computer) can be quite slow, particularly for large context windows, but if you are patient (or like taking constant tea-breaks while waiting for a model response), they perform quite well!
I enjoyed putting together the Ollama prompting section, even if at a real hackathon, all the competitors just did the sensible thing and used the OpenAI API...
Real-life use
We shared this tutorial with teams at the Hackjak Brno Healthcare hackathon in November 2025 and received good feedback. 11 (out of 25) teams used aspects of the kit in their final solutions,
The solutions built by hackathon teams were impressive and inspirational, with use cases ranging from using IRIS vector search in a RAG pipeline, to creating tools to fill out medical forms which connect directly to a FHIR server back-end. One of the teams (VIPIK) even uploaded their solution to [Open Exchange](https://openexchange.intersystems.com/package/VIPIK), which was really nice to see.
Conclusions
This demo was really fun to build and I'm really glad it proved useful at the hackathon in Czech Republic. I hope it will be used more in future, as its a nice entrypoint to using FHIR data with IRIS, Python and Vector Search!
Thanks for reading, and check out the full tutorial on Open Exchange!
Acknowledgements
Thanks to @Ruby Howard, @Thomas Dyar , @Daniel Kutac and @Ondřej Hoferek for working through the tutorial and providing feedback and @Simon Sha for the original inspiration with your entry to the Demo Games last year.
.png)
.png)
.png)
.png)
.png)
.png)