Skip to content
The Path

Module 6 · FHIR·11 min

Reading a FHIR resource

References, codes, extensions and profiles, on a real Observation.

A FHIR resource looks scary the first time: curly braces, square brackets, web addresses everywhere. Yet it reads like a form. Every key has a name that says what it holds. Let’s read Marie Dubois’s AHI together, key by key.

The full resource

{
  "resourceType": "Observation",
  "id": "iah-0042",
  "meta": {
    "profile": [
      "https://fhir.clinique-leleux.example/StructureDefinition/observation-sommeil"
    ]
  },
  "extension": [
    {
      "url": "https://fhir.clinique-leleux.example/StructureDefinition/nuit-titration-ppc",
      "valueBoolean": false
    }
  ],
  "status": "final",
  "category": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "procedure"
        }
      ]
    }
  ],
  "code": {
    "coding": [
      {
        "system": "https://fhir.clinique-leleux.example/CodeSystem/labo-sommeil",
        "code": "AHI",
        "display": "Apnea-hypopnea index"
      },
      {
        "system": "http://loinc.org",
        "code": "69990-0",
        "display": "Apnea hypopnea index 24 hour"
      }
    ],
    "text": "Apnea-hypopnea index"
  },
  "subject": {
    "reference": "Patient/1024",
    "display": "Marie Dubois"
  },
  "effectiveDateTime": "2026-06-27T06:30:00+02:00",
  "valueQuantity": {
    "value": 28.5,
    "unit": "/h",
    "system": "http://unitsofmeasure.org",
    "code": "/h"
  },
  "interpretation": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
          "code": "H",
          "display": "High"
        }
      ]
    }
  ],
  "referenceRange": [
    { "text": "below 5 per hour" }
  ]
}

The clinique-leleux.example addresses are made up for the example: the .example domain is reserved for exactly that. URIs are identifiers, so they stay the same in every language, which is why they keep their French words here. The whole course uses exactly the same ones.

Identity: resourceType and id

resourceType tells you what you are looking at: an Observation. id is its identifier on this server. Together they form its address: Observation/iah-0042.

Status: status

final: the result is validated. Other possible values include registered, preliminary and amended. It is the direct counterpart of OBX-11.

Just below, category files the measurement into a broad family. Here procedure: an observation produced by a procedure, the polysomnography. It has no direct counterpart in the OBX, but many national guides require it.

What was measured: code, a CodeableConcept

code is a CodeableConcept, the type you meet all over FHIR whenever a code is needed. It holds:

  • a coding list, where each entry carries a system (who defined the code), a code and a display (the readable label);
  • a text, the plain wording, for humans.

Here, two codes name the same measurement: the lab’s local code AHI, and the LOINC code 69990-0 as an alternate, understood worldwide. Read its name carefully: “24 hour”. This LOINC code was not designed for the AHI of a polysomnography night, it is only the closest match. More on that in the terminologies lesson. One CodeableConcept can carry both codes. It is the counterpart of OBX-3, which can also carry a main code and an alternate code.

OBX-3 carries the local AHI code (flag L), then the alternate LOINC code (flag LN).

ORU^R01· Observation result (unsolicited)
||||||||||
||||||||
||||||||||||||

Compare: in v2, L says “local code” and LN says “this is LOINC”. In FHIR, URIs play that role: the lab’s URI for AHI, http://loinc.org for 69990-0.

Who it is about: subject, a reference

subject does not contain Marie: it points to her. "reference": "Patient/1024" is a relative reference, read against the server’s base address. It could also be a full URL. The display is just a label for humans: reference is what lets the software find the patient.

That is the big shift from v2: you no longer copy the PID into every message, you link to it.

When: effectiveDateTime

The clinical time of the measurement, in ISO format with the time zone: end of the recording, 6:30 a.m., Belgian summer time. In v2, that was OBX-14. The [x] you will see in the documentation (effective[x]) means the type can vary: effectiveDateTime for a point in time, effectivePeriod for a span.

For an AHI, computed over the whole night, an effectivePeriod from 10 p.m. to 6:30 a.m. would be even more precise. The official v2-to-FHIR guide puts OBX-14 into effectiveDateTime, so we follow that choice here.

The value: valueQuantity

Same logic with value[x]. A numeric measurement becomes valueQuantity:

Key Role Here
value The number 28.5
unit The readable unit /h
system The unit system http://unitsofmeasure.org, meaning UCUM
code The coded unit /h, “per hour” in UCUM

Text would have given valueString, a code valueCodeableConcept. In v2, OBX-2 announced the type: NM for a number.

The verdict: interpretation and referenceRange

interpretation is another CodeableConcept. Code H (High) from the v3-ObservationInterpretation system says: above normal. It is the H from OBX-8.

referenceRange gives the normal range. Here as free text, like OBX-7. It also accepts numeric bounds, low and high, when you can state them cleanly.

Extensions: what the standard did not plan for

The clinic wants to record whether the night was a CPAP titration night. It could have used method or the code of the study. The clinic preferred a simple yes or no: a textbook case for an extension. It always has two parts:

  • a url that identifies the extension’s definition;
  • a typed value, here valueBoolean.

Any element can carry extensions. The standard is explicit: there is no stigma in using an extension, and a system should not reject a resource just because it does not know one of its extensions.

It is the clean version of the v2 Z-segment: instead of a home-made segment nobody can read, an extension with an address that leads to its definition.

Profiles: the local rules of the game

meta.profile lists the profiles the resource claims to conform to. A profile tightens the base resource: this element becomes mandatory, that code must come from LOINC, this extension is allowed. A profile is itself described by a StructureDefinition resource.

In Belgium, the eHealth platform publishes federal profiles built on R4. In the United States, it is US Core. Two FHIR servers with different profiles will not necessarily understand each other.

Check your understanding

1 of 4

In an Observation, which address identifies the LOINC code system in coding.system?

+50 XPPass the quiz (3 correct answers) to complete the lesson.

Reviewed and checked on 27 September 2026