Back to Guides
Clinical Standards
Laboratory & Observation Codes

LOINC Codes Guide

LOINC (Logical Observation Identifiers Names and Codes) is the universal standard for identifying laboratory and clinical observations. This guide covers LOINC structure, database design, and clinical implementation.

What is LOINC?

LOINC (Logical Observation Identifiers Names and Codes) is a universal code system for identifying laboratory and clinical observations. Developed by the Regenstrief Institute, LOINC provides standardized codes for test results, vital signs, clinical measurements, and survey instruments.

LOINC codes enable consistent exchange of laboratory and clinical data between different healthcare systems, supporting interoperability, data analytics, and clinical decision support.

LOINC Code Structure

Components of a LOINC Code

LOINC codes follow a six-part naming convention:

Component:What is being measured (e.g., Glucose, Hemoglobin)
Property:What characteristic (e.g., Mass, Volume)
Timing:When measured (e.g., Random, Fasting)
System:Where measured (e.g., Blood, Serum)
Scale:How measured (e.g., Quantitative, Ordinal)
Method:Measurement technique (optional)
Example: Glucose in Blood
LOINC Code: 2339-0
Long Name:    Glucose [Mass/volume] in Blood
Component:    Glucose
Property:     Mass concentration (Mass/Vol)
Timing:       Point in time
System:       Blood
Scale:        Quantitative
Method:       (Not specified)

Common LOINC Codes

Vital Signs

LOINC CodeDescriptionUnits
8480-6Systolic blood pressuremm[Hg]
8462-4Diastolic blood pressuremm[Hg]
8867-4Heart rate/min
8310-5Body temperatureCel
9279-1Respiratory rate/min

Common Lab Tests

LOINC CodeDescriptionSpecimen
2339-0Glucose [Mass/volume] in BloodBlood
4548-4Hemoglobin A1c/Hemoglobin.total in BloodBlood
2085-9HDL Cholesterol [Mass/volume] in SerumSerum
2571-8Triglyceride [Mass/volume] in SerumSerum
6690-2Leukocytes [#/volume] in BloodBlood

LOINC Database Schema

Recommended PostgreSQL schema for LOINC codes and observations:

-- LOINC Reference Table
CREATE TABLE loinc_code (
  loinc_num           VARCHAR(10) PRIMARY KEY,         -- e.g., "2339-0"
  component           VARCHAR(255),                    -- What is measured
  property            VARCHAR(100),                    -- Mass, Volume, etc.
  time_aspect         VARCHAR(100),                    -- Point in time, 24H, etc.
  system              VARCHAR(100),                    -- Blood, Serum, Urine
  scale_type          VARCHAR(50),                     -- Qn, Ord, Nom
  method_type         VARCHAR(255),                    -- Measurement method
  
  -- Display names
  long_common_name    VARCHAR(500),                    -- Full descriptive name
  short_name          VARCHAR(255),                    -- Abbreviated name
  display_name        VARCHAR(500),                    -- Preferred display name
  
  -- Classification
  loinc_class         VARCHAR(100),                    -- Chemistry, Hematology, etc.
  status              VARCHAR(20),                     -- ACTIVE, DEPRECATED
  
  -- Units
  example_units       VARCHAR(100),                    -- Common unit of measure
  
  -- Metadata
  created_at          TIMESTAMP DEFAULT NOW(),
  updated_at          TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_loinc_component ON loinc_code(component);
CREATE INDEX idx_loinc_class ON loinc_code(loinc_class);
CREATE INDEX idx_loinc_status ON loinc_code(status);

-- Laboratory Observations
CREATE TABLE lab_observation (
  id                  UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  
  -- Patient & Order
  patient_id          UUID NOT NULL,
  order_id            UUID,
  encounter_id        UUID,
  
  -- Observation Details
  loinc_code          VARCHAR(10) NOT NULL REFERENCES loinc_code(loinc_num),
  observation_date    TIMESTAMP NOT NULL,
  result_status       VARCHAR(20),                     -- final, preliminary, corrected
  
  -- Result Value
  value_numeric       DECIMAL(18,6),                   -- Numeric results
  value_text          TEXT,                            -- Text results
  value_coded         VARCHAR(100),                    -- Coded results
  value_unit          VARCHAR(50),                     -- Unit of measure
  
  -- Reference Range
  reference_low       DECIMAL(18,6),
  reference_high      DECIMAL(18,6),
  reference_text      VARCHAR(255),
  
  -- Interpretation
  abnormal_flag       VARCHAR(20),                     -- H (High), L (Low), N (Normal)
  interpretation      VARCHAR(100),
  
  -- Source Info
  performing_lab      VARCHAR(255),
  instrument_id       VARCHAR(100),
  method              VARCHAR(255),
  
  -- Metadata
  created_at          TIMESTAMP DEFAULT NOW(),
  updated_at          TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_lab_patient ON lab_observation(patient_id);
CREATE INDEX idx_lab_loinc ON lab_observation(loinc_code);
CREATE INDEX idx_lab_date ON lab_observation(observation_date);
CREATE INDEX idx_lab_order ON lab_observation(order_id);

SQL Query Examples

Get All Glucose Results for a Patient

SELECT 
  lo.observation_date,
  lc.long_common_name,
  lo.value_numeric,
  lo.value_unit,
  lo.abnormal_flag
FROM lab_observation lo
JOIN loinc_code lc ON lo.loinc_code = lc.loinc_num
WHERE lo.patient_id = 'patient-uuid'
  AND lc.component LIKE '%Glucose%'
ORDER BY lo.observation_date DESC;

Find Abnormal Lab Results

SELECT 
  lo.patient_id,
  lc.long_common_name,
  lo.value_numeric,
  lo.value_unit,
  lo.reference_low,
  lo.reference_high,
  lo.abnormal_flag
FROM lab_observation lo
JOIN loinc_code lc ON lo.loinc_code = lc.loinc_num
WHERE lo.abnormal_flag IN ('H', 'L', 'HH', 'LL')
  AND lo.result_status = 'final'
  AND lo.observation_date >= CURRENT_DATE - INTERVAL '30 days';

Related Healthcare Standards