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

ParameterDescriptionExample
qGeneral text search across procedure descriptionsq=hip replacement

Filters

ParameterTypeDescriptionExample
chapterstringOPCS-4 chapter letterW
categorystringOPCS-4 category codeW37

Pagination & Response

ParameterDefaultMaxDescription
limit20100Results per page
page1100Page number
shapecompact---compact, standard, full
sortrelevance---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

ChapterDescription
ANervous system
BEndocrine system and breast
CEye
DEar
ERespiratory tract
FMouth
GUpper digestive tract
HLower digestive tract
JOther abdominal organs (principally digestive)
KHeart
LArteries and veins
MUrinary
NMale genital organs
PLower female genital tract
QUpper female genital tract
RFemale genital tract associated with pregnancy
SSkin
TSoft tissue
VBones and joints of skull and spine
WOther bones and joints of skeleton
XMiscellaneous operations
YSubsidiary classification of methods of operation
ZSubsidiary classification of sites of operation

Facets

OPCS-4 search returns these facets:

FacetDescription
chapterDistribution by OPCS-4 chapter

Required Scope

opcs4.search

See Also