{"id":27025913,"url":"https://github.com/mrueda/omop-csv-validator","last_synced_at":"2025-04-04T22:15:09.382Z","repository":{"id":284942945,"uuid":"956095793","full_name":"mrueda/omop-csv-validator","owner":"mrueda","description":"The OMOP CSV Validator is a CLI tool that validates CSV files against JSON schemas generated from OMOP Common Data Model (CDM) DDL fiiles","archived":false,"fork":false,"pushed_at":"2025-04-04T15:01:45.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T16:28:29.304Z","etag":null,"topics":["cnag","csv","csv-validator","json-validator","linux","ohdsi","omop-cdm","perl","postgresql","schema"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrueda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-27T17:32:47.000Z","updated_at":"2025-04-04T16:23:04.000Z","dependencies_parsed_at":"2025-03-28T14:31:09.215Z","dependency_job_id":"cd9636e3-915c-48d3-b025-b6e504f4c599","html_url":"https://github.com/mrueda/omop-csv-validator","commit_stats":null,"previous_names":["mrueda/omop-csv-validator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrueda%2Fomop-csv-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrueda%2Fomop-csv-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrueda%2Fomop-csv-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrueda%2Fomop-csv-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrueda","download_url":"https://codeload.github.com/mrueda/omop-csv-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256108,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnag","csv","csv-validator","json-validator","linux","ohdsi","omop-cdm","perl","postgresql","schema"],"created_at":"2025-04-04T22:15:08.607Z","updated_at":"2025-04-04T22:15:09.377Z","avatar_url":"https://github.com/mrueda.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Links\n\n**📦 CPAN Distribution:** \u003ca href=\"https://metacpan.org/pod/OMOP::CSV::Validator\" target=\"_blank\"\u003ehttps://metacpan.org/pod/OMOP::CSV::Validator\u003c/a\u003e\n\n# OMOP CSV Validator\n\nThe OMOP CSV Validator is a **CLI tool** (and module) that **validates OMOP CDM CSV files against their expected data types**. Rather than relying solely on `Types::Standard` or similar libraries, it converts SQL schemas derived from the OMOP Common Data Model (CDM) PostgreSQL DDL files into JSON schemas. It then utilizes `JSON::Validator`, which **scales efficiently with large datasets and provides meaningful error messages**.\n\n## Features\n\n- **DDL Parsing:** Automatically converts PostgreSQL OMOP CDM DDL into JSON schemas.\n- **Version Independent** Works with any DDL (e.g., 5.3, 5.4).\n- **CSV Validation:** Validates CSV files using JSON::Validator.\n- **Modular Design:** Separate CLI and module for easy testing and integration.\n\n## Installation\n\nThis project uses [cpanm](https://metacpan.org/pod/App::cpanminus) along with a `cpanfile` to manage dependencies. It is recommended to install dependencies locally using `local::lib`.\n\n### Step 1: Install cpanminus\n\nIf you don't have `cpanm` installed, run:\n\n```bash\nsudo apt-get install cpanminus\n```\n\nIf you don't have `gcc` compiler and other default Linux utils installed please do:\n\n```bash\nsudo apt-get install gcc make libperl-dev\n```\n\n### Step 2: Set Up local::lib\n\nConfigure a local library in your home directory. For example:\n\n```bash\ncpanm --local-lib=~/perl5 local::lib \u0026\u0026 eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)\n```\n\nThen, add this settings to your shell profile (e.g. `~/.bashrc` or `~/.zshrc`) so that your shell knows about your local library.\n\n```bash\necho 'eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)' \u003e\u003e ~/.bashrc\n```\n\n### Step 3: Download and installation:\n\n#### From CPAN\n\n```bash\ncpanm OMOP::CSV::Validator --no-test\n```\n\n#### From Github\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/mrueda/omop-csv-validator.git\ncd omop-csv-validator\n```\n\n2. Install Dependencies:\n\n```bash\ncpanm --notest --installdeps .\n```\n\nThis command reads the included `cpanfile` and installs all required dependencies into your local library directory.\n\n## Usage\n\n### Command-Line Interface\n\nOnce dependencies are installed, you can run the CLI tool as follows:\n\n(If you installed fron CPAN then you can simply run `omop-csv-validator`).\n\n```bash\nbin/omop-csv-validator --ddl path/to/OMOPCDM_ddl.sql --input path/to/data.csv --sep \",\"\n```\n\nWith the included `example` data:\n\n```bash\nbin/omop-csv-validator --ddl ddl/OMOPCDM_postgresql_5.4_ddl.sql -i example/DRUG_EXPOSURE.csv -sep $'\\t'\n```\n\n## Running Tests\n\nTo run the test suite, execute:\n\n```bash\nprove -l t/\n```\n\n## Utilities\n\n* `reorder-csv.pl`\n\nSee directory [utils](utils/README.md).\n\n## Author \n\nWritten by Manuel Rueda, PhD. Info about CNAG can be found at [https://www.cnag.eu](https://www.cnag.eu).\n\n## Contributing\n\nContributions, issues, and feature requests are welcome. Please check the [issues](https://github.com/yourusername/yourrepo/issues) page for details.\n\n## License\n\nThis project is released under the [Artistic License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrueda%2Fomop-csv-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrueda%2Fomop-csv-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrueda%2Fomop-csv-validator/lists"}