pcornet_id() maps a source id to a 63-bit key. A collision silently merges two source rows, so the number of
distinct source ids must equal the number of distinct keys. check_key_collisions() verifies that for one source
column; check_etl_keys() runs it on the ids the PCORnet ETL turns into surrogate keys. R port of
omop_etl.key_checks.
Arguments
- con
A DuckDB DBI connection with the mapping macros loaded (see
load_mapping_macros()).- source
A table, view or
read_csv_auto(...)/read_parquet(...)relation expression.- id_column
Column holding the source id.
- key_expr
Key expression with a
{col}placeholder (default"pcornet_id({col})").- on_collision
"warn"(default),"raise"or"ignore".- source_dir
Directory of PCORnet source files.
- site_id, disambiguate_patids
As in
etl_pcornet();PATIDis checked only when both are set.
