Skip to content

Commit

Permalink
Merge pull request #1161 from cmu-delphi/sgratzl/hotfix
Browse files Browse the repository at this point in the history
hotfix: add missing wave details + workaround to prevent in future
  • Loading branch information
sgratzl authored Feb 25, 2022
2 parents df00785 + f6be10b commit bee059d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
19 changes: 15 additions & 4 deletions src/stores/descriptions.raw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,27 @@ SignalTooltip: Percentage of people who either have already received a COVID vac

Description: Every day, Delphi surveys tens of thousands of Facebook users, asking them a broad set of COVID-related questions, including whether they have received a COVID vaccine, have an appointment to do so, or would choose to be vaccinated if they were offered a COVID vaccine today. For this signal, we estimate the percentage of people who either (a) say they have already received a COVID vaccine, (b) have an appointment to receive a COVID vaccine, or (c) would “definitely” or “probably” choose to be vaccinated if a COVID vaccine were offered to them today. The signal changed in [Wave 11](https://cmu-delphi.github.io/delphi-epidata/symptom-survey/coding.html#wave-11) of the survey, asking all non-vaccinated respondents if they have an appointment to be vaccinated and treating those with appointments as vaccine-accepting.
---
Name: COVID Symptom Searches on Google
Name: COVID Symptoms (Smell and Taste) on Google
Id: google-symptoms
Signal: sum_anosmia_ageusia_smoothed_search
Signal: s05_smoothed_search
Unit: scaled search volume
UnitShort:
noMaps: true

SignalTooltip: Google search volume of COVID-related symptom searches
SignalTooltip: Google search volume of COVID-related symptom searches about smell and taste

Description: Using Google Symptoms Searches, Delphi obtains the sum of Google search volumes for anosmia (loss of smell) related searches and ageusia (loss of taste) related searches in each area, since they emerged as unusual symptoms that are indicative of COVID-19. Note that the sum of two symptom search volumes is not equivalent to the union of anosmia and ageusia related searches. According to Google, the estimates are not comparable across regions since the values are normalized by population and scaled by region-specific maximum popularity (and for this reason, we omit beehive grids of choropleth maps of this signal on the dashboard).
Description: Using Google Symptoms Searches, Delphi obtains the average of Google search volumes for searches related to anosmia (loss of smell), ageusia (loss of taste), and dysgeusia (altered or impaired taste) in each area, since they emerged as unusual symptoms that can be indicative of COVID-19. Note that the average of the three symptom search volumes is not equivalent to the search volume of their union. According to Google, the estimates are not comparable across regions since the values are normalized by population and scaled by region-specific maximum popularity (and for this reason, we omit beehive grids and choropleth maps of this signal on the dashboard).
---
Name: COVID Symptoms (Common Cold) on Google
Id: google-symptoms
Signal: s02_smoothed_search
Unit: scaled search volume
UnitShort:
noMaps: true

SignalTooltip: Google search volume of COVID-related symptom searches about common cold

Description: Using Google Symptoms Searches, Delphi obtains the average of Google search volumes for searches related to nasal congestion, post nasal drip, rhinorrhea, sinusitis, rhinitis, and common cold in each area. These symptoms have showed positive correlation with reported COVID cases, especially since Omicron was declared a variant of concern by the World Health Organization. Note that the average search volume of these symptoms is not equivalent to the search volume of their union. According to Google, the estimates are not comparable across regions since the values are normalized by population and scaled by region-specific maximum popularity (and for this reason, we omit beehive grids and choropleth maps of this signal on the dashboard).
---
Name: COVID-Like Symptoms
Id: fb-survey
Expand Down
2 changes: 1 addition & 1 deletion src/stores/questions.raw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Overview: |
FullSurveyLink: https://cmu-delphi.github.io/delphi-epidata/symptom-survey/coding.html
DataAccessLink: https://cmu-delphi.github.io/delphi-epidata/symptom-survey/data-access.html
ReferenceRawNationSignal: raw_cli
Waves: [2020-04-06, 2020-04-15, 2020-05-21, 2020-09-08, 2020-11-24, 2020-12-19, 2021-01-12, 2021-02-08, 2021-03-02, 2021-03-02, 2021-05-20]
Waves: [2020-04-06, 2020-04-15, 2020-05-21, 2020-09-08, 2020-11-24, 2020-12-19, 2021-01-12, 2021-02-08, 2021-03-02, 2021-03-02, 2021-05-20, 2022-01-30]
Levels: [county, msa, state] # levels which the survey should be pickable


Expand Down
27 changes: 24 additions & 3 deletions src/stores/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,27 @@ export const waves = descriptions.waves.reduce((waves, wave, i) => {
return waves;
}, [] as Wave[]);

function getWave(wave: number): Wave {
if (wave >= waves.length) {
// create dummy waves
for (let i = waves.length; i <= wave; i++) {
console.warn(`faking wave ${i + 1}, please update the google doc`);
const waveObj: Wave = {
name: `Wave ${i + 1}`,
wave: i + 1,
published: new Date(),
previous: waves[i - 1],
link: waveLink(i + 1),
};
if (waveObj.previous) {
waveObj.previous.next = waveObj;
}
waves.push(waveObj);
}
}
return wave < 0 ? waves[0] : waves[wave];
}

export interface Revision extends SensorLike {
change: string;
changedInWave: Wave;
Expand Down Expand Up @@ -69,7 +90,7 @@ export const questions: Question[] = descriptions.questions.map((desc) => {
...desc,
id: descriptions.id,
anchor: toAnchor(desc.name),
addedInWave: waves[desc.addedInWave - 1],
addedInWave: getWave(desc.addedInWave - 1),
oldRevisions: undefined,
};
if (desc.oldRevisions) {
Expand All @@ -81,8 +102,8 @@ export const questions: Question[] = descriptions.questions.map((desc) => {
acc.push({
...rev,
id: descriptions.id,
changedInWave: acc.length === 0 ? waves[desc.addedInWave - 1] : acc[acc.length - 1].addedInWave,
addedInWave: waves[rev.addedInWave - 1],
changedInWave: acc.length === 0 ? getWave(desc.addedInWave - 1) : acc[acc.length - 1].addedInWave,
addedInWave: getWave(rev.addedInWave - 1),
});
return acc;
}, [] as Revision[])
Expand Down

0 comments on commit bee059d

Please sign in to comment.