Skip to contents

Executes vectorized pure-SQL OHDSI DQD checks (conformance, completeness, plausibility, and temporal logic) directly in DuckDB and optionally writes standard OHDSI DQD JSON.

Usage

run_dqd(
  con,
  output_json = NULL,
  check_levels = c("TABLE", "FIELD", "CONCEPT", "TEMPORAL"),
  cdm_version = "5.4",
  plausible_date_range = c("1950-01-01", NA),
  date_fail_threshold_pct = 0,
  observation_period_min = "1900-01-02"
)

Arguments

con

Active DuckDB DBI connection.

output_json

Optional file path to write standard OHDSI DQD JSON.

check_levels

Character vector of check categories: "TABLE", "FIELD", "CONCEPT", "TEMPORAL".

cdm_version

Character CDM version (default "5.4").

plausible_date_range

c(lower, upper) for the FIELD-level plausibleDateRange check on every *_date column of the clinical tables; upper = NA means the extraction date. Default c("1950-01-01", NA), so a 1913 visit is flagged. Sites with a far-future sentinel (e.g. 2099-12-31) should pass an explicit upper bound.

date_fail_threshold_pct

The check fails when the violating share exceeds this percentage (default 0).

observation_period_min

Earliest plausible observation period start for plausibleObservationPeriod (default "1900-01-02").

Value

A list with Metadata, Overview, and CheckResults.