NAME
OMOP::CSV::Validator - Validates OMOP CDM CSV files against their expected data types
SYNOPSIS
use
OMOP::CSV::Validator;
my
$validator
= OMOP::CSV::Validator->new();
# Load schemas from DDL
my
$schemas
=
$validator
->load_schemas_from_ddl(
$ddl_text
);
# Retrieve specific table schema for a CSV file
my
$schema
=
$validator
->get_schema_from_csv_filename(
$csv_file
,
$schemas
);
# Validate CSV file
my
$errors
=
$validator
->validate_csv_file(
$csv_file
,
$schema
);
if
(
@$errors
) {
"Validation errors found:\n"
;
for
my
$err_info
(
@$errors
) {
"Row $err_info->{row}:\n"
;
for
my
$e
(@{
$err_info
->{errors} }) {
" $e\n"
;
}
}
}
else
{
"CSV is valid.\n"
;
}
DESCRIPTION
OMOP::CSV::Validator is a CLI tool and Perl module designed to validate OMOP Common Data Model (CDM) CSV files. It auto-generates JSON schemas from PostgreSQL DDL files and then validates CSV rows against those schemas.
METHODS
AUTHOR
Written by Manuel Rueda, PhD. Info about CNAG can be found at https://www.cnag.eu.
LICENSE
This module is free software; you may redistribute it and/or modify it under the same terms as Perl itself.