EXPLAINER · FHIR
Moving patient data from CDA documents to FHIR
What happens when document-based patient data becomes structured FHIR resources, and why a person must review every mapping.
Noel Del Castillo
CEO, SeeYouDoc Oy
PUBLISHED · 6 MIN READ
In short: Finnish patient record systems already produce HL7 CDA R2 documents, because that is what they send to the national archive. Those documents are a ready source for FHIR. Moving the data across is mostly careful mapping, and the part that needs the most care is the part a machine cannot check on its own.
Every Finnish record system already writes documents
When a professional writes to a Finnish patient record system, the record does not stay there alone. A copy goes to Kanta, the national archive of patient data, as a document: a continuity of care record, a prescription, a referral, a discharge summary.
The format of those documents is HL7 CDA R2, the Clinical Document Architecture. Kanta publishes the specifications for system developers, and every record system in Finland follows them.
That is good news for anyone who needs the data somewhere else. The documents already exist. A care provider already knows how to produce them. Reading them needs no new work from the record system’s vendor.
What a CDA document is
A CDA document is one XML file that describes one clinical event or summary. It is built like a letter:
- A header: who the patient is, who wrote the document, in which organisation, when, and what kind of document it is. In Finland every Kanta document carries the same national header.
- Narrative text: the part a person reads, organised in sections such as diagnoses, medication and the visit note.
- Coded entries (optional): the same facts as structured data, with codes. For example a diagnosis with its ICD-10 code, or a medicine with its ATC code.
A document is whole and fixed. Once it is signed, it does not change; a correction is a new document that replaces the old one. That makes CDA very good for its job: a legal, readable, archived record of what was written.
Why FHIR is different
FHIR describes care as small, separate resources: a Patient, an Encounter, a Condition, a MedicationStatement, an Observation. (Our article “FHIR R4 in a nutshell” explains them.)
The difference matters in practice:
- A CDA document answers “what was written at this visit?”
- FHIR resources answer “what medicines does this person take now, across all visits and all sources?”
The second question is the one a nurse asks before a home visit, and the one an app or a partner needs answered through an API. To answer it, the facts must come out of the documents and become resources of their own.
How the mapping works
Moving data from CDA to FHIR follows the shape of the document:
- The header becomes the context. The patient becomes a Patient, the author a Practitioner, the organisation an Organization, and the visit an Encounter. Because the Finnish header is the same in every document, this part is predictable.
- Coded entries become resources. A coded diagnosis becomes a Condition, a medication entry a MedicationStatement, a lab result an Observation. The codes carry over: ICD-10 for diagnoses, ATC for medicines, the national code lists for procedures.
- The document itself stays linked. A DocumentReference points to the original. Every resource made from it keeps that link, so anyone can see where a fact came from.
- Narrative text stays text. Where the document holds only free text, the text is not turned into codes by guesswork.
Work on this transition is happening at European level too: the Xt-EHR Joint Action, which prepares the specifications for the European Health Data Space, has studied how countries can move from CDA documents to FHIR.
The hard parts
The simple cases are simple. These are the parts that take time:
- The same fact in many documents. A long-term medicine appears in every continuity of care record for years. The mapping must recognise one medicine, not create a hundred.
- Corrections. A replacing document cancels facts in the old one. The resources must follow, or an ended medicine looks active.
- Text without codes. Older documents, and some sections of new ones, have narrative only. That information is real, but it is not structured.
- Local and national code lists. Not every Finnish code has an international counterpart, so the mapping must keep the original code and add others only when they truly match.
- Dates. The date a document was written, the date of the visit and the date a medicine started are different dates. Mixing them up changes the meaning.
Why a person reviews every mapping
AI is useful here. It can read a document type’s structure and draft a mapping in minutes instead of days. In Saumo, AI drafts the mapping and suggests which resources a table or a section should become.
But a mapping decides what a professional will later read as fact. A wrong date path or a missed correction does not raise an error; it quietly shows the wrong thing. So a person reviews and approves every mapping before it goes live, and we test it on a dry run before any real import.
For narrative text, the same rule holds. When our AI readers find something in a note, they show the exact sentence it came from, and a second reader must agree. Nothing is presented as a fact without its source.
How Saumo handles CDA
Saumo is a read-only data layer beside the systems a provider already has. It can read the CDA documents a record system already produces, map them to FHIR, and share the result through one standard API, with every read logged. It never writes back to the record system or to the national archive.
Saumo is FHIR R4 native, aligned to the HL7 Europe Base and Core profiles STU 2.0, tracking the balloted European Patient Summary guide.
Key takeaways
- Finnish record systems already produce HL7 CDA R2 documents for the national archive. They are a ready source.
- CDA is a whole, signed document. FHIR is a set of small resources. Moving between them is mapping, not conversion at the push of a button.
- The header maps predictably, coded entries become resources, and the original document stays linked as the source.
- The hard parts are duplicates, corrections, free text, code lists and dates.
- AI can draft the mapping. A person approves it, because a wrong mapping does not fail loudly.
The documents are already there. The work is to read them carefully.
How ready is your organisation? Take the 5-minute EHDS readiness check, and book a 30-minute review if you want to talk it through.