HCPCS Code Search
Search HCPCS (Healthcare Common Procedure Coding System) Level II codes by code or description. The search supports exact matches, prefix searches, and full-text search with BM25 ranking.
Searching for HCPCS Codes
You can search for HCPCS codes using the SDK or API:
Search for HCPCS codes with the SDK:
import Oystehr from '@oystehr/sdk';
const oystehr = new Oystehr({
accessToken: "<your_access_token>",
});
const result = await oystehr.terminology.searchHcpcs({
query: "A4206",
});Query Parameters
- query (required): Search query string (code or description text)
- searchType (optional): Type of search to perform
code- searches only code fielddescription- searches description fieldall- searches both code and description (default)
- limit (optional): Number of results per page (1-100, default: 10)
- cursor (optional): Cursor for pagination. Use the
nextCursorfrom a previous response to get the next page - strictMatch (optional): When true, only returns exact matches without fuzzy search or prefix matching (default: false)
Response
{
"codes": [
{
"code": "A4206",
"display": "Syringe with needle, sterile, 1 cc or less, each"
}
],
"metadata": {
"nextCursor": "MS4zOkE0MjA2" // Base64-encoded cursor, null if no more results
}
}Pagination
The API uses cursor-based pagination. To retrieve the next page of results, pass the nextCursor value from the previous response as the cursor parameter in your next request:
// First page
const page1 = await oystehr.terminology.searchHcpcs({
query: "syringe",
limit: 10,
});
// Next page (if available)
if (page1.metadata.nextCursor) {
const page2 = await oystehr.terminology.searchHcpcs({
query: "syringe",
limit: 10,
cursor: page1.metadata.nextCursor,
});
}Search Behavior
The search uses MiniSearch with BM25 scoring and searches across multiple fields.
Prefix Search
For code-based searches, the system supports prefix matching (e.g., "A42" matches "A4206", "A4207", etc.).
Full-Text Search
For description-based searches, the system performs full-text search across description fields with relevance ranking.
Access Policy
Access Policy Action: Terminology:SearchCodes
Access Policy Resource: Terminology:Code:*