curl -X GET "https://api.omophub.com/v1/concepts/201826/level" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
concept_id = 201826 # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/level"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
level_info = data['data']
print(f"Concept ID: {level_info['concept_id']}")
print(f"Depth from root: {level_info['depth_from_root']}")
print(f"Total ancestors: {level_info['total_ancestors']}")
print(f"Total descendants: {level_info['total_descendants']}")
import { OMOPHub } from '@omophub/omophub-node';
// Not yet exposed as a dedicated SDK method - use the typed low-level helper.
const client = new OMOPHub();
interface ConceptLevel {
concept_id: number;
depth_from_root: number;
total_ancestors: number;
total_descendants: number;
}
const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<ConceptLevel>(`/concepts/${conceptId}/level`);
console.log(`Concept ID: ${data?.concept_id}`);
console.log(`Depth from root: ${data?.depth_from_root}`);
console.log(`Total ancestors: ${data?.total_ancestors}`);
console.log(`Total descendants: ${data?.total_descendants}`);
{
"success": true,
"data": {
"concept_id": 201826,
"level": 0,
"depth_from_root": 4,
"breadth_at_level": null,
"total_descendants": 15,
"total_ancestors": 3
},
"meta": {
"request_id": "req_concept_level_123",
"timestamp": "2024-12-22T10:00:00Z",
"vocab_release": "2025.1"
}
}
Get Concept Level
Get the hierarchical level and depth of an OMOP concept within its vocabulary tree for quick classification and hierarchy-aware filtering.
curl -X GET "https://api.omophub.com/v1/concepts/201826/level" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
concept_id = 201826 # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/level"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
level_info = data['data']
print(f"Concept ID: {level_info['concept_id']}")
print(f"Depth from root: {level_info['depth_from_root']}")
print(f"Total ancestors: {level_info['total_ancestors']}")
print(f"Total descendants: {level_info['total_descendants']}")
import { OMOPHub } from '@omophub/omophub-node';
// Not yet exposed as a dedicated SDK method - use the typed low-level helper.
const client = new OMOPHub();
interface ConceptLevel {
concept_id: number;
depth_from_root: number;
total_ancestors: number;
total_descendants: number;
}
const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<ConceptLevel>(`/concepts/${conceptId}/level`);
console.log(`Concept ID: ${data?.concept_id}`);
console.log(`Depth from root: ${data?.depth_from_root}`);
console.log(`Total ancestors: ${data?.total_ancestors}`);
console.log(`Total descendants: ${data?.total_descendants}`);
{
"success": true,
"data": {
"concept_id": 201826,
"level": 0,
"depth_from_root": 4,
"breadth_at_level": null,
"total_descendants": 15,
"total_ancestors": 3
},
"meta": {
"request_id": "req_concept_level_123",
"timestamp": "2024-12-22T10:00:00Z",
"vocab_release": "2025.1"
}
}
Overview
This endpoint returns basic hierarchical positioning information for a concept, including its depth from root concepts and counts of ancestors and descendants.Path Parameters
Query Parameters
Response
Response data containing concept level information
Show data
Show data
curl -X GET "https://api.omophub.com/v1/concepts/201826/level" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
concept_id = 201826 # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/level"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
level_info = data['data']
print(f"Concept ID: {level_info['concept_id']}")
print(f"Depth from root: {level_info['depth_from_root']}")
print(f"Total ancestors: {level_info['total_ancestors']}")
print(f"Total descendants: {level_info['total_descendants']}")
import { OMOPHub } from '@omophub/omophub-node';
// Not yet exposed as a dedicated SDK method - use the typed low-level helper.
const client = new OMOPHub();
interface ConceptLevel {
concept_id: number;
depth_from_root: number;
total_ancestors: number;
total_descendants: number;
}
const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<ConceptLevel>(`/concepts/${conceptId}/level`);
console.log(`Concept ID: ${data?.concept_id}`);
console.log(`Depth from root: ${data?.depth_from_root}`);
console.log(`Total ancestors: ${data?.total_ancestors}`);
console.log(`Total descendants: ${data?.total_descendants}`);
{
"success": true,
"data": {
"concept_id": 201826,
"level": 0,
"depth_from_root": 4,
"breadth_at_level": null,
"total_descendants": 15,
"total_ancestors": 3
},
"meta": {
"request_id": "req_concept_level_123",
"timestamp": "2024-12-22T10:00:00Z",
"vocab_release": "2025.1"
}
}
Usage Examples
Basic Level Information
Get hierarchy level for a concept:curl -X GET "https://api.omophub.com/v1/concepts/201826/level" \
-H "Authorization: Bearer YOUR_API_KEY"
With Specific Vocabulary Version
Get level information for a specific vocabulary release:curl -X GET "https://api.omophub.com/v1/concepts/201826/level?vocab_release=2025.1" \
-H "Authorization: Bearer YOUR_API_KEY"
Important Notes
- Depth interpretation -
depth_from_rootindicates how many “Is a” relationship steps exist between this concept and the root - Descendant count -
total_descendantsincludes all child concepts at any depth below - Ancestor count -
total_ancestorsincludes all parent concepts up to the root
Related Endpoints
- Get Concept Hierarchy - Full hierarchical tree
- Get Concept Ancestors - Parent concepts
- Get Concept Descendants - Child concepts
Was this page helpful?