Open simonw opened 3 years ago
Could we do this based on the date of that report?
select location.public_id, location.name, location.full_address, report.created_at, json_agg(availability_tag.name)
from location join report on location.dn_latest_non_skip_report_id = report.id
join call_report_availability_tag on call_report_availability_tag.report_id = report.id
join availability_tag on call_report_availability_tag.availabilitytag_id = availability_tag.id
where location. soft_deleted = false and location.id in (select location_id from concordance_location where concordanceidentifier_id in (select id from concordance_identifier where authority = '_issue' and identifier = '701')) group by location.public_id, location.name, location.full_address, report.created_at order by report.created_at desc
That shows the dates on the reports, for the locations we investigated in #702 - sorted by most recent at the top. 2021-06-19 16:23 is the most recent one, the oldest is 2021-03-30 and it looks like about a third of them are June, almost all of the rest are May, a few are April and March.
The issue here is actually a pretty big one: at what point do we consider a location "closed"? Do we stop showing it on our mapbox-powered vaccinatethestates.com site? Do we also exclude it from our API export?
A plan for this is forming in #712.
Follow-on from #702 in which we learned that our logic that excludes locations from our API export and website if their last recorded non-skip report used certain availability tags ("May be a vaccination site in the future" etc).
We should reconsider this policy now that we rely much more heavily on data scraped and imported from other sources.