AnpherosAnpheros PlatformDevelopers

FHIR R4 Observation example: laboratory result

A single laboratory result is an Observation in the laboratory category. The LOINC code names the analyte and specimen; the reference range and interpretation travel with the value, so the result can be read outside the lab's PDF.

The Observation in JSON

{
  "resourceType": "Observation",
  "id": "glucose",
  "status": "final",
  "category": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "laboratory",
          "display": "Laboratory"
        }
      ]
    }
  ],
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "2345-7",
        "display": "Glucose [Mass/volume] in Serum or Plasma"
      }
    ],
    "text": "Glucose"
  },
  "subject": {
    "reference": "Patient/example",
    "display": "Jane Doe"
  },
  "effectiveDateTime": "2026-10-02T07:45:00-05:00",
  "issued": "2026-10-02T13:10:00-05:00",
  "performer": [
    {
      "reference": "Organization/lab",
      "display": "Springfield Clinical Laboratory"
    }
  ],
  "valueQuantity": {
    "value": 126,
    "unit": "mg/dL",
    "system": "http://unitsofmeasure.org",
    "code": "mg/dL"
  },
  "interpretation": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
          "code": "H",
          "display": "High"
        }
      ]
    }
  ],
  "referenceRange": [
    {
      "low": {
        "value": 70,
        "unit": "mg/dL",
        "system": "http://unitsofmeasure.org",
        "code": "mg/dL"
      },
      "high": {
        "value": 99,
        "unit": "mg/dL",
        "system": "http://unitsofmeasure.org",
        "code": "mg/dL"
      }
    }
  ]
}

Validator result with the eu-lab profile: raw JSON ยท open the validator

The elements that matter

ElementCardinalityNotes
category0..*laboratory.
code1..1LOINC: 2345-7 is glucose measured in serum or plasma; capillary blood has a different code.
valueQuantity0..1Number plus UCUM unit; value is a JSON number, not a string.
referenceRange0..*The lab's range for this result.
interpretation0..*H, L, N and other flags from the v3 ObservationInterpretation code system.
issued0..1When the lab released the result, as an instant.

The validator below this page runs this example with the optional eu-lab rules (category, LOINC code, UCUM unit, reference range). Choose the profile in the validator to run the same check on your own results.

The full definition is in the FHIR R4 Observation specification.

Common mistakes and the errors they cause

Status outside the value set

Observation.status has a required binding; done is not in it.

Value and unit in one string

valueQuantity.value is a decimal; the unit goes in unit and code.

Two value[x] elements

An Observation has one value; use components for several.

Store it in a real FHIR R4 serverA free sandbox key gives you 30 synthetic patients and the full API, including POST /fhir/R4/Observation and $validate.
Get a free API key

More examples

Related guides