OMOP CSV Validator
OMOP CSV Validator checks OMOP CDM CSV files before they are loaded into a database.
Use it during ETL development and testing to find invalid exports before they reach PostgreSQL.
The validator derives its rules from OMOP PostgreSQL DDL and processes the CSV row by row. It does not load the full file into memory.
What it is for
- checking whether a CSV matches DDL-derived columns and types before database ingestion
- finding invalid rows before loading the export
- printing terminal or JSON results and generating optional TSV or XLSX reports
- using the same validation logic from a CLI or from Perl code
Core workflow
The validator works in four steps:
- read PostgreSQL DDL containing
CREATE TABLEstatements - derive a schema for each OMOP table
- stream through the CSV and validate each row against the selected table schema
- report issues before the file reaches PostgreSQL
Included commands and module
bin/omop-csv-validator: command-line validatorlib/OMOP/CSV/Validator.pm: Perl moduleutils/reorder-csv.pl: reorders CSV columns to match DDL order
Requirements and limits
- The DDL must use PostgreSQL-style
CREATE TABLEstatements. - The CSV filename must identify its OMOP table unless
--tableis supplied. - Each command validates one CSV file against one OMOP table.
Known limitations are described in Troubleshooting.