Retrieves code counts and concept relationships for specified concept IDs from an OMOP CDM database. This function fetches parent concepts, descendant concepts, and mapped concepts, along with their associated event counts.

getCodeCounts(CDMdbHandler, conceptId, codeCountsTable = "code_counts")

Arguments

CDMdbHandler

A CDMdbHandler object that contains database connection details

conceptId

The concept ID to get counts and relationships for

codeCountsTable

Name of the code counts table in the results schema. Defaults to "code_counts"

Value

A list containing:

  • concept_relationships - Tibble of concept relationships including 'Maps to', 'Mapped from', 'Parent', and descendant relationships

  • concepts - Tibble of concept details for related concepts

  • code_counts - Tibble of code counts from the code_counts table

Examples

if (FALSE) { # \dontrun{
# Get code counts for specific concept IDs
result <- getCodeCounts(CDMdbHandler, conceptId = 317009)

# View concept relationships
print(result$concept_relationships)
} # }