CAVaccineInventory / vial

The Django application powering calltheshots.us

Home Page:https://vial.calltheshots.us

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

12 counties have ambiguous names within their states

simonw opened this issue · comments

https://vial.calltheshots.us/dashboard/?sql=select+state.name%2C+county.name%2C+array_agg%28county.fips_code%29+as+fips_codes%0D%0Afrom+county+join+state+on+county.state_id+%3D+state.id%0D%0Agroup+by+state.name%2C+county.name%0D%0Ahaving+count%28%2A%29+%3E+1%3Ak94rzQGQ5ELnnfeLaOio1Xrc80mEjxGRu420iTOUGnY

name	name	fips_codes
Maryland	Baltimore	"[""24510"", ""24005""]"
Missouri	St. Louis	"[""29189"", ""29510""]"
Virginia	Fairfax	"[""51600"", ""51059""]"
Virginia	Franklin	"[""51620"", ""51067""]"
Virginia	Richmond	"[""51159"", ""51760""]"
Virginia	Roanoke	"[""51770"", ""51161""]"

I think these are all city v.s. county issues.

Looking at https://www.nrcs.usda.gov/wps/portal/nrcs/detail/national/home/?cid=nrcs143_013697

24510 = Baltimore City
24005 = Baltimore
29189 = St Louis
29510 = St Louis City
51600 = Fairfax City
51059 = Fairfax
51620 = Franklin City
51067 = Franklin
51159 = Richmond
51760 = Richmond City
51770 = Roanoke
51161 = Roanoke

That clears up all but Roanoke.

I'm going to deploy a data migration for this. It's not the perfect solution (since it won't work for new installations of VIAL that don't yet have their counties imported) but this is mainly a cosmetic issue so I can live with that.

select fips_code, name from county where fips_code in ('24510', '29510', '51600', '51620', '51760', '51770')

Before running this migration on staging: https://vial-staging.calltheshots.us/dashboard/?sql=select+fips_code%2C+name+from+county+where+fips_code+in+%28%2724510%27%2C+%2729510%27%2C+%2751600%27%2C+%2751620%27%2C+%2751760%27%2C+%2751770%27%29%3Aje_rsIHENolLwWtmVYh35LGvwBJbSbTaYfem_qc7-8U

fips_code	name
24510	Baltimore
29510	St. Louis
51600	Fairfax
51620	Franklin
51760	Richmond
51770	Roanoke

After running it on staging, the same query returns:

fips_code	name
24510	Baltimore City
29510	St Louis City
51600	Fairfax City
51620	Franklin City
51760	Richmond City
51770	Roanoke City

Production after:

fips_code	name
24005	Baltimore
29189	St. Louis
51059	Fairfax
51067	Franklin
51159	Richmond
51161	Roanoke
24510	Baltimore City
29510	St Louis City
51600	Fairfax City
51620	Franklin City
51760	Richmond City
51770	Roanoke City