CLAVIEN-DINDO · COMPLICATION SEVERITYIIIIIIIVVPROPOSED GRADE

I led the foundational phase of a Sitra-funded pilot at Varha, brought in because my thesis work had already put LLM pipelines inside their secure environment and nobody else had. Surgeons there already graded complications by the international Clavien-Dindo scale, but recorded the grade as free text, so it couldn't be analysed, compared, or linked back to the patient. I led the early planning, shaped the technical approach with the surgeons, and built the initial pipeline: it assembles a patient's post-operative history and proposes the Clavien-Dindo grade, with a short justification, for the surgeon to confirm, without the records leaving the hospital's secure environment. I handed the work on at the end of 2025; the pilot runs until summer 2026, so the measured results aren't mine to claim.

02

Context & Stakes

Some surgical complications can't be prevented, only learned from. But here the data that learning needs lived as free text nobody could analyse.

A large share of patient harm involves surgery, and some of those complications are preventable. To prevent the next one you have to be able to see patterns, which means the data has to be structured and comparable. The Clavien-Dindo classification is the international standard for grading how severe a surgical complication is, from grade I (a minor deviation) up to grade V (death), but Finland doesn't apply it systematically or structurally. In this county's gastrointestinal surgery, surgeons did grade complications with Clavien-Dindo, but they recorded the grade as free text inside the patient notes.

Free text is almost useless for learning. You can't aggregate it or trend it, and because the complication data in the county's data lake came without patient identifiers, you couldn't follow a graded complication back to the patient or the operation it came from. The management and patient-safety value was locked behind a missing structure. The pilot, run by Varha with the Finnish Centre for Client and Patient Safety and funded by Sitra, set out to unlock it, testing AI as support for the clinician doing the recording.

03

Role & Approach

I worked on this pilot embedded with Varha's surgical and IT teams. I was brought in because I'd already built LLM pipelines on real patient data inside their environment, and nobody else had. My job was to set the foundations.

I was responsible for the initial planning, including the funding application for the Sitra grant the pilot ran on. I planned the technical approach with the surgeons: what data a complication grade depends on, and how a model could propose one without adding work to a surgeon's day. Then I built the initial pipeline that does it. Around me, Varha was the lead implementer for the clinical content and the system connections, the Finnish Centre was the expert partner and the route to national scale, and an IT vendor handled the structured-recording side.

It was a design, code and AI role more than a service-design one: the same person led the planning, defined the clinical data, and built the pipeline.

04

What I Found

The information needed to grade a complication already exists in the records. It's scattered across many systems and written as prose, so it's neither analysable nor linkable. What's missing is structure and consistency, not data.

So with the surgeons I defined the inputs a grade depends on: the patient notes, medication, endoscopies, re-operations, anaesthesias, dialyses, imaging, stoma procedures, lab results, and the fact and timing of death. The pipeline assembles those into a single 90-day post-operative timeline per patient.

ASSISTED CLAVIEN-DINDO GRADINGPost-op datanotes, meds, imaging,labs, re-operations90-day timelineassembled per patientLocal modelgpt-oss, on-premProposed grade+ short justificationSurgeonconfirmsor overridesRuns inside the hospital’s secure environment, validated against the grade the clinician recorded.
How it works. The pipeline pulls the data a grade depends on, assembles a 90-day post-operative timeline for the patient, and prompts a locally hosted model for the Clavien-Dindo grade plus a one-to-two sentence justification. The surgeon confirms or overrides; the result is validated against the grade the clinician had already recorded.

The timeline's anchor needed care. The obvious choice is the operation plus 90 days, but clinicians sometimes record the grade before that window has closed, so that timeline can hold evidence they never saw. The pipeline therefore also assembles a second timeline anchored on the moment the clinician recorded the grade, so the model reasons from the same evidence the clinician had. The grade the surgeon had already written becomes the ground truth I validate against.

05

Problem Definition

Whether a model can guess the grade was the smaller question. The bigger one was complication data that nobody could analyse, compare or link to a patient, and how to make it structured and reusable without adding a minute to a surgeon's day.

That framing changes the design. The moment recording feels like extra, disconnected admin, it stops happening, however good the model is. So the model couldn't be a separate tool that produces a verdict; it had to be a suggestion that slots into the existing flow, proposing a grade the surgeon confirms or corrects in a moment. And because the aim is learning across the country, it had to scale by design, built on a shared data model and standard classifications, not a one-county workaround.

06

Key Decisions

The model proposes; the clinician decides

Discarded: an autonomous classifier that writes the grade into the record on its own, which a clinic would have little reason to trust.

Chosen: the model proposes the most likely Clavien-Dindo grade with a short justification, and the surgeon confirms or overrides it.

Tradeoff: the human step stays, and so does clinical accountability. A suggestion is something a busy surgeon can accept, and each accept or override gives a signal (an acceptance rate) to measure later.

Open models, run inside the hospital walls

Discarded: a commercial cloud API, by far the easiest thing to call.

Chosen: open-weight models (gpt-oss-20b and gpt-oss-120b) running inside the county's own secure data-services environment, because real patient records can't leave it.

Tradeoff: considerably more to stand up and operate than an API key, and that one choice set the shape of the rest of the build.

Validate against the grade clinicians already assigned

Discarded: scoring the model against a clean synthetic benchmark.

Chosen: compare the model's grade to the Clavien-Dindo grade the surgeons had recorded by hand, on real gastrointestinal-surgery data.

Tradeoff: that ground truth is only as consistent as the free-text recording it came from, the same weakness the project exists to fix. I treated it as a known limit, not a clean accuracy number.

07

Solution & Deliverables

What I built and tested was the pipeline above: pull the defined data for a patient, assemble the two 90-day post-operative timelines, prompt the locally hosted models for the Clavien-Dindo grade and a one-to-two sentence justification, and compare the answer to the clinician's recorded grade.

Around it, the pilot aimed to produce an operating model for structured Clavien-Dindo recording that could live inside the patient-information system; the AI solution proposing the grade as recording support; a management dashboard aggregating the structured complication data for leadership and root-cause work; and an effectiveness evaluation. With the grade captured as data, serious complications (grades III to V) could for the first time be linked with patient identifiers and followed back to a pathway, instead of sitting as anonymous free text. It was designed from the start to scale, with the Finnish Centre as the route to other counties and other adverse-event types.

08

Outcomes

I set the foundations the pilot ran on

I owned the early planning, including the application for the Sitra grant, then built the technical foundations: the data the model depends on, the approach for proposing a grade, and the initial working pipeline. The pilot started from that groundwork.

A working pipeline on real data

I tested the pipeline on real gastrointestinal-surgery records, checking its proposed grades against the ones surgeons had recorded. It showed the approach was feasible, carrying my earlier thesis work forward onto a live clinical problem.

Still running, so the numbers aren't mine to claim

I handed the work on at the end of 2025, and the pilot runs until summer 2026 without me. So there's no measured accuracy or adoption figure for me to put here. What's mine is the planning, the foundations, and a pipeline that worked.

09

Honest Reflection

A bigger risk than the model's accuracy was whether surgeons would adopt the recording at all. A grading tool that sits to one side of the workflow, however accurate, is a tool nobody opens. That's why it's built as a suggestion that drops into the existing flow, and why I spent as much time with the surgeons on where the grade lands as on how the model produces it.

The limitation I would name first is the ground truth. I validated against the grades clinicians had already written, so my reference inherits the inconsistency the project set out to fix. A cleaner evaluation would need a curated, adjudicated reference set, which is a project in itself and the obvious next step.

What shaped the build most was the privacy constraint. "Patient data never leaves the building" wasn't a compliance check at the end; it's the reason the models are open-weight and self-hosted.

In clinical AI, I'd aim for a good suggestion over a verdict. The model earns its place by making the right record the easy one to keep, and by being easy to overrule.