curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
concept_id = 201826 # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/relationships/options"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
print(f"Concept ID: {data['data']['concept_id']}")
print("Available relationship types:")
for rel in data['data']['available_relationships']:
print(f" - {rel['name']} ({rel['id']})")
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 RelationshipOptions {
concept_id: number;
available_relationships: Array<{ id: string; name: string }>;
}
const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<RelationshipOptions>(`/concepts/${conceptId}/relationships/options`);
console.log(`Concept ID: ${data?.concept_id}`);
console.log('Available relationships:');
data?.available_relationships.forEach(rel => {
console.log(` - ${rel.name} (${rel.id})`);
});
{
"success": true,
"data": {
"concept_id": 201826,
"available_relationships": [
{
"id": "Is a",
"name": "Is a"
},
{
"id": "Maps to",
"name": "Maps to"
},
{
"id": "Mapped from",
"name": "Mapped from"
},
{
"id": "Subsumes",
"name": "Subsumes"
}
]
},
"meta": {
"request_id": "req_relationship_options_123",
"timestamp": "2024-12-22T10:00:00Z",
"vocab_release": "2025.1"
}
}
Get Relationship Options
Get the list of available relationship types for a specific OMOP concept so you can filter, paginate, or traverse only the links you care about.
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
concept_id = 201826 # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/relationships/options"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
print(f"Concept ID: {data['data']['concept_id']}")
print("Available relationship types:")
for rel in data['data']['available_relationships']:
print(f" - {rel['name']} ({rel['id']})")
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 RelationshipOptions {
concept_id: number;
available_relationships: Array<{ id: string; name: string }>;
}
const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<RelationshipOptions>(`/concepts/${conceptId}/relationships/options`);
console.log(`Concept ID: ${data?.concept_id}`);
console.log('Available relationships:');
data?.available_relationships.forEach(rel => {
console.log(` - ${rel.name} (${rel.id})`);
});
{
"success": true,
"data": {
"concept_id": 201826,
"available_relationships": [
{
"id": "Is a",
"name": "Is a"
},
{
"id": "Maps to",
"name": "Maps to"
},
{
"id": "Mapped from",
"name": "Mapped from"
},
{
"id": "Subsumes",
"name": "Subsumes"
}
]
},
"meta": {
"request_id": "req_relationship_options_123",
"timestamp": "2024-12-22T10:00:00Z",
"vocab_release": "2025.1"
}
}
Overview
This endpoint returns all available relationship types that exist for a specific concept. This is useful for building dynamic UI components like dropdowns and understanding what relationships are available for a concept.Path Parameters
integer
required
The unique OMOP concept ID to get relationship options for
Query Parameters
string
Specific vocabulary release version (e.g., “2025.1”)
Response
boolean
required
Indicates whether the request was successful
object
required
object
required
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
concept_id = 201826 # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/relationships/options"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
print(f"Concept ID: {data['data']['concept_id']}")
print("Available relationship types:")
for rel in data['data']['available_relationships']:
print(f" - {rel['name']} ({rel['id']})")
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 RelationshipOptions {
concept_id: number;
available_relationships: Array<{ id: string; name: string }>;
}
const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<RelationshipOptions>(`/concepts/${conceptId}/relationships/options`);
console.log(`Concept ID: ${data?.concept_id}`);
console.log('Available relationships:');
data?.available_relationships.forEach(rel => {
console.log(` - ${rel.name} (${rel.id})`);
});
{
"success": true,
"data": {
"concept_id": 201826,
"available_relationships": [
{
"id": "Is a",
"name": "Is a"
},
{
"id": "Maps to",
"name": "Maps to"
},
{
"id": "Mapped from",
"name": "Mapped from"
},
{
"id": "Subsumes",
"name": "Subsumes"
}
]
},
"meta": {
"request_id": "req_relationship_options_123",
"timestamp": "2024-12-22T10:00:00Z",
"vocab_release": "2025.1"
}
}
Usage Examples
Basic Relationship Options
Get all available relationship types for a concept:curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
-H "Authorization: Bearer YOUR_API_KEY"
With Specific Vocabulary Version
Get relationship options for a specific vocabulary release:curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options?vocab_release=2025.1" \
-H "Authorization: Bearer YOUR_API_KEY"
UI Dropdown Integration
Use in a dropdown component:TypeScript
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
interface RelOption { id: string; name: string }
async function loadRelationshipOptions(conceptId: number) {
const { data } = await client.get<{ available_relationships: RelOption[] }>(
`/concepts/${conceptId}/relationships/options`,
);
return data?.available_relationships.map(rel => ({
value: rel.id,
label: rel.name,
})) ?? [];
}
// Use in UI
const options = await loadRelationshipOptions(201826);
const selectHtml = options.map(opt =>
`<option value="${opt.value}">${opt.label}</option>`
).join('');
Important Notes
- Dynamic options - Available relationship types vary by concept
- Both directions - Returns relationships where the concept is either source or target
- Valid only - Only returns relationships with valid (non-deprecated) status
Related Endpoints
- Get Concept Relationships - Get actual relationships for a concept
- Get Relationship Types - Get all relationship types in the system
Was this page helpful?