R6 class for interacting with the OMOPHub vocabulary service. Provides access to OHDSI ATHENA standardized medical vocabularies.
Details
The client provides access to these resources:
concepts: Concept lookup and batch operationssearch: Basic and advanced concept searchvocabularies: Vocabulary listing and detailsdomains: Domain listing and concept filteringhierarchy: Ancestor and descendant navigationrelationships: Concept relationshipsmappings: Concept mappings between vocabularies
Active bindings
conceptsAccess to concept operations.
searchAccess to search operations.
vocabulariesAccess to vocabulary operations.
domainsAccess to domain operations.
hierarchyAccess to hierarchy operations.
relationshipsAccess to relationship operations.
mappingsAccess to mapping operations.
Methods
Method new()
Create a new OMOPHub client.
Usage
OMOPHubClient$new(
api_key = NULL,
base_url = NULL,
timeout = 30,
max_retries = 3,
vocab_version = NULL
)Arguments
api_keyAPI key for authentication. If not provided, reads from
OMOPHUB_API_KEYenvironment variable or system keyring.base_urlAPI base URL. Defaults to
https://api.omophub.com/v1.timeoutRequest timeout in seconds. Defaults to 30.
max_retriesMaximum retry attempts for failed requests. Defaults to 3.
vocab_versionOptional vocabulary version (e.g., "2025.1"). If not specified, uses the latest version.
Examples
if (FALSE) { # \dontrun{
# Create client (uses OMOPHUB_API_KEY env var)
client <- OMOPHubClient$new()
# Or with explicit API key
client <- OMOPHubClient$new(api_key = "your_api_key")
# Search for concepts
results <- client$search$basic("diabetes")
# Get a specific concept
concept <- client$concepts$get(201826)
# Use specific vocabulary version
client <- OMOPHubClient$new(vocab_version = "2025.1")
} # }