fhirlab
Foundations· 6 min read

Why FHIR exists

Before FHIR there was HL7v2 — pipe-delimited messages that every vendor interpreted slightly differently. Feel the pain, then feel the relief.

The pain, in one line

Before FHIR, when a hospital in Bangalore wanted to send a lab result to a clinic across town, both systems had to agree on a format that looked like this:

MSH|^~\&|LAB|CENTRAL|EMR|CLINIC|20240115||ORU^R01|842|P|2.5
PID|1||893082^^^MRN||SINGHAI^ASHUTOSH||19980512|M
OBR|1|||8310-5^BODY TEMPERATURE^LN
OBX|1|NM|8310-5^BODY TEMPERATURE^LN||38.6|Cel|36-37.5|H|||F

That is HL7 version 2. Pipe-delimited. Caret-subdelimited. Position-dependent. Readable only if you have the spec open on another monitor and plenty of coffee. And here's the kicker: every vendor interpreted the spec slightly differently. "Interoperable" in theory. A career of bespoke integrations in practice.

The shape of the relief

FHIR (Fast Healthcare Interoperability Resources, pronounced fire) looked at HL7v2, looked at how the rest of the internet had evolved — JSON, REST, OAuth — and said: let's model healthcare as resources, and move them over HTTP like every other modern system.

The same lab result in FHIR:

POST /Observation
Content-Type: application/fhir+json

{
  "resourceType": "Observation",
  "status": "final",
  "code": {
    "coding": [{ "system": "http://loinc.org", "code": "8310-5", "display": "Body temperature" }]
  },
  "subject": { "reference": "Patient/893082" },
  "valueQuantity": { "value": 38.6, "unit": "Cel", "system": "http://unitsofmeasure.org" }
}

Same information. Explicit field names. Standard codes referenced by URL. A real HTTP verb on a real resource URL. If you've ever used a REST API, you already know 80% of FHIR.

Three ideas that make FHIR click

1. Everything is a resource

A patient is a Patient. A visit is an Encounter. A blood-pressure reading is an Observation. A prescription is a MedicationRequest. There are about 150 resource types — but you'll use ~15 for 80% of real work. Each has a well-known JSON shape and lives at /ResourceType/{id}.

2. Resources point at each other with URLs

FHIR doesn't embed one resource inside another. It links. An Observation doesn't include the patient's name and birthday — it holds a subject.reference like "Patient/893082". That one choice gives you deduplication, consistency, and the ability to update a patient's record once and have every observation of theirs automatically reflect it.

3. Codes come from real vocabularies

FHIR refuses to invent its own clinical codes. "Body temperature" is LOINC 8310-5. "Hypertension" is SNOMED 38341003. "Cel" (Celsius) is UCUM Cel. Each code carries its source system URL alongside it — so a computer in Bangalore and one in Boston agree on what you mean, even if their software stacks share zero code.

If you take away one thing from this lesson: FHIR is REST + JSON + standard vocabularies, applied to healthcare.

What you'll do next

In the next lesson you'll create your very first FHIR resource — a real Patient — against the public HAPI sandbox. You'll watch the request fly, read it back, and poke at the response with a JSONPath explorer. No setup. Just click Run.