Dashboard

OPCS-4 Search

Search OPCS-4 UK procedure classification codes.

Endpoint

GET /v1/opcs4/search

Quick Start

Node.js
import { Fhirfly } from "@fhirfly-io/terminology";

const client = new Fhirfly({ apiKey: "YOUR_API_KEY" });

// Search for hip replacement procedures
const results = await client.opcs4.search({
  q: "hip replacement"
});

console.log(`Found ${results.total} procedures`);
for (const item of results.items) {
  console.log(`${item.code}: ${item.display}`);
}

Parameters

Parameter Description Example
q General text search across procedure descriptions q=hip replacement

Filters

Parameter Type Description Example
chapter string OPCS-4 chapter letter W
category string OPCS-4 category code W37

Pagination & Response

Parameter Default Max Description
limit 20 100 Results per page
page 1 100 Page number
shape compact --- compact, standard, full
sort relevance --- relevance, code

Example Response

{
  "facets": {
    "chapter": {
      "W": 24,
      "O": 8
    }
  },
  "has_more": true,
  "items": [
    {
      "code": "W37.1",
      "display": "Primary total prosthetic replacement of hip joint using cement",
      "chapter": "W"
    },
    {
      "code": "W38.1",
      "display": "Primary total prosthetic replacement of hip joint not using cement",
      "chapter": "W"
    }
  ],
  "limit": 2,
  "meta": {
    "legal": {
      "attribution_required": true,
      "citation": "The OPCS Classification of Interventions and Procedures, Crown copyright. Open Government Licence v3.0.",
      "license": "OGL-UK-3.0",
      "source_name": "NHS England OPCS-4"
    }
  },
  "page": 1,
  "total": 32,
  "total_capped": false
}

Use Cases

Search Orthopaedic Procedures

Node.js
const results = await client.opcs4.search({
  q: "knee replacement",
  chapter: "W"
});

Browse by Chapter

Node.js
// Chapter G = Upper digestive tract
const results = await client.opcs4.search({
  chapter: "G"
});

Search Cardiac Procedures

Node.js
const results = await client.opcs4.search({
  q: "coronary angioplasty"
});

Filter by Category

Node.js
// Category W37 = Total prosthetic replacement of hip joint using cement
const results = await client.opcs4.search({
  category: "W37"
});

OPCS-4 Chapters

Chapter Description
A Nervous system
B Endocrine system and breast
C Eye
D Ear
E Respiratory tract
F Mouth
G Upper digestive tract
H Lower digestive tract
J Other abdominal organs (principally digestive)
K Heart
L Arteries and veins
M Urinary
N Male genital organs
P Lower female genital tract
Q Upper female genital tract
R Female genital tract associated with pregnancy
S Skin
T Soft tissue
V Bones and joints of skull and spine
W Other bones and joints of skeleton
X Miscellaneous operations
Y Subsidiary classification of methods of operation
Z Subsidiary classification of sites of operation

Facets

OPCS-4 search returns these facets:

Facet Description
chapter Distribution by OPCS-4 chapter

Required Scope

opcs4.search

See Also