diff --git a/omop_file_validator.py b/omop_file_validator.py index e3d9ce0..735f182 100644 --- a/omop_file_validator.py +++ b/omop_file_validator.py @@ -419,6 +419,8 @@ def run_checks(file_path, f): actual=value, expected=meta_column_type) result['errors'].append(e) + #only return the first error + break # Check if any nulls present in a required field if meta_column_required and df[submission_column].isnull( diff --git a/tests/resources/examples_erroneous/errors/results.csv b/tests/resources/examples_erroneous/errors/results.csv index a5ce278..bc52f02 100644 --- a/tests/resources/examples_erroneous/errors/results.csv +++ b/tests/resources/examples_erroneous/errors/results.csv @@ -21,6 +21,5 @@ "observation.csv","Observation","Type mismatch line number 5","observation_id","23.890+11","integer" "observation.csv","Observation","Invalid date format. Expecting ""YYYY-MM-DD"": line number 5","observation_date","01-31-1963","date" "observation.csv","Observation","Invalid timestamp format. Expecting ""YYYY-MM-DD HH:MM:SS[.SSSSSS]"": line number 1","observation_datetime","1989-10-07 22:13:11.1533266","timestamp" -"observation.csv","Observation","Invalid timestamp format. Expecting ""YYYY-MM-DD HH:MM:SS[.SSSSSS]"": line number 3","observation_datetime","1987-04-15 06:06:30.6260548","timestamp" -"observation.csv","Observation","Invalid timestamp format. Expecting ""YYYY-MM-DD HH:MM:SS[.SSSSSS]"": line number 5","observation_datetime","1983-05-13 15:31:52.3905384","timestamp" "observation.csv","Observation","Type mismatch line number 3","observation_type_concept_id","unknown","integer" +"visit_detail.csv","Visit Detail","NULL values are not allowed for column","visit_occurrence_id","","" diff --git a/tests/resources/examples_erroneous/errors/results.html b/tests/resources/examples_erroneous/errors/results.html index 5aaef74..0159f93 100644 --- a/tests/resources/examples_erroneous/errors/results.html +++ b/tests/resources/examples_erroneous/errors/results.html @@ -242,22 +242,6 @@
observation_datetime | -1987-04-15 06:06:30.6260548 | -timestamp | - -|||
observation.csv | -Observation | -Invalid timestamp format. Expecting "YYYY-MM-DD HH:MM:SS[.SSSSSS]": line number 5 | -observation_datetime | -1983-05-13 15:31:52.3905384 | -timestamp | -
observation.csv | Observation | @@ -266,6 +250,14 @@