Some fields like ncumul_tested are supposed to be cummulative. Add a simple validation to check if this number is either the same or greater than the previous number or empty.
Something like this?
https://github.com/gaberoo/covid_19/blob/validate_cumul/scripts/validate_csv.rb
The script checks all fields that start with ncumul for inconsistencies, i.e. the subsequent number is smaller than the previous one.
❯ ruby scripts/validate_csv.rb scripts/validate_csv_test.csv
Error on line 1, canton BS, field ncumul_conf: 9 < 10
Yes that looks good.
But unfortunately not all fields starting with ncumul are _actually_ cummulative (see README for details). Can you create a PR with the updated script?
I'm anyways working on a "validation" workflow, so I'll include that there.
Gotcha. I’ll look into this in a bit.
So the cummulative fields are:
ncumul_testedncumul_confncumul_releasedncumul_deceased
Most helpful comment
Yes that looks good.
But unfortunately not all fields starting with
ncumulare _actually_ cummulative (see README for details). Can you create a PR with the updated script?I'm anyways working on a "validation" workflow, so I'll include that there.