> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# FHIR Extraction

> Learn how the Corti API turns free-text clinical notes into structured FHIR R4 resources

The FHIR Extraction endpoint reads a free-text clinical note and returns the clinical content as structured [FHIR R4](https://hl7.org/fhir/R4/) resources. FHIR is the HL7 standard that most electronic health records (EHRs) use to exchange clinical data. Each resource the endpoint returns carries a standard code, plus the context a clinician wrote around it, such as whether a diagnosis is confirmed, when it started, and which body site it affects.

```
POST https://api.$environment.corti.app/v2/tools/fhir/
```

> [!NOTE]
>
> FHIR Extraction is in **beta**. The request and response schemas can still change. [Contact us](mailto:help@corti.ai) to share feedback or report issues.

## From a sentence to a resource

A clinician writes one sentence:

```text theme={null}
Mild asthma since 2018, well controlled on salbutamol.
```

FHIR Extraction turns that sentence into one Condition resource. Simplified, it reads like this:

| Field | Value | Meaning |
| - | - | - |
| `code` | `195967001` Asthma | What the condition is (SNOMED CT) |
| `severity` | `255604002` Mild | How severe it is |
| `clinicalStatus` | `active` | The patient still has it |
| `onsetDateTime` | `2018` | When it started |

The real response holds the same information in standard FHIR JSON. [FHIR basics](https://docs.corti.ai/fhir/fhir-basics.md) explains how to read it.

## Why not just a list of codes?

A common way to structure a note is to reduce it to a list of codes:

```json theme={null}
{ "codes": ["195967001", "22298006"] }
```

A list of codes tells you *what* the note mentions, but nothing about *how* the note mentions it. Take this note:

```text theme={null}
Possible asthma, to be confirmed with spirometry. Afebrile.
Myocardial infarction in June 2024, treated with PCI. Resolved, no residual symptoms.
Mother has type 2 diabetes.
```

FHIR keeps the differences that a list of codes loses:

| Question | List of codes | FHIR resources |
| - | - | - |
| Is the asthma confirmed? | No way to tell | `verificationStatus: provisional` |
| Does the patient have a fever? | An Afebrile code (`86699002`) that you must know to treat as "no fever" | Fever (`386661006`) with `verificationStatus: refuted`. You search for one code, however the note phrases it. |
| Does the patient still have the myocardial infarction? | No way to tell | `clinicalStatus: resolved`, `onsetString: June 2024` |
| Who has diabetes, the patient or a relative? | A diabetes code looks like the patient's own diagnosis | A `FamilyMemberHistory` resource with `relationship: mother` |
| What was done about it? | Missing, unless you request a separate procedure code system | A `Procedure` resource for the PCI |

Many concepts have no place in a list of codes at all. A blood pressure reading, a smoking history, or a normal heart exam each become their own FHIR resource with a value and a unit.

## What you get back

The response is a [FHIR R4 Bundle](https://hl7.org/fhir/R4/bundle.html): a list of resources. Every response contains one Patient and one Encounter, followed by the clinical resources the endpoint found in the note, sorted into six resource groups:

| Resource group | Captures | Example from a note |
| - | - | - |
| [Patient & Encounter](https://docs.corti.ai/fhir/resource-groups/patient-and-encounter.md) | Who the note is about, and the visit it describes. Always present. | "58-year-old woman", "Admitted via the ED" |
| [Condition](https://docs.corti.ai/fhir/resource-groups/condition.md) | Diagnoses, problems, symptoms, and signs | "Type 2 diabetes, poorly controlled" |
| [Observation](https://docs.corti.ai/fhir/resource-groups/observation.md) | Vital signs, lab results, exam findings, social history, imaging, procedure results, and survey scores | "BP 150/90", "HbA1c 7.2 %", "Smokes 10 cigarettes a day" |
| [Procedure](https://docs.corti.ai/fhir/resource-groups/procedure.md) | Surgery, therapy, counseling, education, and other interventions | "Laparoscopic appendectomy in March 2025" |
| [AllergyIntolerance](https://docs.corti.ai/fhir/resource-groups/allergy-intolerance.md) | Allergies and intolerances, with reactions | "Penicillin causes hives" |
| [FamilyMemberHistory](https://docs.corti.ai/fhir/resource-groups/family-member-history.md) | Conditions in relatives | "Father died of a heart attack at 60" |

The endpoint codes clinical concepts with [SNOMED CT](https://www.snomed.org/), and measurements, such as lab results, vital signs, and survey scores, with [LOINC](https://loinc.org/). Status fields, such as `clinicalStatus`, use the value sets that FHIR defines. Every value the endpoint takes from the note links back to the words that support it.

## When to use FHIR Extraction

Use the endpoint for clinical content that only exists as free text:

* **Write structured data into an EHR.** Turn a dictated or generated note into Condition, Procedure, and Observation resources that your EHR imports through its FHIR API. The response is valid FHIR R4, as [How the response meets FHIR R4](https://docs.corti.ai/fhir/how-it-works.md#how-the-response-meets-fhir-r4) explains.
* **Build a problem list.** Collect active conditions, with their verification status, across a patient's notes.
* **Power decision support.** Feed allergies, conditions, and exam findings into rules that need structured input.
* **Analyze populations.** Count conditions, but keep confirmed and refuted diagnoses apart, and skip family history.

Do not use it to re-create data you already have in structured form, such as lab results from your lab system or vital signs from monitors. A note often copies such a value by hand, rounds it, or repeats an old result, so extracting it again can only add errors. [Reduce extraction errors](https://docs.corti.ai/fhir/reduce-errors.md) explains how to turn those parts off.

## Next steps

> [card] [FHIR Extraction quickstart](https://docs.corti.ai/fhir/quickstart.md)
>
> Send your first note and read the response.

> [card] [FHIR basics](https://docs.corti.ai/fhir/fhir-basics.md)
>
> Learn to read resources, CodeableConcepts, and Bundles, with examples.

> [card] [How FHIR Extraction works](https://docs.corti.ai/fhir/how-it-works.md)
>
> Learn the rules behind every response, such as positive codes and status fields.

> [card] [Filter FHIR resources](https://docs.corti.ai/fhir/filtering.md)
>
> Produce only the resources you need and restrict the codes they carry.

> [!NOTE]
>
> Please [contact us](mailto:help@corti.ai) if you have questions about FHIR Extraction or need help getting started.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.