curl -G "https://api.omophub.com/v1/concepts/201826/relationships" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "relationship_ids=Is a,Maps to" \
--data-urlencode "page_size=50"
import requests
concept_id = 201826
url = f"https://api.omophub.com/v1/concepts/{concept_id}/relationships"
params = {
"relationship_ids": "Is a,Maps to",
"vocabulary_ids": "SNOMED",
"page_size": 50
}
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(f"Total relationships: {data['meta']['pagination']['total_items']}")
for rel in data['data']['relationships']:
print(f" {rel['relationship_id']}: {rel['concept_2']['concept_name']}")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data, meta } = await client.relationships.get(201826, {
relationshipIds: ['Is a', 'Maps to'],
pageSize: 50,
});
console.log(`Found ${meta?.pagination?.total_items} relationships`);
{
"success": true,
"data": {
"relationships": [
{
"concept_id_1": 201826,
"concept_id_2": 73211009,
"relationship_id": "Is a",
"relationship_name": "Is a",
"reverse_relationship_id": "Subsumes",
"concept_1": {
"concept_id": 201826,
"concept_name": "Type 2 diabetes mellitus",
"concept_code": "44054006",
"vocabulary_id": "SNOMED",
"vocabulary_name": "SNOMED",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
},
"concept_2": {
"concept_id": 73211009,
"concept_name": "Diabetes mellitus",
"concept_code": "73211009",
"vocabulary_id": "SNOMED",
"vocabulary_name": "SNOMED",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
},
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
}
]
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2025-01-04T10:30:00Z",
"vocab_release": "2025.1",
"version": "2025.1",
"duration": 45,
"pagination": {
"page": 1,
"page_size": 100,
"total_items": 47,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}
}
List Relationships for a Concept
Retrieve all relationships for a specific OMOP concept - Maps to, Is a, ingredient of, and vocabulary-specific links for crosswalk analysis.
curl -G "https://api.omophub.com/v1/concepts/201826/relationships" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "relationship_ids=Is a,Maps to" \
--data-urlencode "page_size=50"
import requests
concept_id = 201826
url = f"https://api.omophub.com/v1/concepts/{concept_id}/relationships"
params = {
"relationship_ids": "Is a,Maps to",
"vocabulary_ids": "SNOMED",
"page_size": 50
}
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(f"Total relationships: {data['meta']['pagination']['total_items']}")
for rel in data['data']['relationships']:
print(f" {rel['relationship_id']}: {rel['concept_2']['concept_name']}")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data, meta } = await client.relationships.get(201826, {
relationshipIds: ['Is a', 'Maps to'],
pageSize: 50,
});
console.log(`Found ${meta?.pagination?.total_items} relationships`);
{
"success": true,
"data": {
"relationships": [
{
"concept_id_1": 201826,
"concept_id_2": 73211009,
"relationship_id": "Is a",
"relationship_name": "Is a",
"reverse_relationship_id": "Subsumes",
"concept_1": {
"concept_id": 201826,
"concept_name": "Type 2 diabetes mellitus",
"concept_code": "44054006",
"vocabulary_id": "SNOMED",
"vocabulary_name": "SNOMED",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
},
"concept_2": {
"concept_id": 73211009,
"concept_name": "Diabetes mellitus",
"concept_code": "73211009",
"vocabulary_id": "SNOMED",
"vocabulary_name": "SNOMED",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
},
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
}
]
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2025-01-04T10:30:00Z",
"vocab_release": "2025.1",
"version": "2025.1",
"duration": 45,
"pagination": {
"page": 1,
"page_size": 100,
"total_items": 47,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}
}
This endpoint provides relationship information for a concept, showing how it connects to other concepts through various relationship types such as “Is a”, “Part of”, “Has ingredient”, and others in medical vocabularies.
Path Parameters
integer
required
The unique identifier of the concept to retrieve relationships for
Example:
Example:
201826 (Type 2 diabetes mellitus)Query Parameters
string
Comma-separated list of relationship IDs to filter by
Example:
Example:
Is a,Maps to,Has finding sitestring
Filter by the vocabulary of
Example:
concept_2, the target/related conceptExample:
SNOMED,ICD10CM,RxNormstring
Filter by the domain of
Example:
concept_2, the target/related conceptExample:
Condition,Drug,Procedureboolean
default:"false"
Only return relationships to standard concepts
boolean
default:"false"
Include relationships to deprecated/invalid concepts
boolean
default:"false"
Include reverse relationships (where this concept is concept_id_2)
integer
default:"1"
Page number for pagination (1-based)
integer
default:"100"
Number of relationships to return per page. Values above 200 are clamped to
200.
string
Specific vocabulary release version
Example:
Example:
2025.1Response
boolean
Whether relationship retrieval completed.
object
Source concept, relationships, and summary.
array
Array of relationship objects
Show Relationship Object
Show Relationship Object
integer
Source-side concept ID from the stored relationship. When
include_reverse=true, the queried concept can instead be concept_id_2.integer
Target-side concept ID from the stored relationship. When
include_reverse=true, this can be the queried concept.string
Relationship type identifier (e.g., “Is a”, “Maps to”)
string
Display name of the relationship
string
Reverse relationship identifier (e.g., “Subsumes” for “Is a”)
object
Full details of the source concept
Show Concept Object
Show Concept Object
integer
Concept identifier
string
Concept name
string
Original vocabulary code
string
Vocabulary identifier
string
Vocabulary display name
string
Domain classification
string
Concept class
string
Standard concept flag (S, C, or null)
string
Validity start date
string
Validity end date
string
Reason if invalid (null if valid)
object
Full details of the target concept
Show Target Concept Object
Show Target Concept Object
integer
Concept identifier
string
Concept name
string
Original vocabulary code
string
Vocabulary identifier
string
Vocabulary display name
string
Domain classification
string
Concept class
string | null
Standard concept flag
string
Validity start date
string
Validity end date
string | null
Invalidity marker, or null
string
Date when relationship became valid
string
Date when relationship becomes invalid
string
Reason if relationship is invalid (null if valid)
object
Response metadata including pagination
Show Metadata Object
Show Metadata Object
object
string
Unique request identifier
string
Request timestamp
string
Vocabulary release version used
string
Vocabulary version alias used by the request
integer
Request processing time in milliseconds
curl -G "https://api.omophub.com/v1/concepts/201826/relationships" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "relationship_ids=Is a,Maps to" \
--data-urlencode "page_size=50"
import requests
concept_id = 201826
url = f"https://api.omophub.com/v1/concepts/{concept_id}/relationships"
params = {
"relationship_ids": "Is a,Maps to",
"vocabulary_ids": "SNOMED",
"page_size": 50
}
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(f"Total relationships: {data['meta']['pagination']['total_items']}")
for rel in data['data']['relationships']:
print(f" {rel['relationship_id']}: {rel['concept_2']['concept_name']}")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data, meta } = await client.relationships.get(201826, {
relationshipIds: ['Is a', 'Maps to'],
pageSize: 50,
});
console.log(`Found ${meta?.pagination?.total_items} relationships`);
{
"success": true,
"data": {
"relationships": [
{
"concept_id_1": 201826,
"concept_id_2": 73211009,
"relationship_id": "Is a",
"relationship_name": "Is a",
"reverse_relationship_id": "Subsumes",
"concept_1": {
"concept_id": 201826,
"concept_name": "Type 2 diabetes mellitus",
"concept_code": "44054006",
"vocabulary_id": "SNOMED",
"vocabulary_name": "SNOMED",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
},
"concept_2": {
"concept_id": 73211009,
"concept_name": "Diabetes mellitus",
"concept_code": "73211009",
"vocabulary_id": "SNOMED",
"vocabulary_name": "SNOMED",
"domain_id": "Condition",
"concept_class_id": "Clinical Finding",
"standard_concept": "S",
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
},
"valid_start_date": "2002-01-31",
"valid_end_date": "2099-12-31",
"invalid_reason": null
}
]
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2025-01-04T10:30:00Z",
"vocab_release": "2025.1",
"version": "2025.1",
"duration": 45,
"pagination": {
"page": 1,
"page_size": 100,
"total_items": 47,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}
}
Usage Examples
All Relationships
Get all relationships for a concept:curl "https://api.omophub.com/v1/concepts/201826/relationships" \
-H "Authorization: Bearer YOUR_API_KEY"
Hierarchical Relationships Only
Retrieve only “Is a” relationships:curl "https://api.omophub.com/v1/concepts/201826/relationships?relationship_ids=Is%20a" \
-H "Authorization: Bearer YOUR_API_KEY"
Cross-Vocabulary Mappings
Find mappings to ICD-10:curl "https://api.omophub.com/v1/concepts/201826/relationships?relationship_ids=Maps%20to&vocabulary_ids=ICD10CM" \
-H "Authorization: Bearer YOUR_API_KEY"
Including Reverse Relationships
Include relationships where this concept is the target:curl "https://api.omophub.com/v1/concepts/201826/relationships?include_reverse=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Related Endpoints
- Get Relationship Types - Available relationship types
- Get Concept Ancestors - Hierarchical parent relationships
- Get Concept Descendants - Hierarchical child relationships
- Get Concept Mappings - Cross-vocabulary mappings
Notes
- Relationship rows have stored source and target sides. Use
include_reverse=trueto include rows where the queried concept isconcept_id_2as well asconcept_id_1. - Invalid relationships and concepts are excluded by default; use
include_invalid=trueto include them. - Standard concepts are not filtered by default; use
standard_only=trueto filter - Large concepts may have hundreds of relationships - use pagination appropriately
- The response includes full concept details for both source and target concepts
Was this page helpful?