Skip to content

Commit

Permalink
Refactors CovidLink for new methodology (#2843)
Browse files Browse the repository at this point in the history
  • Loading branch information
benhammondmusic authored Feb 1, 2024
1 parent 46c7b7e commit 168ab7e
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 154 deletions.
12 changes: 12 additions & 0 deletions frontend/src/data/config/MetricConfigCovidCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export const COVID_DISEASE_METRICS: DataTypeConfig[] = [
definition: {
text: `A COVID-19 case is an individual who has been determined to have COVID-19 using a set of criteria known as a “case definition”. Cases can be classified as suspect, probable, or confirmed. CDC counts include probable and confirmed cases and deaths. Suspect cases and deaths are excluded.`,
},
description: {
text: 'COVID-19 has had a disproportionate impact on certain populations, including people of color, people with disabilities, and people living in poverty. Studying COVID-19 in regard to health equity can help us to understand why these disparities exist and how to address them.',
},
timeSeriesData: true,
dataTableTitle: 'Breakdown summary for COVID-19 cases',
metrics: {
Expand Down Expand Up @@ -106,6 +109,9 @@ export const COVID_DISEASE_METRICS: DataTypeConfig[] = [
definition: {
text: `The number of people who died due to COVID-19.`,
},
description: {
text: 'COVID-19 has had a disproportionate impact on certain populations, including people of color, people with disabilities, and people living in poverty. Studying COVID-19 in regard to health equity can help us to understand why these disparities exist and how to address them.',
},
timeSeriesData: true,
dataTableTitle: 'Breakdown summary for COVID-19 deaths',
metrics: {
Expand Down Expand Up @@ -159,6 +165,9 @@ export const COVID_DISEASE_METRICS: DataTypeConfig[] = [
definition: {
text: `The number of people hospitalized at any point while ill with COVID-19.`,
},
description: {
text: 'COVID-19 has had a disproportionate impact on certain populations, including people of color, people with disabilities, and people living in poverty. Studying COVID-19 in regard to health equity can help us to understand why these disparities exist and how to address them.',
},
timeSeriesData: true,
dataTableTitle: 'Breakdown summary for COVID-19 hospitalizations',
metrics: {
Expand Down Expand Up @@ -217,6 +226,9 @@ export const COVID_VACCINATION_METRICS: DataTypeConfig[] = [
definition: {
text: `For the national level and most states this indicates people who have received at least one dose of a COVID-19 vaccine.`,
},
description: {
text: 'COVID-19 vaccinations are an important tool for preventing the spread of the virus and protecting people from serious illness. However, vaccination rates vary significantly across different populations. Studying COVID-19 vaccinations in regard to health equity can help us to understand why these disparities exist and how to increase vaccination rates among all populations.',
},
dataTableTitle: 'Breakdown summary for COVID-19 vaccinations',
metrics: {
per100k: {
Expand Down
115 changes: 0 additions & 115 deletions frontend/src/pages/Methodology/methodologyContent/CovidDefinitions.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ export default function BehavioralHealthLink() {
reports:
</p>

<p>
For all topics sourced from America's Health Rankings (AHR), we obtain{' '}
<HetTerm>percent share</HetTerm> metrics directly from the
organization via custom created files. It is our goal to switch to
their recently released GraphQL API in the near future for more data
visibility and flexibility.
</p>

<p>
AHR usually gives us rates as percentages. In some cases, they provide
the number of cases for every 100,000 people. We keep the data in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,12 @@ const ChronicDiseaseLink = () => {
</p>
</HetNotice>
<p>
We obtain our data for the following specific issues directly from
America's Health Rankings (AHR). This data is based on{' '}
<HetTerm>percent share</HetTerm> metrics that AHR provides in
downloadable data files. Click on the following to explore the
reports:
For all topics sourced from America's Health Rankings (AHR), we obtain{' '}
<HetTerm>percent share</HetTerm> metrics directly from the
organization via custom created files. It is our goal to switch to
their recently released GraphQL API in the near future for more data
visibility and flexibility.
</p>
<ul className='list-none pl-0'>
<li className='font-sansTitle font-medium'>
<a
className='no-underline'
href='https://healthequitytracker.org/exploredata?mls=1.copd-3.00&group1=All'
>
COPD
</a>
</li>
<li className='font-sansTitle font-medium'>
<a
className='no-underline'
href='https://healthequitytracker.org/exploredata?mls=1.diabetes-3.00&group1=All'
>
diabetes
</a>
</li>
</ul>

<p>
AHR usually gives us rates as percentages. In some cases, they provide
Expand Down
56 changes: 42 additions & 14 deletions frontend/src/pages/Methodology/methodologySections/Covid19Link.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import {
covidDataSources,
covidDefinitionsArray,
} from '../methodologyContent/CovidDefinitions'
import KeyTerms from '../methodologyComponents/KeyTerms'
import { DATA_SOURCE_PRE_FILTERS } from '../../../utils/urlutils'
import { DATA_CATALOG_PAGE_LINK } from '../../../utils/internalRoutes'
import {
Expand All @@ -13,8 +8,45 @@ import Resources from '../methodologyComponents/Resources'
import { Helmet } from 'react-helmet-async'
import StripedTable from '../methodologyComponents/StripedTable'
import HetNotice from '../../../styles/HetComponents/HetNotice'
import { dataSourceMetadataMap } from '../../../data/config/MetadataMap'
import { COVID_CATEGORY_DROPDOWNIDS } from '../../../data/config/MetricConfigCovidCategory'
import { METRIC_CONFIG } from '../../../data/config/MetricConfig'
import { DROPDOWN_TOPIC_MAP } from '../../../utils/MadLibs'
import KeyTermsAccordion from '../methodologyComponents/KeyTermsAccordion'

export const covidDataSources = [
dataSourceMetadataMap.cdc_restricted,
dataSourceMetadataMap.acs,
dataSourceMetadataMap.decia_2010_territory_population,
dataSourceMetadataMap.decia_2020_territory_population,
dataSourceMetadataMap.cdc_vaccination_county,
dataSourceMetadataMap.cdc_vaccination_national,
dataSourceMetadataMap.kff_vaccination,
dataSourceMetadataMap.covid_tracking_project,
]

const datatypeConfigs = COVID_CATEGORY_DROPDOWNIDS.map((dropdownId) => {
return METRIC_CONFIG[dropdownId]
}).flat()

export const covidTopicsString = COVID_CATEGORY_DROPDOWNIDS.map(
(dropdownId) => {
console.log(METRIC_CONFIG[dropdownId])

let topicString = DROPDOWN_TOPIC_MAP[dropdownId]

const Covid19Link = () => {
if (METRIC_CONFIG[dropdownId].length > 1) {
const topicDataTypesString = METRIC_CONFIG[dropdownId]
.map((config) => config.dataTypeShortLabel)
.join(', ')
topicString += ` (${topicDataTypesString})`
}

return topicString
}
).join(', ')

export default function Covid19Link() {
return (
<section id='#covid-19'>
<article>
Expand All @@ -33,8 +65,7 @@ const Covid19Link = () => {
rows={[
{
category: 'COVID-19',
topic:
'COVID-19 (Cases, Deaths, Hospitalizations), COVID-19 Vaccinations',
topic: covidTopicsString,
},
]}
/>
Expand Down Expand Up @@ -315,10 +346,9 @@ const Covid19Link = () => {
updates: source.update_frequency,
}))}
/>

<KeyTerms
id='#covid-key-terms'
definitionsArray={covidDefinitionsArray}
<KeyTermsAccordion
hashId='#covid-key-terms'
datatypeConfigs={datatypeConfigs}
/>

<Resources
Expand All @@ -329,5 +359,3 @@ const Covid19Link = () => {
</section>
)
}

export default Covid19Link
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
METRIC_CONFIG,
} from '../../../data/config/MetricConfig'
import { DEMOGRAPHIC_TYPES } from '../../../data/query/Breakdowns'
import { covidTopicsString } from './Covid19Link'

const numDataSources = Object.keys(dataSourceMetadataMap).length
// tally number of conditions (including sub-conditions like COVID) x # demographic options
Expand Down Expand Up @@ -72,8 +73,7 @@ export default function TopicsLink() {
},
{
category: 'COVID-19',
topic:
'COVID-19 (Cases, Deaths, Hospitalizations), COVID-19 Vaccinations',
topic: covidTopicsString,
},
{
category: 'HIV',
Expand Down

0 comments on commit 168ab7e

Please sign in to comment.