Skip to main content

List All Vocabularies

Get a paginated list of all available medical vocabularies:
# Basic list
result <- client$vocabularies$list()
for (vocab in result$data$vocabularies) {
  cat(sprintf("%s: %s\n", vocab$vocabulary_id, vocab$vocabulary_name))
}

# Include statistics
result <- client$vocabularies$list(include_stats = TRUE)
for (vocab in result$data$vocabularies) {
  cat(sprintf("%s: %s concepts\n", vocab$vocabulary_id, vocab$concept_count))
}

# Custom sorting and pagination
result <- client$vocabularies$list(
  sort_by = "name",
  sort_order = "asc",
  page = 1,
  page_size = 50
)

Parameters

ParameterTypeDefaultDescription
include_statslogicalFALSEInclude vocabulary statistics
include_inactivelogicalFALSEInclude inactive vocabularies
sort_bycharacter”name”Sort field (“name”, “priority”, “updated”)
sort_ordercharacter”asc”Sort order (“asc”, “desc”)
pageinteger1Page number
page_sizeinteger100Results per page (max 1000)

Get Vocabulary Details

Get detailed information about a specific vocabulary:
vocab <- client$vocabularies$get("SNOMED")
cat(sprintf("Name: %s\n", vocab$data$vocabulary_name))
cat(sprintf("Version: %s\n", vocab$data$vocabulary_version))
cat(sprintf("Reference: %s\n", vocab$data$vocabulary_reference))

Parameters

ParameterTypeDefaultDescription
vocabulary_idcharacterrequiredVocabulary identifier (e.g., “SNOMED”, “ICD10CM”)

Response Fields

Returns vocabulary_id, vocabulary_name, vocabulary_reference, vocabulary_version, vocabulary_concept_id. For detailed statistics, use client$vocabularies$stats(vocabulary_id).

Get Vocabulary Statistics

Get statistical information about a vocabulary:
stats <- client$vocabularies$stats("SNOMED")
cat(sprintf("Total concepts: %d\n", stats$total_concepts))
cat(sprintf("Standard concepts: %d\n", stats$standard_concepts))

Get Domain Statistics

Get statistics for a specific domain within a vocabulary:
result <- client$vocabularies$domain_stats("SNOMED", "Condition")
cat(sprintf("Total concepts: %d\n", result$data$total_concepts))
cat(sprintf("Standard concepts: %d\n", result$data$standard_concepts))

# View concept class breakdown
for (cls in result$data$concept_classes) {
  cat(sprintf("%s: %d concepts\n", cls$concept_class_id, cls$concept_count))
}

Parameters

ParameterTypeDefaultDescription
vocabulary_idcharacterrequiredVocabulary identifier (e.g., “SNOMED”, “ICD10CM”)
domain_idcharacterrequiredDomain identifier (e.g., “Condition”, “Drug”, “Procedure”)

Get Vocabulary Domains

Get all standard OHDSI domains:
result <- client$vocabularies$domains()
for (domain in result$data$domains) {
  cat(sprintf("%s: %s\n", domain$domain_id, domain$domain_name))
}
Returns all available domains with domain_id, domain_name, and description.

Get Concept Classes

Get all available concept classes:
result <- client$vocabularies$concept_classes()
for (cls in result$data) {
  cat(sprintf("%s: %s\n", cls$concept_class_id, cls$concept_class_name))
}
Returns concept classes with concept_class_id, concept_class_name, and concept_class_concept_id.

Get Vocabulary Concepts

Retrieve concepts within a specific vocabulary with filtering and pagination:
# Basic usage
result <- client$vocabularies$concepts("SNOMED", page_size = 100)
for (concept in result$data$concepts) {
  cat(sprintf("%s (%d)\n", concept$concept_name, concept$concept_id))
}

# Search within vocabulary
result <- client$vocabularies$concepts(
  "SNOMED",
  search = "diabetes",
  standard_concept = "S",
  page_size = 50
)

# Include additional data
result <- client$vocabularies$concepts(
  "SNOMED",
  search = "hypertension",
  include_relationships = TRUE,
  include_synonyms = TRUE
)

# With sorting
result <- client$vocabularies$concepts(
  "RxNorm",
  sort_by = "concept_id",
  sort_order = "desc",
  page_size = 100
)

# Include invalid/deprecated concepts
result <- client$vocabularies$concepts(
  "ICD10CM",
  include_invalid = TRUE,
  page = 1,
  page_size = 50
)

# Pagination
cat(sprintf("Page %d of %d\n",
  result$meta$pagination$page,
  result$meta$pagination$total_pages
))
cat(sprintf("Total: %d concepts\n", result$meta$pagination$total_items))

Parameters

ParameterTypeDefaultDescription
vocabulary_idcharacterrequiredVocabulary identifier (e.g., “SNOMED”, “ICD10CM”)
searchcharacterNULLSearch term to filter concepts by name or code
standard_conceptcharacter”all”Filter by standard concept status (“S”, “C”, “all”)
include_invalidlogicalFALSEInclude invalid or deprecated concepts
include_relationshipslogicalFALSEInclude concept relationships in response
include_synonymslogicalFALSEInclude concept synonyms in response
sort_bycharacter”name”Sort field (“name”, “concept_id”, “concept_code”)
sort_ordercharacter”asc”Sort order (“asc”, “desc”)
pageinteger1Page number
page_sizeinteger20Results per page (max 1000)