Semantic search (embedding-based)
GET
/construe/codes/{codesystem}/search/semanticPerforms semantic similarity search using vector embeddings.
Availability: This endpoint works for both built-in and custom code systems.
When to use: Best for natural language queries where you want to find conceptually related codes, even when different terminology is used. The search understands meaning, not just keywords.
Examples:
- Query "trouble breathing at night" finds codes like "Sleep apnea", "Orthopnea", "Nocturnal dyspnea" — semantically related but no exact keyword matches
- Query "heart problems" finds "Myocardial infarction", "Cardiac arrest", "Arrhythmia"
Trade-offs: Slower than text search (requires embedding generation), but finds conceptually similar results that keyword search would miss.
See also: /search/text for faster keyword-based lookup with typo tolerance.
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
Find codes matching a description of breathing difficulties
Input
codesystempathICD-10-CM
textquerypatient has trouble breathing at night and wakes up gasping
limitquery5
Result
R06.00Dyspnea, unspecified
R06.01Orthopnea
G47.33Obstructive sleep apnea
R06.83Snoring
J45.20Mild intermittent asthma, uncomplicated
