logo fhir
logo lafe

FHIR Experiments and Experiences

In this presentation series, we aim to organize our thoughts, challenges, integration strategies, and lessons learned from working with FHIR.

FHIR logo

Overview

We will cover:

  • Challenges
  • Experiments and tests conducted before, during, and after implementation
  • Final thoughts and conclusions from the entire process

FHIR Related Challenges

Different types of challenges when working with FHIR

  1. EHR structured data conversion
  2. EHR unstructured data conversion
  3. Data transformation validation

Structured Data Conversion

While not extremely challenging by itself, this process requires significant time for:

  • Database investigation
  • Code development
  • Codification system conversion
  • And so on.. (we talked about it before in other presentation)

Unstructured Data Conversion

This presents significant challenges due to numerous variables affecting data transformation:

  • Multiple file formats and document types
  • Varying text structures and information organization
  • Diverse expressions for the same concepts in plain text
  • Limited, different or partially codification at the same documents
  • And many more..

Data Conversion Validation

Due to the sensitive nature of clinical data, FHIR requires robust systems to ensure data integrity throughout the transformation process.

While feasible for small projects, validation becomes increasingly complex with larger system integrations.

Experiences and Experiments

List of conducted experiments

  1. HAPI FHIR Quick Server
  2. API Testing Framework
  3. IoT FHIR Experiment
  4. FHIR in Workflow Applications
  5. AI Synthetic Data Generation
  6. AI Clinical Assistant
  7. FHIR Conversion Using Local AI
  8. Fine-tuning AI with FHIR Data
  9. FHIR and AI agents

HAPI FHIR JPA Starter Server

This technology provides a quick deployment solution for local FHIR servers

Its advantage over other frameworks includes pre-configured FHIR resources and advanced search capabilities

API Testing Framework

A lightweight testing framework for custom FHIR APIs

Particularly useful for local FHIR servers with non-standard resources

IoT Devices with FHIR

Experiment using ESP32 microcontrollers with C++ libraries for IoT applications

FHIR in Workflow Applications

Integration possibilities with workflow tools like Node-RED, n8n, and Apache Airflow

We explored implementation approaches and potential applications

Synthetic Data Generation

AI-powered approach to create test data using prompt engineering

Valuable when real data is limited by availability or privacy constraints

AI Clinical Assistant

Google Notebook-based solution to address clinical queries about the project recommendations

AI-Powered FHIR Conversion API

Experimental API for FHIR data conversion using generative AI and LLMs

In the future, this kind of AI data conversion could be a good resource for unstructured data conversion

Gemma 2 Fine-Tuning

Easy way of fine-tuned Gemma2 model using unsloth, for more accurate FHIR data parsing (€10 cost)

Anticipate improved results as local LLM technology evolves

Chat with FHIR DATA

Easy and quick agent development using Google adk, mcp server and Hapi FHIR Server

Decoupled development of agents and tools as many experts tells is the future of AI.

Conclusions

Key takeaways from our FHIR implementation experience:

Development Best Practices

Recommendations
Start simple: Begin with a local FHIR server (HAPI FHIR) and tools like Hoppscotch/Postman to understand FHIR workflows
Wait for maturity: Avoid coding until the Implementation Guide (IG) reaches advanced stages
Libraries over prototypes: Prefer mature libraries (HAPI FHIR) over quick Python prototypes for production
Validation first: JSON schema validation saves more time than traditional testing libraries
FHIR Bundle resources: Transaction bundles provide better context than individual resources
FHIR Search wisely: Reserve advanced search for complex operations; keep queries simple

IoT & Workflow Integration Insights

IoT Workflow
C++ remains ideal for microcontroller compatibility between PIC, AVR (ATMega) and ESP32 Multiple options to choose node-red, n8n, Apache Airflow, etc.,
No mature open-source FHIR libraries for C++ Excellent for heterogeneous EHR systems and multi-database environments
FHIR works over mutliple protocols like Bluetooth/MQTT/Zigbee but the payload could be big, so use a lightweight fhir resource or a server as middleware Some has graphic programming, so it's accessible for developers of all skill levels
Not easy access or debugging Complex debugging

AI in FHIR: Tradeoffs

Advantages Challenges
Cost-efficient: Saves development/time costs for data conversion Hallucination risk: Requires validation tools for model outputs
Context-aware: Handles varied clinical expressions and text structures Limited models: Few quality in open source local models trained on medical data
JSON-friendly: Naturally aligns with FHIR's JSON structure Resource-intensive: High inference costs for typical hospital infrastructure
Affordable tuning: Open-source models can be fine-tuned cost-effectively Expertise gap: Requires specialized AI/ML knowledge

logo lafe

Members of the IT Team

    Marisa, Antonio, Vicente, Jose, Celia, Paco, Lucas