Closed eliblock closed 3 years ago
- [ ] recF8KOyCoWS8WTN7 is missing from VIAL, due to missing lat/long
FWIW on this one, we don't display it on the website due to the missing lat/lng right now.
{
"Availability Info": [
- "No: no vaccine inventory",
- "Yes: appointment calendar currently full"
+ "No: no vaccine inventory"
],
"County": "Santa Cruz County",
"Has Report": 1,
"Latest report": "2021-04-10T18:43:25.000Z",
- "Latest report yes?": 1,
+ "Latest report notes": "",
+ "Latest report yes?": 0,
"Latitude": 36.95100110700608,
"Location Type": "Super Site",
"Longitude": -121.73504607310224,
"Name": "Santa Cruz Fairgrounds",
"google_places_id": "ChIJy91d95objoARWvMBGcnnQh8",
"id": "recBtAuXk2yXPJgr3"
}
If it's just these three we can fix these manually rather than writing any new code.
I'm going to fix these by hand-editing the JSON and running them through the import script again.
* [ ] recOPjfftbB5VwZdP is missing from VIAL because of no address
"Santa Clara County Mobile In-home Vaccination Program" - hah, yeah that's a good edge-case! I'm going to give it an address of "Santa Clara" and move on.
select 'vaccinespotter_location_id is not null', count(*) from location where vaccinespotter_location_id is not null
union
select 'vaccinespotter_location_id is null', count(*) from location where vaccinespotter_location_id is null
column | count |
---|---|
vaccinespotter_location_id is not null | 1797 |
vaccinespotter_location_id is null | 7939 |
* [ ] rechXXFLPmWMUFLLT has no vaccinefinder_location_id or vaccinespotter_location_id in VIAL?
Looks like those are:
"vaccinefinder_location_id": "7253e6e1-b0eb-48ac-9007-f3dabb669fce",
"vaccinespotter_location_id": "1047871"
I'll add them to VIAL manually - only it looks like those aren't editable on the location form right now.
I hand-crafted the updated Airtable JSON for the two missing locations and ran it through this script to convert it to our import JSON format:
python -m importers.airtable_locations --dry-run ~/Desktop/vial-launch/Tuesday/missing-locations.json | pbcopy
Here's the output: https://gist.github.com/simonw/cbda3002f329a363a6c938ce5d955000
Now I'm going to paste that JSON into the debug tool at https://vial-staging.calltheshots.us/api/importLocations/debug to test that it works.
Note that https://vial-staging.calltheshots.us/admin/core/location/?q=recF8KOyCoWS8WTN7 and https://vial-staging.calltheshots.us/admin/core/location/?q=recOPjfftbB5VwZdP don't return results before the import.
After the input both those locations exist on staging, but they don't yet have any reports. Time to add the reports.
I ran this to confirm that they have reports in Reports.json
:
json-post Reports.json "https://example.com" \
--filter 'item.get("Location") and item["Location"][0] in ("recF8KOyCoWS8WTN7", "recOPjfftbB5VwZdP")' \
--count
3
Then I imported against staging like this:
json-post Reports.json "https://vial-staging.calltheshots.us/api/importReports" \
-h Authorization 'Bearer 3:...' \
--log - \
--http-read-timeout 20 \
--filter 'item.get("Location") and item["Location"][0] in ("recF8KOyCoWS8WTN7", "recOPjfftbB5VwZdP")'
I ran these steps against production. Here are the two created locations, with their imported reports:
I fixed the vaccinefinder/spotter IDs on https://vial.calltheshots.us/admin/core/location/4987/change/
CC: @alexmv for more