Generates HTML reports from OMOP CDM delivery metrics and data quality results. Part of the Connect for Cancer Prevention EHR data/OMOP pipeline.
This package operates downstream in the processing pipeline:
- ccc-omop-file-processor - Processes OMOP files, performs vocabulary harmonization, outputs
delivery_report.csv - DataQualityDashboard - Runs quality checks (via ccc-omop-analyzer), outputs
dqd_results.csv - omopDeliveryReport (this package) - Combines both CSVs into HTML report
remotes::install_github("Analyticsphere/omopDeliveryReport")Sample input files and a rendered report are available in inst/ref/.
library(omopDeliveryReport)
# Local file system
generate_omop_report(
delivery_report_path = "inst/ref/delivery_report.csv", # Sample data in package
dqd_results_path = "inst/ref/dqd_results.csv", # Sample data in package
output_path = "~/Desktop/example_omop_report.html"
)
# Files in GCS
generate_omop_report(
delivery_report_path = "gs://bucket/delivery_report.csv",
dqd_results_path = "gs://bucket/dqd_results.csv",
output_path = "gs://bucket/report.html"
)Generated by ccc-omop-file-processor via /generate_delivery_report endpoint.
Contents:
- Table row counts (initial, invalid, harmonized, final)
- Vocabulary harmonization statistics
- Domain migration flows
- Type concept breakdowns
- Time series data
- Reference integrity results
Standard output from OHDSI DataQualityDashboard. Contains check results, failure counts, and check metadata organized by table, field, and check category.
Processing Pipeline:
Load CSV → Parse Metrics → Calculate Scores → Build HTML → Write Output
The package combines two CSV files (delivery metrics and DQD results) into a single interactive HTML report. Each R module handles one stage of the processing pipeline. Parsers extract metrics using regex patterns, calculators compute scores, and builders assemble HTML from templates using {{variable}} substitution. Works with both local files and Google Cloud Storage.
Package Structure:
R/
├── generate_report.R - Main entry point
├── data_loaders.R - CSV loading & schema validation
├── data_parsers.R - Metric extraction
├── metrics.R - Score calculations
├── data_preparation.R - Data aggregation for display
├── report_builder.R - HTML and JSON assembly
├── template_renderer.R - Template variable substitution
├── constants.R - Package constants
└── utils.R - File I/O and helper functions
inst/
├── ref/ - Sample files
├── css/ - Report styling
├── js/ - Interactive features
└── templates/
├── main.html - Main report template
├── sections/ - Section templates
└── components/ - Reusable HTML components