Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Normalized Location Schema

Bryan Culbertson edited this page Apr 23, 2021 · 16 revisions

Specification

If you are writing the normalize stage in python then you can use the Pydandic schema objects specified at schema/schema.py

{
  id: str as required unique stable id formatted as <source>:<id> e.g. vaccinespotter:7382088
  name: str as display name of location providing vaccine,
  address: {
    street1: str as required street address e.g. 111 First Ave.,
    street2: str e.g. Apt #1,
    city: str as required city e.g. Oakland,
    state: str as required capital state initials e.g. CA,
    zip: str as required 5 digit zip-code e.g. 94607,
  },
  location: {
    latitude: float,
    longitude: float,
  },
  contact: [
    {
      contact_type: str as contact type enum e.g. booking
      phone: str as phone number with area code in format (###) ###-###,
      website: str as website with https prefix e.g. https://facility.com/clinic,
      email: str as email address e.g. [email protected],
      other: str as free form text e.g. instructions to sign-up in person,
    },
    ...
  ],
  languages: [
    str as ISO 639-1 code for languages spoken e.g. en,
    ...
  ],
  opening_dates: [
    {
      opens: str as date that facility opens in iso8601 format e.g. 2021-04-15,
      closes: str  as date that facility closes in iso8601 format e.g. 2021-06-15,
    },
    ...
  ],
  opening_hours: [
    {
      day: str as lowercase day of week e.g. monday,
      opens: str as time with facility opens on this day in format hh:mm,
      closes: str as time with facility closes on this day in format hh:mm,
    },
    ...
  ],
  availability: {
    drop_in: bool as flag indicating patients can arrive without an appointment,
    appointments: bool as flag indicating patients can schedule an appointment,
  },
  inventory: [
    {
      vaccine: str as vaccine type e.g. pfizer,
      supply_level: str as supply level enum e.g. more_than_48h,
    },
    ...
  ],
  access: {
    walk: bool as flag indicating if patients can arrive by walking,
    drive: bool as flag indicating if patients can arrive by driving,
    wheelchair: bool as flag indicating if patients can arrive by wheelchair,
  },
  parent_organization: {
    id: str as parent organization enum running facility e.g. rite_aid,
    name: str as display name of parent organization running location e.g. Rite Aid,
  },
  links: [
    {
      authority: str as authority enum e.g. rite_aid or google_places,
      id: str as id used by authority to reference this location e.g. 4096
      uri: str as uri used by authority to reference this location
    },
    ...
  ],
  notes: [
    str as free form text with information about location,
    ...
  ],
  active: bool as flag indicating if this location is currently active or is historical,
  source: {
    source: str as source type enum e.g. vaccinespotter,
    id: str as source defined id e.g. 7382088,
    fetched_from_uri: str as uri where data was fetched from,
    fetched_at: str as iso8601 datetime (when scraper ran),
    published_at: str as iso8601 datetime (when source claims it updated),
    data: {...parsed source data in source schema...},
  },
}

Contact Type Enum

Used in contact.contact_type

  • booking: For contact information used to book an appointment
  • general: For contact information used to learn general information about facility

Day Of Week Enum

Used in opening_hours.days

  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
  • sunday
  • public_holidays

Vaccine Type Enum

Used in inventory.vaccine

  • pfizer_biontech
  • moderna
  • johnson_johnson_janssen
  • oxford_astrazeneca

Supply Level Enum

Used in inventory.supply_level

  • less_than_48hrs
  • more_than_48hrs
  • out_of_stock
  • in_stock

Organization Enum

Used in parent_organization.id

Organizations that have multiple sites that are grouped under the same parent organization. Also called providers in some feeds.

If there is not an existing enum value for an organization then create one as a lowercase name with non-alphanumeric characters replaced with underscores. If provider also has an authoritative id for this location then use the same enum value for both here and in links field.

  • rite_aid
  • walgreens

Authority Enum

Used in links.authority

Organizations, products, websites, etc. that provide an identifier for this specific facility. This is used to match facilities between multiple feeds.

If there is not an existing enum value for an authority then create one as a lowercase name with non-alphanumeric characters replaced with underscores.

  • rite_aid
  • walgreens
  • google_places
  • vaccinespotter
  • vaccinefinder

Examples

Minimal Record

{
  "id": "45748",
  "name": "Rite Aid #05952",
  "address": {
    "street1": "1991 Mountain Boulevard",
    "city": "Oakland",
    "state": "CA",
    "zip": "94611",
  },
}

Typical Record

{
  "id": "45748",
  "name": "Rite Aid #05952",
  "address": {
    "street1": "1991 Mountain Boulevard",
    "city": "Oakland",
    "state": "CA",
    "zip": "94611",
  },
  "location": {
    "latitude": 37.8273167,
    "longitude": -122.2105179,
  },
  "contact": [
    {
      "contact_type": "booking",
      "website": "https://www.riteaid.com/pharmacy/covid-qualifier",
    },
    {
      "contact_type": "general",
      "phone": "(510) 339-2215",
      "website": "https://www.riteaid.com/locations/ca/oakland/1991-mountain-boulevard.html",
    },
  ],
  "availability": {
    "appointments": true,
    "drop_in": false,
  },
}