Showing posts with label HL7. Show all posts
Showing posts with label HL7. Show all posts

Thursday, April 23, 2026

FHIR Up the Healthcare Transformation - Interoperability, Data Liquidity, and the Agentic Future

 

A Letter to the Healthcare IT Community

This week, Tim Cook published his farewell letter as Apple CEO. In it, he reflected on how Apple's products had touched lives in ways that defied description — a mother saved by her Apple Watch, a photograph captured at the summit of a mountain that seemed impossible to climb. He spoke of shared humanity, and of the privilege of leading a company that ignites imaginations and enriches lives.

Reading Tim's letter, I found myself thinking not about consumer electronics, but about healthcare. Because the same transformation that Apple brought to how we interact with technology is now quietly, powerfully, underway in how healthcare systems interact with each other — and soon, with intelligent agents that can reason over clinical data in real time.

That transformation has a name: HL7 FHIR.

And after 20 years of working with healthcare interoperability standards — from the early days of HL7v2, HL7 CDA to HL7 FHIR, designing and building Healthier SG FHIR API and Data Grid serving Singapore's Healthier SG transformation — I believe we are at an inflection point. FHIR is no longer just a better way to exchange messages between hospital systems. It is becoming the foundational layer upon which the next generation of healthcare will be built: a generation defined by data liquidity, AI-native clinical workflows, and a new universal protocol layer that connects human clinicians and AI agents to the same trusted data.

Let me explain why.


Part 1: The Interoperability Problem Is Not Technical — It's Business

For decades, healthcare IT has been trapped in a paradox. We have more clinical data than ever, yet it remains locked inside hundreds of proprietary systems, each speaking its own dialect. Every time two systems need to talk, someone builds a bespoke integration — custom mappings, custom APIs, custom testing. Each such integration will not only introduce huge amount of integration effort, it also leads to potential issue of semantic data drift. 

This is not a technology problem. It is an business problem - Data is the most important asset of any healthcare organisation.  It is broken because there has never been a universal agreement on what a patient record looks like, how you ask for one, or where the boundaries of a clinical concept begin and end.

All the business process and rules are all built upon data to record the state change, enforce data integrity and maintain data quality. If we do not put focus and attention on data, then we are just simply pursuing the project as ticking the box as project completed.

HL7 FHIR fixes this. Not partially, not theoretically — practically.

FHIR defines a common data model for clinical resources: Patient, Observation, MedicationRequest, Encounter, CarePlan, Condition, Procedure — each with a standardised structure, a RESTful API contract, and a well-defined set of search parameters. When two systems speak FHIR, they are not just exchanging data — they are sharing a common understanding of what that data means.

This is what I mean by interoperability. Not the ability to move bytes from point A to point B. The ability to move meaning.


Part 2: Data Liquidity — From Locked Vaults to Flowing Rivers

Once you standardise the data model, something remarkable happens: data becomes liquid.

In the old world, clinical data sits in application databases — structured for the application that created it, accessible only through the application's own interface. Extracting it for analytics, research, or even basic care coordination requires custom ETL pipelines, data warehouses, and reconciliation logic that is expensive to build and brittle to maintain.

In the FHIR world, every clinical record is a resource with a URL. It can be created, read, updated, searched, and subscribed to through a universal API. A patient's medication history is not buried in a vendor-specific schema — it is a collection of MedicationRequest resources that any authorised system can query using standard search parameters. A lab result is an Observation with a LOINC code. A diagnosis is a Condition with a SNOMED CT code.

This is data liquidity: the ability for clinical information to flow freely, safely, and meaningfully across organisational boundaries without losing its clinical fidelity.

I have seen this firsthand. When we implemented the Healthier SG FHIR API Platform at Synapxe, we enabled the same FHIR data flow seamlessly between different systems - from upper stream end-user facing systems, and store in central national data repositories, and seamlessly flow to other national systems for reporting and analytics. What changed was the accessibility of the data, because FHIR provided a common language that every application could understand and exchange easily.

And this is just the beginning. I recently used Claude Code to generate millions of FHIR resources — patients, encounters, observations, medication requests, and care plans, complete with SNOMED CT, LOINC, and RxNorm coding , and all these data are interlinked through FHIR's resource reference — it took less than a minute of prompting to create script which can generate any number of records as you requested. Previously, this kind of test data preparation would take days or weeks of manual work by the engineer and also requiring the engineer have good knowledge on SNOMED CT, LOINC and RxNorm.  FHIR's structured, standardised nature makes it inherently machine-friendly — not just for data exchange, but for data prearation, validation, and reasoning


Part 3: The Agentic Era — Why FHIR Is the Foundation for AI in Healthcare

Now we arrive at what I believe is the most consequential development in healthcare IT since FHIR itself: the convergence of FHIR and agentic AI through the Model Context Protocol (MCP).

Let me unpack this.

What Is MCP?

The Model Context Protocol, originally developed by Anthropic and now adopted as an open standard with support from Google, Microsoft, OpenAI, and others, defines how AI agents discover and interact with external tools and data sources. Think of MCP as a universal adapter: it tells an AI agent what tools are available, what each tool can do, and how to invoke it — all through a standardised interface.

In the words of one industry expert, MCP is like "FHIR for AI" — just as FHIR standardised how healthcare systems exchange data, MCP standardises how AI interacts with those systems.

Why FHIR + MCP Is a Game Changer

Here is the key insight: FHIR's resources are inherently self-describing. A FHIR server's CapabilityStatement tells you exactly which resources it supports, which operations are available, and which search parameters are valid. A FHIR StructureDefinition tells you the exact shape of every resource — its fields, data types, cardinality, and validation rules. A FHIR OperationDefinition tells you the input and output parameters of every extended operation.

This means an AI agent, connected to a FHIR server through MCP, can discover the server's capabilities at runtime. It does not need hardcoded knowledge of the API. It does not need custom integration code. It reads the CapabilityStatement, understands what is available, and begins reasoning over the data.

This is exactly what I have built in my open-source project, fhir4java-agents. The server exposes its FHIR resources and operations as MCP tools — just three MCP tools are sufficient for an AI agent to perform full CRUD operations, execute FHIR searches, and invoke extended operations across any supported resource type. The agent does not need separate tools for Patient, Observation, or CarePlan. It discovers the resource types dynamically and interacts with them through a unified interface.

The implications are profound:

For clinicians: Imagine a physician asking an AI assistant, in natural language, to pull up a patient's recent lab results, cross-reference them with current medications, and flag potential drug interactions — all sourced directly from the FHIR server, with full provenance and audit trail. No custom dashboard development. No data extraction pipeline. The agent reads FHIR resources, reasons over them, and presents findings in context.

For care coordination: An AI agent could monitor incoming FHIR Subscription notifications — new lab results, changed medication orders, updated care plans — and proactively alert the care team when clinical thresholds are breached or when care plan goals are at risk.

For population health: Multiple AI agents, each connected to different FHIR endpoints across different institutions, could collaboratively analyse anonymised population data to identify emerging health trends, evaluate intervention effectiveness, or optimise resource allocation — all while respecting data sovereignty because the agents query the data where it lives rather than centralising it.


The Architecture: A Universal MCP Layer

The architecture I envision — and have been building toward — looks like this:

At the base layer, you have FHIR-compliant data platforms storing clinical resources in standardised formats. These platforms support profile-based validation, terminology binding (SNOMED CT, LOINC, RxNorm), and configuration-driven resource management.

Above that sits the MCP layer — a set of MCP servers that expose FHIR capabilities as discoverable tools. Each MCP server can run as a native plugin within the FHIR server (for performance-critical operations) or as an external service in any language — Python, Node.js, Go — communicating over JSON-RPC or HTTP+SSE transport. This hybrid plugin architecture means the system is extensible without being fragile. A new clinical decision support algorithm can be deployed as an MCP plugin without restarting the FHIR server. A machine learning model for sepsis prediction can be wrapped as an MCP tool and made instantly discoverable by any connected agent.

At the top layer, AI agents connect to the MCP layer and dynamically discover available capabilities. These agents can be general-purpose clinical assistants or specialised agents focused on specific workflows — medication reconciliation, discharge planning, surgical scheduling. Because MCP provides a standardised discovery mechanism, agents can be composed and orchestrated without tight coupling.

This is not science fiction. This architecture is running today. I demonstrated it in my recent blog post and video (see the demo to illustrate how AI agent is interacting with the data), showing how an AI agent connected to fhir4java-agents through MCP can create patients, query observations, and manage care plans — all through natural language interaction, with the MCP layer handling tool discovery and FHIR server handling data integrity.


The User Interaction Shift: Transition from fixed menu driven interaction towards natural fluid AI driven interaction

For Healthcare IT vendor/solution: The future of Healthcare IT system will slowly transition towards headless EHR product where the primary focus is to manage the backend data platform to achieve the flexible data model for future readiness, and enforce strong data validation and business control  to ensure data integrity and quality, and robust AI enabled APIs through universal MCP layer with strong control on security and audit trail to guard the safe and appropriate use of data, whereas the user interfaces can leverage on the robust capabilities of AI agent which can create any UI on the fly, and any user can save his/her personalised skills to launch pre-configured and preferred user interface. 

There will be some healthcare specific AI agents available in the market with the ability to interact with any backend systems. These healthcare specific AI agents will provide out of box integration with SmartOnFHIR to perform authentication and authorisation.


Part 4: What This Means for Singapore and Beyond

Singapore is uniquely positioned to lead this transformation. We have practical HL7 FHIR implementation experience, we have designed and implemented more than 10 native HL7 FHIR based systems for production usage. Our Healthier SG implementation received inaugural HL7 FHIR DevDays in 2024, see the Synapxe news here.  We have a passionate team promoting HL7 FHIR within Synapxe and MOH, We have a centralised healthcare IT infrastructure through Synapxe that manages the public healthcare IT estate. And we have a forward-looking AI governance framework through IMDA's Model AI Governance Framework that can guide the responsible deployment of agentic AI in clinical settings.


The pieces are in place. What is needed now is the conviction to connect them.

FHIR is not just a technical standard. It is an instrument for business transformation as outlined below

  1. It is a framework for project delivery transformation - from ticking the box as "project completed" to "data transformation is done"
  2. It is a means for cost discipline — turning what would otherwise be millions in fragmented, one-off integration spend into a governed, reusable, and scalable capability. 
  3. It is a platform for data liquidity — making clinical information accessible wherever it is needed, in real time, without sacrificing governance or security
  4. It is a platform for the agentic future — providing the self-describing, machine-readable data layer that AI agents need to operate safely and effectively in clinical environments.


A Personal Reflection

I started my journey with HL7 standards in 2006 when I started to join a healthcare startup company working on EHR/PHR. I have since been involved with HL7, IHE, ISO TC215, and HITC — drafting and reviewing healthcare interoperability standards for the company I worked for and for Singapore. 

Through all of this, one conviction has remained constant: standards matter. Not because they are fashion, but because they enable innovation, and unlock value. When everyone agrees on how a Patient resource looks, engineers stop spending months on data mapping and start spending days on clinical value. When AI agents can discover capabilities through a standard protocol, developers stop building custom integrations and start building intelligent workflows.

Tim Cook wrote that Apple's products fit into real lives — that technology should serve humanity, not the other way around. I believe the same is true for healthcare IT. FHIR, MCP, and agentic AI are not ends in themselves. They are means to an end that matters deeply: better care for real patients, delivered by empowered clinicians, supported by intelligent systems that earn and deserve our trust.

The future of healthcare interoperability is not about connecting systems. It is about connecting knowledge. And that future is here.

Sunday, January 5, 2025

HL7 FHIR APIs can fundamentally transform the rapid development of frontend web application

 Just imagine if all your backend APIs is based on HL7 FHIR API, how it will fundamentally transform your frontend web application development

One immediate benefit is that your frontend developer will not be pressing you to come up the running APIs, because he/she can just pick any publicly available HL7 FHIR Server to test and integrate. 

Another greater benefit is that we can fundamentally re-design the web application to take full advantage of the consistent APIs that are based on HL7 FHIR. 

Let me walk through the 2nd benefits here

I am going to walk through a simple ReactJS Single Page Application (SPA) I have created in the past, the actual source code is hosted on code sandbox - https://muqhwj.csb.app/patients. This demo SPA is integrated with the live APIs hosted in HealthX Sandbox - https://api.healthx.sg/.../2807f247634c4f3c941568d460835a71. (Note the last part of the URL is the tenant ID)

For the demo ReactJS SPA, pls take note that the intent of the demo app is NOT to demonstrate the coding best practice for ReactJS SPA, eg I did not use TypeScript in the demo yet, the configuration is not maintained in external configuration settings etc. I only spent 1 or 2 days to put up the demoReactJS SPA.

The demo application shows whatever health records available in the backend system with a simple UI design - summary view and detail view. There is only one API component and oneUI component regardless of how many resources you like to show on the UI
  1. All the backend API integration is coded in this API slice - https://codesandbox.io/p/sandbox/muqhwj...
    1. I use the method - getResourcesEntries for getting ALL kinds of resources (other than Patient record) and also do transformation from backend process API to experience API for the Summary View (I moved the included patient resources into respective patient data resource eg Condition under the element "_includedPatient", so that it is easier for UI to render the data). 
    2. The second method is getResourceDetail which is to get the detail payload of the specific record for any given type of resource for the Detail View
  2. The UI layout is implemented in these two files
If you want to try out yourself, you can fork to a new project, and then try to modify these two files to add additional record type to be shown in UI, or update the data elements to be shown for each record type

  1. Add new record type and corresponding menu item name in this file - https://codesandbox.io/p/sandbox/muqhwj...
  2. Add/update data elements to be shown for the corresponding record type - update function resourceSummaryElements in this file - https://codesandbox.io/p/sandbox/muqhwj...

Tuesday, July 2, 2024

HL7 FHIR DevDays 2024 - Sharing of Singapore's Healthier SG implementation

 Below is the some of the slides from the recent sharing at FHIR DevDays 2024 (https://www.devdays.com/) on Singapore's National Healthier SG implementation.









I am also glad that the implementation got the inaugural FHIR implementers award, below is the finalist pitch I shared during DevDays







For more details, please go to the following Firely site on the highlights of FHIR DevDays 2024



Friday, August 11, 2023

How to model Patient flowsheet in HL7 FHIR

1. Overview

Recently I am working on the HL7 FHIR information model to represent patient flowsheet for the purpose of integration with one EMR vendor product, the EMR vendor also does not have information and model to represent patient flowsheet, though the reading is represented using Observation resource.

I searched FHIR chat group, there is also no specific implementation guideline on patient flowsheet, thus I have proposed the following design, I welcome comment and discussion on this topic.

1) Use PlanDefinition resource to represent the flowsheet

2) Use CarePlan resource to represent the association of the selected flowsheet to the patient

3) For the Observation resource, use "basedOn" attribute to specify the specific patient flowsheet for the reading submission


Below diagram illustrates the model and relationship between the three resources




2. CarePlan resource

CarePlan resource to represent the specific flowsheet selected for the patient, the "category" attribute will be used to specify this care plan is patient flowsheet.



3. PlanDefinition resource for the flowsheet which can be selected and assigned to the patient





4. Observation resource for the patient flowsheet reading, use "basedOn" to associate wth the patient flowsheet



5. Revised Design after consultation within FHIR community

After discussion within FHIR community, the consensus is that we should use Questionnaire to represent the Flowsheet template.

Below please find the overview of the revised model (Click on the image to Zoom In)




Thursday, May 18, 2023

Leverage HL7 FHIR Operation to achieve the purpose of "Small Functional APIs"

Overview

During the course of design and implementation for API for modern API driven development, various engineers have been asking the gradually of API, how much responsibility each API shall have, and how to balance the initial implementation and ongoing maintenance of the APIs from both API provider and API consumer perspectives. In this post, I will be sharing my recommendations from my personal professional perspective, do let me know your view.

Technology has been evolving, eg from SOAP to RESTful, from monolithic application design to SOA and now MSA, however the underlying design principles remains unchanged, and we can still go back to the decades old design principles to guide modern application design, and API design specifically in this post.

One of the design principles I would like to reference here is the following para from "Basics of the Unix Philosophy"

"Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features."

As this quote conveys, the Unix culture centers around small and simple tools that can be combined. This advice still rings true even after more than 45 years later when we deal with API design and development. To adapt this principle to API design, we may say,  "Make each API do one thing well".

Benefits of making small functional APIs

So what's the benefits of adopting this API design principle, there are three benefits according to this books - Building Secure and Reliable Systems

  1. Design for Understandability. 
  2. Design for Least Privilege 
  3. Design for Resilience 


Design for Understandability

It is much easier for API consumer to understand the API as it is small functional API, it has very specific functional responsibility, it has very specific input parameters and expected response. It is also easier to API provider to rollout new API faster and safer since it does not involve the changing of existing gigantic API

Design for Least Privilege

Each API can be enforced specifically to allow certain API consumers to call, this can be easily enforced at the typical API Gateway products. In contrast to very coarse grained API, this can not done, as API gateway will not be able to go into the API payload to check whether a certain API consumer is allowed to call or not, also if the API gateway starting to go down to this level of detail, then it also embeds the business specific logics, it will complicate the API gateway management and maintenance

Design for Resilience

Wth each API only serve for specific functional responsibility, we can also control the blast radius. When things go wrong, only the specific APIs are affected, thus only specific functional areas are affected.


How to design small functional APIs


However "great power comes with great responsibility", to reap the benefits, we need to take extra care to have good design in place, to ensure the API design is consistent and scalable across many different small functional APIs.

Luckily we do not need to start from scratch, HL7 FHIR also defined capability for standardised, consistent and scalable way of designing small functional APIs, this is the Extended Operations on RESTful APIs.


I will cover the use of HL7 FHIR Operations capability in next post, stay tuned!

Tuesday, April 8, 2014

HL7 FHIR Partial Update

Below I summarized what I have tried so far for handling partial update in HL7 FHIR.

1) Syntax

URL: http://[server]/[resource]/[logical id]/_delta
method: POST

I did not use PATCH method since some of older browser does not support this method, also not sure whether PATCH method has been supported in all javascript library

2) Extension element to specify update mode

For each element to be added/replaced/deleted, added the following extension

       <extension url="http://hl7.org/fhir/Profile/iso-21090#updateMode" >
            <valueCode value="A or R or D" />
        </extension>

As an example, below is the XML snippet for updating birthDate

 <birthDate value="1970-03-13">
      <extension url="http://hl7.org/fhir/Profile/iso-21090#updateMode" >
            <valueCode value="R" />
        </extension
>

  </birthDate>


3) Handling collection

For collection data elements such as name, address and contact in Patient resource, server needs to know which element within the collection is to be replaced/deleted. So I decided to pull collection element's internal id as part of the query response, and then use the same id when submitting the payload to server

- Added collection element internal id in query response as part of element extension

    <telecom>
        <extension url="http://hl7.org/fhir/metadata#id">
            <valueString value="1308"/>
        </extension>

        <system value="phone"/>
        <value value="68181256"/>
        <use value="home"/>
    </telecom>

- Payload for partial update
      <telecom>
            <extension url="http://hl7.org/fhir/metadata#id">
                <valueString value="1308"/>
            </extension>

            <extension url="http://hl7.org/fhir/Profile/iso-21090#updateMode" >
                <valueCode value="R" />
             </extension>

           <system value="phone"/>
           <value value="68181256"/>
           <use value="office"/>
    </telecom>


4) Suggestion

The above approach works okay so far, however I'd like to make one suggestion here. As we can see from the above XML snippet, the content is very verbose after adding extension elements.Can we add the two attributes (id and updateMode) in FHIR resource as part of Element built-in attributes? In this way, the content will be very compact as the following snippet shows,

     <telecom  id="1308" updateMode="R">             
           <system value="phone"/>
           <value value="68181256"/>
           <use value="office"/>
    </telecom>


Tuesday, November 12, 2013

Open source implementation of HL7 FHIR persistence

After I presented the journey from HL7v2 to HL7 FHIR during HIMSS DHW 2013 few weeks ago, the slide is here Use of FHIR in next generation healthcare product for reference, I started to think about how easy it is to implement native FHIR based RDMBS storage, so that the FHIR resource can be natively stored in RDMBS and users are also able to directly query the data using SQL. There are some existing open source implementation, but as far as I can tell those implementations are using document based storage such as MongoDB, data reuse and extraction for reporting and other usage might be problem.

It is not as straightforward as I have initially thought, I need to explore different ways of persisting FHIR resource into RDMBS such as

1) Whether it is possible to just generate O/R mapping without changing the existing FHIR resource java classes. For this issue, the initial assessment is not 100 percent possible, I intend to compile a list and feed back to Grahame for consideration.
2) Whether to store patient name as JPA embeddable or entity
3) How to handle nested collection, such as List<CodeableConcept> since CodeableConcept object itself contains list of Coding object. or List<HumanName> where each attribute such as 'family' attribute is again a collection of String object
4) With nested collection, is it possible to query such attributes at API level. For example I already encountered some problems when I tried to query collection attributes within embedded table as even the latest JPA 2.1 spec does not support such implementation yet, as a result I have to go back to change the O/R mapping approach



Though it is still in early stage of exploring and trying out, I think it might be useful experience to share with other like-minded developers who might be keen to explore the same to create FHIR based persistence similar to HL7 RIMBAA concept, so I decided to make it as open source project, the project is hosted at sourceforge http://sourceforge.net/projects/hl7-fhir/

The scope of the project is illustrated below,  the reference implementation uses eclipselink 2.5 which is based on the latest JPA 2.1 spec,  database tier is using hsqldb as reference.




Once I have finalized the O/R mapping approach, the next step is to come up a XSLT to auto generate all the JPA O/R mapping based on FHIR XSD

So do stay tuned, and let me know if you have any feedback or have the intention to contribute to this project!

FHIR Up the Healthcare Transformation - Interoperability, Data Liquidity, and the Agentic Future

  A Letter to the Healthcare IT Community This week, Tim Cook published his farewell letter as Apple CEO. In it, he reflected on how Apple...