Generates a comprehensive HTML report for analyzing OMOP concept hierarchies and code counts. The report includes interactive visualizations, tables, and graphs showing concept relationships, stratified counts, and mappings based on the provided parameters.

createReport(
  conceptId,
  CDMdbHandler,
  showsMappings = FALSE,
  pruneLevels = 0L,
  pruneClass = ""
)

Arguments

conceptId

An integer or vector of integers representing OMOP concept IDs to analyze. The report will focus on these concepts and their hierarchical relationships.

CDMdbHandler

A CDMdbHandler object containing database connection details and schema information.

showsMappings

Logical indicating whether to display concept mappings in visualizations. Defaults to FALSE. When TRUE, additional mapping information is included in graphs and tables.

pruneLevels

Integer vector specifying which hierarchical levels to include in the analysis. NULL includes all levels. Values represent the depth from the root concept (0 = root, 1 = first level, etc.).

pruneClass

Character string specifying a concept class to filter results. NULL includes all concept classes. Common values include "Ingredient", "Clinical Drug", etc.

Value

A character string containing the file path to the generated HTML report. The file is created as a temporary file and should be cleaned up by the caller.

Details

This function creates a comprehensive report by:

  • Retrieving code counts and concept relationships using getCodeCounts_memoise

  • Optionally pruning results based on hierarchical levels and concept classes

  • Generating interactive Mermaid diagrams showing concept hierarchies

  • Creating detailed tables with stratified code counts

  • Producing visualizations with concept relationships and mappings

The report template includes:

  • Dynamic title showing concept ID and parameters

  • Interactive Mermaid graph visualization

  • Comprehensive data tables

  • Statistical plots and charts