---
title: "Clinical Text Structuring & Medical Coding"
url: https://ypai.ai/solutions/healthcare/clinical-text-and-coding/
description: "Clinical free text turned into structured, coded training data: extraction against your schema, coding at a pinned vocabulary, named-method de-identification."
source: "src/copy/routes (route /solutions/healthcare/clinical-text-and-coding/)"
---

# Everything your model needs is in the note. So is everything the law says must not leave it.

> Clinical free text turned into structured, coded training data: extraction against your schema, coding at a pinned vocabulary, named-method de-identification.

Clinical text structured against your schema, coded against the vocabulary you name, and de-identified under a method we name out loud, with its cost in clinical signal and its residual risk written down rather than waved through.

## Three questions decide whether a note can become training data.

Structuring clinical text is the easy half. The hard half is proving what left the building, under which method, and who was qualified to read it on the way out.

### Can it lawfully leave?

- The rule gives two methods and no third. Safe Harbor removes eighteen categories of identifier and needs no statistician. Expert Determination keeps more clinical signal and needs a qualified expert to determine the risk is very small and to document how. Your engagement names which one it uses before a single note is touched.

### Did someone who reads notes for a living read it?

- An entity is only a code once a person agrees it is. Extraction runs with native-speaker linguists, clinical judgement calls go to reviewers credentialed for the domain, and disagreement is measured on the delivered material.

### Will it load into what you already run?

ICD-10 R07.4 · SNOMED CT 29857009

- The delivery schema is agreed at scoping, not discovered at handover. FHIR R4 is one of the shapes we export into, delivered as files against the profile your engagement names.

## Four engagements, scoped to one corpus and one schema.

Each is independently purchasable and configured per engagement. Four things are settled before the first note is opened.

### Clinical note structuring

- The free text your systems cannot query.
- Extraction, classification and structuring of clinical free text against an agreed schema: conditions, medications, dosages, procedures, findings, and the negations and uncertainty markers that change the meaning of all of them. Scanned material is handled layout-aware, so a table survives as a table.
- **Source**: Free text · dictation output · scan
- **Extracted**: chest pain · aspirin · 75 mg
- **Negation**: confirm. shortness of breath · ruled out, kept as ruled out

Delivered against the schema agreed at scoping

### Coding against your vocabulary

- The code your systems already speak, at the version they speak it in.
- Entities linked to ICD-10 and ICD-11, SNOMED CT, RxNorm or MedDRA at the version your engagement names. Cases where two codes can both be defended go to an adjudicator rather than to a majority vote, and the disagreement is kept in the record.
- **Vocabulary**: Named and version-pinned per engagement
- **Link**: chest pain · R07.4 · 29857009, span kept
- **Ambiguity**: flag. Sent to an adjudicator, disagreement kept

Every code traceable to the words that produced it

### De-identification with the method named

- A record a privacy officer can check against the rule.
- Direct and indirect identifiers removed under the method your engagement selects, with what that method costs you in clinical signal stated up front, and residual re-identification risk documented rather than declared absent.
- **Method**: Safe Harbor or Expert Determination · named in writing
- **Removed**: Mr Berg · 14 March · Gjøvik · Tuesday
- **Residual risk**: flag. Documented, never called zero

The method, its limits and its evidence travel with the data

### Evaluation sets from clinical text

- Test material your model has not already read.
- Held-out clinical sets for the tasks you actually ship: extraction, coding, summarisation and question answering, with inter-annotator agreement measured on the delivered material using a coefficient agreed at scoping.
- **Material**: Extraction · coding · summarisation · QA
- **Agreement**: confirm. Measured on this set, coefficient agreed at scoping
- **Held out**: confirm. This note, and every note like it, kept out of training

The set is yours to reuse across releases

Synthetic example, not a real record

## There are two lawful methods. There is no third.

Both are named in the same rule, and they trade the same thing against each other: how much clinical signal survives, against how much the method demands of you. The engagement picks one, in writing, before anything is touched. Here is one sentence under both.

- Remove the eighteen categories. Hold no actual knowledge.
- Eighteen categories of identifier come out: names, geography below state level, all dates tied to an individual, contact details, record and account numbers, biometric identifiers, and the rest. The party de-identifying must also hold no actual knowledge that what remains could still identify someone. The age stays: only ages over eighty-nine come out.
- Mechanical and auditable. No statistician required.
- Takes real clinical signal with it. Every date, the place, the weekday.
- The identifier inventory, and what was removed from which field.

### struck

- A qualified expert determines the risk is very small, and documents how.
- A person with appropriate knowledge of generally accepted statistical and scientific principles determines that the risk of re-identification is very small, and documents the methods and results of that analysis. The rule sets no mathematical threshold. The judgement is the expert's, made against the context of the release.
- Keeps clinical signal that Safe Harbor would strip out. The dates can stay.
- Requires a qualified expert, and their analysis takes its own time.
- The expert's documented methods and results, signed by the expert.

### struck

k-anonymity is one technique an expert may use inside that analysis. It is not a synonym for the method, and passing it is not a determination. Rare diagnoses, unusual date patterns and free text all re-identify people, and a long document leaks more than a short one.

Both methods belong to HIPAA, not GDPR

Safe Harbor and Expert Determination are HIPAA's two methods. Neither of them makes data anonymous under GDPR. European guidance now treats anonymity as relative rather than absolute, and warns that AI makes re-identification easier, so material that once passed as anonymous can be personal data again. We treat de-identified clinical text as pseudonymised personal data and keep it under the same controls, because that is what it is.

## Four stations. The note only moves when a person says it can.

A note arrives as it was written, entities are marked in place, codes are linked at a pinned version, and the package is delivered in the shape agreed at scoping. Each station turns green only when a person has confirmed it, never when a model has finished.

### Received as it was written

- Free text, dictation output or a scan. Where the source is an image it is handled layout-aware, so headings, tables and columns survive as structure instead of collapsing into a wall of words.

### Marked by someone who reads them

- Conditions, medications, dosages, procedures and findings marked in place, with negation and uncertainty marked alongside them, because a ruled-out diagnosis is not a diagnosis and a suspected one is not a confirmed one.

### Linked at a pinned version

- Each entity linked to a code in the vocabulary the engagement named, at the version it named. Where two codes can both be defended, the case goes to an adjudicator and the disagreement stays in the record rather than being resolved by a vote.

negated · not coded as present

### Delivered in the shape you asked for

- The structured records, the vocabulary version, the agreement figure, and the de-identification method with its stated limits, in the delivery schema agreed at scoping.

#### struck

- **schema**: as agreed at scoping
- **vocabulary**: version-pinned
- **spans**: character offsets kept
- **de-identification**: Safe Harbor · 4 removals · residual risk documented
- **agreement**: coefficient agreed at scoping, measured on this set

## The shape is agreed before the work, not after.

What arrives, in which form, and what that form actually commits us to. Nothing here is discovered at handover.

- one condition, one drug with its dose, one finding kept as ruled out
- The field names are the ones written into the engagement, not ours. A schema change mid-engagement is a scope change, and we say so.
- ICD-10 · ICD-11 · SNOMED CT · RxNorm · MedDRA
- R07.4 · 29857009 · RxNorm 1191
- Named and version-pinned per engagement, because a code that moved between versions is a different code.
- Delivered as files, against the profile your engagement names. Loading them into your systems stays inside your own change control.
- Every code can be traced back to the words that produced it, which is what makes a disputed label reviewable months later.
- The record a privacy officer asks for: which method, what came out, and what risk remains.
- A coefficient agreed at scoping, on the delivered set
- Measured on this material. The coefficient is agreed at scoping so the number means the same thing to both sides.

## Clinical text is the most identifying material we handle. It stays where it belongs.

A Norwegian company under GDPR. Clinical project data is stored in Europe by default and processed in the EEA by default, with the paperwork to prove both. US healthcare work is handled HIPAA-compliant.

- **Jurisdiction**: Norway · GDPR-native
- **Storage**: European by default
- **Processing**: EEA by default
- **Languages**: Nordic and European clinical text · native-speaker linguists
- **Annotators**: Named, contracted, never crowdsourced
- **Reviewers**: Credential-verified per engagement
- **Evidence**: Method, removals, spans, agreement
- **US engagements**: HIPAA-compliant handling
- **Contracts**: Standard DPA terms · SCCs available
- **Erasure**: 30-day end-of-contract SLA
- [The healthcare hub](https://ypai.ai/solutions/healthcare/)
- [Clinical data collection](https://ypai.ai/solutions/healthcare/custom-data-collection/)
- [Clinical AI systems](https://ypai.ai/solutions/healthcare/clinical-ai-systems/)
- [Clinical model evaluation](https://ypai.ai/solutions/healthcare/clinical-model-evaluation/)
- [Medical imaging annotation](https://ypai.ai/solutions/healthcare/medical-imaging-annotation/)
- [De-identifying clinical audio](https://ypai.ai/blog/compliance/how-to-de-identify-audio-data-hipaa/)

## Start with one corpus, one schema, one vocabulary.

We scope against the material as it actually looks, agree the schema and the de-identification method before anything is touched, and test the method on a bounded first batch.

Scope · Schema · Method · First batch · Acceptance

A bounded first batch carries its own acceptance criteria. You judge the structured output against your own records.

Briefs are treated as confidential. We are used to corpora that cannot leave the EEA and schemas that cannot be described outside the engagement.

Tell us what the material is, what schema it has to land in, and which method your privacy officer expects. We reply with a feasibility read.

We come back with a feasibility read on the material and the method. Enquiry details are treated as confidential.
