curl -X POST "https://api.omophub.com/v1/search/advanced" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "diabetes mellitus type 2",
"page_size": 10
}'
results = client.search.advanced_search(
query="diabetes mellitus type 2",
page_size=10
)
for concept in results.data:
print(f"{concept.concept_id}: {concept.concept_name}")
print(f" Vocabulary: {concept.vocabulary_id}")
print(f" Score: {concept.search_score:.3f}")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data: results } = await client.search.advanced({
query: 'diabetes mellitus type 2',
pageSize: 10,
});
results?.forEach(concept => {
console.log(`${concept.concept_id}: ${concept.concept_name}`);
console.log(` Vocabulary: ${concept.vocabulary_id}`);
console.log(` Score: ${concept.search_score?.toFixed(3)}`);
});
results <- advanced_search_concepts(client,
query = "diabetes mellitus type 2",
page_size = 10
)
for (i in 1:nrow(results$data$concepts)) {
concept <- results$data$concepts[i, ]
cat(paste(concept$concept_id, concept$concept_name, sep = ": "), "\n")
cat(paste(" Vocabulary:", concept$vocabulary_id), "\n")
cat(paste(" Score:", round(concept$search_score, 3)), "\n")
}
{
"success": true,
"data": {
"concepts": [
{
"concept_id": 201826,
"concept_name": "Type 2 diabetes mellitus",
"concept_code": "44054006",
"vocabulary_id": "SNOMED",
"vocabulary_name": "Systematized Nomenclature of Medicine Clinical Terms",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "1970-01-01",
"valid_end_date": "2099-12-31",
"invalid_reason": null,
"search_score": 0.843
},
{
"concept_id": 435216,
"concept_name": "Diabetes mellitus type 2 in obese",
"concept_code": "E11.0",
"vocabulary_id": "ICD10CM",
"vocabulary_name": "International Classification of Diseases, Tenth Revision, Clinical Modification",
"domain_id": "Condition",
"concept_class_id": "4-char billing code",
"standard_concept": null,
"valid_start_date": "2015-10-01",
"valid_end_date": "2099-12-31",
"invalid_reason": null,
"search_score": 0.786
}
],
"facets": {
"vocabularies": [
{"vocabulary_id": "SNOMED", "vocabulary_name": "SNOMED CT", "count": 45},
{"vocabulary_id": "ICD10CM", "vocabulary_name": "ICD-10-CM", "count": 23},
{"vocabulary_id": "ICD9CM", "vocabulary_name": "ICD-9-CM", "count": 12}
],
"domains": [
{"domain_id": "Condition", "domain_name": "Condition", "count": 67},
{"domain_id": "Observation", "domain_name": "Observation", "count": 13}
],
"concept_classes": [
{"concept_class_id": "Clinical Finding", "concept_class_name": "Clinical Finding", "count": 45},
{"concept_class_id": "4-char billing code", "concept_class_name": "4-char billing code", "count": 23}
],
"years": [
{"year": 1970, "count": 45},
{"year": 2015, "count": 23}
]
},
"facet_status": {
"partial": false,
"failed_facets": []
},
"search_metadata": {
"query_time_ms": 127,
"total_results": 80,
"max_relevance_score": 10,
"search_algorithm": "full_text_with_ranking"
}
},
"meta": {
"request_id": "req_adv_search_abc123",
"timestamp": "2024-01-15T10:30:00Z",
"vocab_release": "2025.1",
"search": {
"query": "diabetes mellitus type 2",
"total_results": 80,
"filters_applied": {
"vocabulary_ids": [],
"domain_ids": [],
"standard_concepts_only": false,
"include_invalid": true
}
},
"pagination": {
"page": 1,
"page_size": 10,
"total_items": 80,
"total_pages": 8,
"has_next": true,
"has_previous": false
}
}
}
Advanced Search
Perform multi-criteria search across OMOP medical vocabularies with advanced filtering by domain, vocabulary, concept class, and standard status.
curl -X POST "https://api.omophub.com/v1/search/advanced" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "diabetes mellitus type 2",
"page_size": 10
}'
results = client.search.advanced_search(
query="diabetes mellitus type 2",
page_size=10
)
for concept in results.data:
print(f"{concept.concept_id}: {concept.concept_name}")
print(f" Vocabulary: {concept.vocabulary_id}")
print(f" Score: {concept.search_score:.3f}")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data: results } = await client.search.advanced({
query: 'diabetes mellitus type 2',
pageSize: 10,
});
results?.forEach(concept => {
console.log(`${concept.concept_id}: ${concept.concept_name}`);
console.log(` Vocabulary: ${concept.vocabulary_id}`);
console.log(` Score: ${concept.search_score?.toFixed(3)}`);
});
results <- advanced_search_concepts(client,
query = "diabetes mellitus type 2",
page_size = 10
)
for (i in 1:nrow(results$data$concepts)) {
concept <- results$data$concepts[i, ]
cat(paste(concept$concept_id, concept$concept_name, sep = ": "), "\n")
cat(paste(" Vocabulary:", concept$vocabulary_id), "\n")
cat(paste(" Score:", round(concept$search_score, 3)), "\n")
}
{
"success": true,
"data": {
"concepts": [
{
"concept_id": 201826,
"concept_name": "Type 2 diabetes mellitus",
"concept_code": "44054006",
"vocabulary_id": "SNOMED",
"vocabulary_name": "Systematized Nomenclature of Medicine Clinical Terms",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "1970-01-01",
"valid_end_date": "2099-12-31",
"invalid_reason": null,
"search_score": 0.843
},
{
"concept_id": 435216,
"concept_name": "Diabetes mellitus type 2 in obese",
"concept_code": "E11.0",
"vocabulary_id": "ICD10CM",
"vocabulary_name": "International Classification of Diseases, Tenth Revision, Clinical Modification",
"domain_id": "Condition",
"concept_class_id": "4-char billing code",
"standard_concept": null,
"valid_start_date": "2015-10-01",
"valid_end_date": "2099-12-31",
"invalid_reason": null,
"search_score": 0.786
}
],
"facets": {
"vocabularies": [
{"vocabulary_id": "SNOMED", "vocabulary_name": "SNOMED CT", "count": 45},
{"vocabulary_id": "ICD10CM", "vocabulary_name": "ICD-10-CM", "count": 23},
{"vocabulary_id": "ICD9CM", "vocabulary_name": "ICD-9-CM", "count": 12}
],
"domains": [
{"domain_id": "Condition", "domain_name": "Condition", "count": 67},
{"domain_id": "Observation", "domain_name": "Observation", "count": 13}
],
"concept_classes": [
{"concept_class_id": "Clinical Finding", "concept_class_name": "Clinical Finding", "count": 45},
{"concept_class_id": "4-char billing code", "concept_class_name": "4-char billing code", "count": 23}
],
"years": [
{"year": 1970, "count": 45},
{"year": 2015, "count": 23}
]
},
"facet_status": {
"partial": false,
"failed_facets": []
},
"search_metadata": {
"query_time_ms": 127,
"total_results": 80,
"max_relevance_score": 10,
"search_algorithm": "full_text_with_ranking"
}
},
"meta": {
"request_id": "req_adv_search_abc123",
"timestamp": "2024-01-15T10:30:00Z",
"vocab_release": "2025.1",
"search": {
"query": "diabetes mellitus type 2",
"total_results": 80,
"filters_applied": {
"vocabulary_ids": [],
"domain_ids": [],
"standard_concepts_only": false,
"include_invalid": true
}
},
"pagination": {
"page": 1,
"page_size": 10,
"total_items": 80,
"total_pages": 8,
"has_next": true,
"has_previous": false
}
}
}
Overview
The advanced search endpoint provides powerful multi-criteria search capabilities across healthcare vocabularies. Use complex queries, filters, and ranking to find the most relevant medical concepts.Best for: Complex search scenarios requiring multiple filters, specific
vocabularies, or advanced ranking criteria.
Query Requirements: Provide a configured whole-query clinical
abbreviation, a query of at least 3 characters, or at least one selective
filter (
vocabulary_ids, domain_ids, or concept_class_ids). Filter-only
requests and other 1-2 character queries are accepted only when one of those
filters is present.Endpoint
string
/v1/search/advanced
Authentication
string
required
Bearer token with your API key
Request Body
string
The search query termExample:
"diabetes mellitus type 2"Validation: Query must be a configured abbreviation (COPD, CHF, MI,
T2DM, HTN, or CKD) or at least 3 characters long, unless the request
includes a vocabulary_ids, domain_ids, or concept_class_ids value. The
field may be omitted for filter-only searches.string[]
Array of vocabulary IDs to search withinOptions:
SNOMED, ICD10CM, ICD9CM, RxNorm, LOINC, HCPCS, etc.Default: All vocabulariesstring[]
Array of domain IDs to filter byOptions:
Condition, Drug, Procedure, Measurement, Observation, etc.string[]
Array of concept class IDs to filter byExamples:
Clinical Finding, Pharmaceutical Substance, Procedureboolean
default:false
Whether to include only standard (
S) concepts. When omitted, concepts of
every standard status are eligible.boolean
default:true
Whether to include invalid/deprecated concepts. Set to
false to return only
currently valid concepts.boolean
default:true
Whether to include facet counts in the response. Set to
false when facet
data is not needed.boolean
default:false
Include published OMOP synonyms in candidate retrieval and match evidence.
string
default:"full_text"
Lexical retrieval mode. Semantic and hybrid search use their dedicated
endpoints and are not aliases of this option.
number
default:"0"
Minimum bounded lexical-evidence score. This threshold is evaluated before
clinical-utility ranking, so it removes weak text matches consistently rather
than excluding an entire Standard, Classification, or non-standard tier.
string
default:"relevance"
Result sort. Clinical ranking applies only to
relevance.string
default:"desc"
Sort direction.
array
Require each returned concept to satisfy every relationship filter in the
array. Filters are combined with AND, so every filter is required; there is
no To keep only source concepts that map to SNOMED, for example ICD10CM codes
with a standard SNOMED equivalent:
required field. Unknown relationship or vocabulary identifiers, and
any field not listed below, return 400. Vocabulary access policy is always
enforced on the concept at the other end of the relationship, including when
only target_concept_id is supplied.string
required
OMOP relationship identifier to require.
integer
Optional concept ID that the relationship must connect to.
string[]
Optional vocabulary IDs (1-20). The concept at the other end of the
relationship must belong to one of them. Combined with
target_concept_id,
both conditions apply to the same relationship. Restricted vocabularies return
403 unless your API key is licensed for them.string
Direction in which to evaluate the relationship.
forward matches the
returned concept as concept_id_1, reverse matches it as concept_id_2,
and both accepts either orientation. Defaults to forward.[
{
"relationship_id": "Maps to",
"target_concept_id": 201826,
"direction": "forward"
}
]
[
{
"relationship_id": "Maps to",
"target_vocabularies": ["SNOMED"]
}
]
object
Return concepts valid at any point in this inclusive date range. A concept
matches when its validity interval overlaps the requested interval; it does
not need to start and end within the range. Either bound may be omitted for
an open-ended range.
Show date_range properties
Show date_range properties
{
"start_date": "2020-01-01",
"end_date": "2024-12-31"
}
integer
default:"1"
Page number (1-based indexing)
integer
default:"20"
Number of results per page (max: 1000)
Response
boolean
Whether the request was successful
object
Show data
Show data
array
Array of matching concepts
Show concept object
Show concept object
integer
Unique concept identifier
string
Human-readable concept name
string
Concept code within its vocabulary
string
Source vocabulary identifier
string
Human-readable vocabulary name
string
Concept domain classification
string
Concept class within vocabulary
string
Standard concept designation (S = Standard, C = Classification)
string
Date when concept became valid
string
Date when concept becomes invalid
string
Reason for invalidity (if applicable)
number
Normalized effective relevance score in the range
[0, 1). For
relevance sorting, higher values always rank ahead of lower values.object
object
Facet completion status.
partial is true when any category failed, and failed_facets identifies the affected categories.
Responses use the API-wide Cache-Control: no-store client policy whether facets are complete or partial. Eligible complete responses may still use OMOPHub’s internal Redis cache.object
Response metadata including pagination
Show meta
Show meta
string
Unique identifier for this request
string
ISO 8601 timestamp of the response
string
Vocabulary release version used
object
Examples
Basic Search
curl -X POST "https://api.omophub.com/v1/search/advanced" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "diabetes mellitus type 2",
"page_size": 10
}'
results = client.search.advanced_search(
query="diabetes mellitus type 2",
page_size=10
)
for concept in results.data:
print(f"{concept.concept_id}: {concept.concept_name}")
print(f" Vocabulary: {concept.vocabulary_id}")
print(f" Score: {concept.search_score:.3f}")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data: results } = await client.search.advanced({
query: 'diabetes mellitus type 2',
pageSize: 10,
});
results?.forEach(concept => {
console.log(`${concept.concept_id}: ${concept.concept_name}`);
console.log(` Vocabulary: ${concept.vocabulary_id}`);
console.log(` Score: ${concept.search_score?.toFixed(3)}`);
});
results <- advanced_search_concepts(client,
query = "diabetes mellitus type 2",
page_size = 10
)
for (i in 1:nrow(results$data$concepts)) {
concept <- results$data$concepts[i, ]
cat(paste(concept$concept_id, concept$concept_name, sep = ": "), "\n")
cat(paste(" Vocabulary:", concept$vocabulary_id), "\n")
cat(paste(" Score:", round(concept$search_score, 3)), "\n")
}
{
"success": true,
"data": {
"concepts": [
{
"concept_id": 201826,
"concept_name": "Type 2 diabetes mellitus",
"concept_code": "44054006",
"vocabulary_id": "SNOMED",
"vocabulary_name": "Systematized Nomenclature of Medicine Clinical Terms",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "1970-01-01",
"valid_end_date": "2099-12-31",
"invalid_reason": null,
"search_score": 0.843
},
{
"concept_id": 435216,
"concept_name": "Diabetes mellitus type 2 in obese",
"concept_code": "E11.0",
"vocabulary_id": "ICD10CM",
"vocabulary_name": "International Classification of Diseases, Tenth Revision, Clinical Modification",
"domain_id": "Condition",
"concept_class_id": "4-char billing code",
"standard_concept": null,
"valid_start_date": "2015-10-01",
"valid_end_date": "2099-12-31",
"invalid_reason": null,
"search_score": 0.786
}
],
"facets": {
"vocabularies": [
{"vocabulary_id": "SNOMED", "vocabulary_name": "SNOMED CT", "count": 45},
{"vocabulary_id": "ICD10CM", "vocabulary_name": "ICD-10-CM", "count": 23},
{"vocabulary_id": "ICD9CM", "vocabulary_name": "ICD-9-CM", "count": 12}
],
"domains": [
{"domain_id": "Condition", "domain_name": "Condition", "count": 67},
{"domain_id": "Observation", "domain_name": "Observation", "count": 13}
],
"concept_classes": [
{"concept_class_id": "Clinical Finding", "concept_class_name": "Clinical Finding", "count": 45},
{"concept_class_id": "4-char billing code", "concept_class_name": "4-char billing code", "count": 23}
],
"years": [
{"year": 1970, "count": 45},
{"year": 2015, "count": 23}
]
},
"facet_status": {
"partial": false,
"failed_facets": []
},
"search_metadata": {
"query_time_ms": 127,
"total_results": 80,
"max_relevance_score": 10,
"search_algorithm": "full_text_with_ranking"
}
},
"meta": {
"request_id": "req_adv_search_abc123",
"timestamp": "2024-01-15T10:30:00Z",
"vocab_release": "2025.1",
"search": {
"query": "diabetes mellitus type 2",
"total_results": 80,
"filters_applied": {
"vocabulary_ids": [],
"domain_ids": [],
"standard_concepts_only": false,
"include_invalid": true
}
},
"pagination": {
"page": 1,
"page_size": 10,
"total_items": 80,
"total_pages": 8,
"has_next": true,
"has_previous": false
}
}
}
Filtered Search
curl -X POST "https://api.omophub.com/v1/search/advanced" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "hypertension",
"vocabulary_ids": ["SNOMED", "ICD10CM"],
"domain_ids": ["Condition"],
"standard_concepts_only": true,
"date_range": {
"start_date": "2020-01-01",
"end_date": "2024-12-31"
},
"page_size": 20
}'
results = client.search.advanced_search(
query="hypertension",
vocabulary_ids=["SNOMED", "ICD10CM"],
domain_ids=["Condition"],
standard_concepts_only=True,
date_range={
"start_date": "2020-01-01",
"end_date": "2024-12-31"
},
page_size=20
)
print(f"Found {results.meta.pagination.total_items} concepts")
print(f"Query executed in {results.data.search_metadata.query_time_ms}ms")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data: results, meta } = await client.search.advanced({
query: 'hypertension',
vocabularyIds: ['SNOMED', 'ICD10CM'],
domainIds: ['Condition'],
standardConceptsOnly: true,
dateRange: {
startDate: '2020-01-01',
endDate: '2024-12-31',
},
pageSize: 20,
});
console.log(`Found ${meta?.pagination?.total_items} concepts`);
results <- advanced_search_concepts(client,
query = "hypertension",
vocabulary_ids = c("SNOMED", "ICD10CM"),
domain_ids = c("Condition"),
standard_concepts_only = TRUE,
date_range = list(
start_date = "2020-01-01",
end_date = "2024-12-31"
),
page_size = 20
)
cat(paste("Found", results$meta$pagination$total_items, "concepts\n"))
cat(paste("Query executed in", results$data$search_metadata$query_time_ms, "ms\n"))
Complex Relationship Filtering
curl -X POST "https://api.omophub.com/v1/search/advanced" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "insulin",
"vocabulary_ids": ["RxNorm"],
"domain_ids": ["Drug"],
"relationship_filters": [
{
"relationship_id": "RxNorm has dose form",
"target_concept_id": 19127776,
"direction": "forward"
}
],
"concept_class_ids": ["Clinical Drug"],
"page_size": 15
}'
results = client.search.advanced_search(
query="insulin",
vocabulary_ids=["RxNorm"],
domain_ids=["Drug"],
relationship_filters=[
{
"relationship_id": "RxNorm has dose form",
"target_concept_id": 19127776,
"direction": "forward"
}
],
concept_class_ids=["Clinical Drug"],
page_size=15
)
for concept in results.data:
print(f"Drug: {concept.concept_name}")
print(f" Code: {concept.concept_code}")
print(f" Class: {concept.concept_class_id}")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data: results } = await client.search.advanced({
query: 'insulin',
vocabularyIds: ['RxNorm'],
domainIds: ['Drug'],
relationshipFilters: [
{
relationship_id: 'RxNorm has dose form',
target_concept_id: 19127776,
direction: 'forward',
},
],
conceptClassIds: ['Clinical Drug'],
pageSize: 15,
});
results.data.forEach(concept => {
console.log(`Drug: ${concept.concept_name}`);
console.log(` Code: ${concept.concept_code}`);
console.log(` Class: ${concept.concept_class_id}`);
});
results <- advanced_search_concepts(client,
query = "insulin",
vocabulary_ids = c("RxNorm"),
domain_ids = c("Drug"),
relationship_filters = list(
list(
relationship_id = "RxNorm has dose form",
target_concept_id = 19127776,
direction = "forward"
)
),
concept_class_ids = c("Clinical Drug"),
page_size = 15
)
for (i in 1:nrow(results$data$concepts)) {
concept <- results$data$concepts[i, ]
cat(paste("Drug:", concept$concept_name), "\n")
cat(paste(" Code:", concept$concept_code), "\n")
cat(paste(" Class:", concept$concept_class_id), "\n")
}
Search Features
Full-Text Search
- Multi-field search: Searches concept names, synonyms, and descriptions
- Phrase matching: Use quotes for exact phrases:
"myocardial infarction" - Wildcard support: Use
*for partial matching:diabet* - Boolean operators: Use AND, OR, NOT:
diabetes AND type 2
Relevance Scoring
search_score is the normalized form of the shared deterministic ranking
policy. Exact concept IDs and codes occupy the highest band. Text searches then
use non-overlapping clinical-utility bands (valid Standard, Classification,
valid non-standard, non-clinical artifact, invalid), with exact primary name,
exact published synonym, prefix/phrase, token/full-text, and fuzzy/substring
evidence ordered inside each band. Correlated text signals cannot cross a
utility or evidence boundary.
min_score is deliberately different: it filters the bounded lexical-evidence
component only. For example, 0.6 retains exact primary-name and exact synonym
evidence without treating a lower clinical-utility tier as insufficient merely
because it is lower utility.
Result Ordering
With the defaultsort_by=relevance, search_score is authoritative, followed
by deterministic core-clinical-domain, vocabulary-authority, name-length, name,
and concept_id tie-breaks. The same score and order are used by optimized and
fallback paths.
sort_by=name, code and date are honoured exactly as asked and are not
reordered by the policy.
Passing a demoted class in concept_class_ids turns its demotion off, the same
way it does on
/v1/search/concepts.
Faceted Search
Use facets to understand result distribution:# Access facets for filtering insights
facets = results.data.facets
print("Available vocabularies:")
for vocab in facets.vocabularies:
print(f" {vocab.vocabulary_name}: {vocab.count} concepts")
print("\nAvailable domains:")
for domain in facets.domains:
print(f" {domain.domain_name}: {domain.count} concepts")
Performance Tips
- Use specific vocabulary_ids: Limit search to relevant vocabularies only
- Filter by domain_ids: Reduce result set with domain filters
- Reasonable page sizes: Use page_size of 20-100 for best performance
- Cache results: Cache frequently accessed searches
- Use standard concepts: Set
standard_concepts_only: truefor faster queries - Avoid broad queries: Queries shorter than 3 characters, including an omitted query, require at least one
vocabulary_ids,domain_ids, orconcept_class_idsfilter.
Related Endpoints
Basic Search
Simple concept search with minimal parameters
Search Autocomplete
Real-time search suggestions
Similar Concepts
Find semantically similar concepts
Search Facets
Get available search facets
Was this page helpful?