Skip to contents

Quantifies the share of records captured by the supplied code list, and identifies high-frequency omitted concepts (accounting for at least min_share of domain rows) that may cause silent under-coverage across hospital sites.

Usage

audit_code_list_coverage(
  con,
  domain,
  supplied_codes,
  concept_set_or_ancestors = NULL,
  table_name = NULL,
  by_site = TRUE,
  site_col = "site",
  min_share = 0.01
)

Arguments

con

Active DuckDB DBI connection.

domain

Clinical domain ('condition', 'drug', 'measurement', 'procedure').

supplied_codes

Character or integer vector of concept codes (ICD/RxNorm/LOINC strings) or concept IDs.

concept_set_or_ancestors

Optional integer vector of ancestor concept IDs defining the broad domain scope.

table_name

Optional custom table or view name override.

by_site

Whether to stratify results by hospital site (default TRUE).

site_col

Column name representing site (default 'site').

min_share

Minimum proportion of uncaptured rows (default 0.01 = 1 percent) to flag as an omission.

Value

A data frame with columns: site, total_rows, covered_rows, coverage_share, omitted_concept_id, omitted_code, omitted_concept_name, omitted_rows, omitted_share, flagged, reason.