diff --git a/packages/app/schema/gm/__index.json b/packages/app/schema/gm/__index.json index 015b7d3f4a..f90da3e170 100644 --- a/packages/app/schema/gm/__index.json +++ b/packages/app/schema/gm/__index.json @@ -17,7 +17,7 @@ "vaccine_coverage_per_age_group", "vaccine_coverage_per_age_group_archived", "vaccine_coverage_per_age_group_archived_20220908", - "booster_coverage" + "booster_coverage_archived_20220904" ], "properties": { "last_generated": { @@ -62,8 +62,8 @@ "vaccine_coverage_per_age_group_archived_20220908": { "$ref": "vaccine_coverage_per_age_group_archived_20220908.json" }, - "booster_coverage": { - "$ref": "booster_coverage.json" + "booster_coverage_archived_20220904": { + "$ref": "booster_coverage_archived_20220904.json" } }, "$defs": { diff --git a/packages/app/schema/gm/booster_coverage.json b/packages/app/schema/gm/booster_coverage_archived_20220904.json similarity index 89% rename from packages/app/schema/gm/booster_coverage.json rename to packages/app/schema/gm/booster_coverage_archived_20220904.json index eaee06edc9..43cf6de9a7 100644 --- a/packages/app/schema/gm/booster_coverage.json +++ b/packages/app/schema/gm/booster_coverage_archived_20220904.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_booster_coverage", + "title": "gm_booster_coverage_archived_20220904", "type": "object", "properties": { "values": { @@ -16,7 +16,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "gm_booster_coverage_value", + "title": "gm_booster_coverage_archived_20220904_value", "type": "object", "properties": { "age_group": { diff --git a/packages/app/schema/gm/sewer.json b/packages/app/schema/gm/sewer.json index 00e925cffe..02c4ae016b 100644 --- a/packages/app/schema/gm/sewer.json +++ b/packages/app/schema/gm/sewer.json @@ -11,7 +11,8 @@ "total_number_of_samples", "sampled_installation_count", "total_installation_count", - "date_of_insertion_unix" + "date_of_insertion_unix", + "data_is_outdated" ], "properties": { "date_start_unix": { @@ -34,6 +35,9 @@ }, "date_of_insertion_unix": { "type": "integer" + }, + "data_is_outdated": { + "type": "boolean" } } } diff --git a/packages/app/schema/gm/vaccine_coverage_per_age_group.json b/packages/app/schema/gm/vaccine_coverage_per_age_group.json index c77865c4db..d98a04f721 100644 --- a/packages/app/schema/gm/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/gm/vaccine_coverage_per_age_group.json @@ -18,44 +18,53 @@ "additionalProperties": false, "type": "object", "required": [ - "age_group_range", - "autumn_2022_vaccinated_percentage", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", - "birthyear_range", + "vaccination_type", + "birthyear_range_12_plus", + "birthyear_range_18_plus", + "birthyear_range_60_plus", + "vaccinated_percentage_12_plus", + "vaccinated_percentage_12_plus_label", + "vaccinated_percentage_18_plus", + "vaccinated_percentage_18_plus_label", + "vaccinated_percentage_60_plus", + "vaccinated_percentage_60_plus_label", "date_of_insertion_unix", "date_unix" ], "properties": { - "age_group_range": { - "type": "string", - "enum": ["12+", "18+", "60+"] - }, - "autumn_2022_vaccinated_percentage": { - "type": ["integer", "null"] - }, - "fully_vaccinated_percentage": { - "type": ["integer", "null"] + "vaccination_type": { + "type": "string" }, - "booster_shot_percentage": { - "type": ["integer", "null"] + "birthyear_range_12_plus": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "birthyear_range": { + "birthyear_range_18_plus": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "autumn_2022_vaccinated_percentage_label": { + "birthyear_range_60_plus": { + "type": ["string", "null"], + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" + }, + "vaccinated_percentage_12_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_12_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "fully_vaccinated_percentage_label": { + "vaccinated_percentage_18_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_18_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "booster_shot_percentage_label": { + "vaccinated_percentage_60_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_60_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, diff --git a/packages/app/schema/gm_collection/__index.json b/packages/app/schema/gm_collection/__index.json index 227e4878c8..c8a2d23f05 100644 --- a/packages/app/schema/gm_collection/__index.json +++ b/packages/app/schema/gm_collection/__index.json @@ -57,8 +57,8 @@ }, "vaccine_coverage_per_age_group": { "type": "array", - "minItems": 1032, - "maxItems": 1032, + "minItems": 688, + "maxItems": 688, "items": { "$ref": "vaccine_coverage_per_age_group.json" } diff --git a/packages/app/schema/gm_collection/sewer.json b/packages/app/schema/gm_collection/sewer.json index 87326bccf0..7cd18a9855 100644 --- a/packages/app/schema/gm_collection/sewer.json +++ b/packages/app/schema/gm_collection/sewer.json @@ -9,7 +9,8 @@ "gmcode", "average", "total_installation_count", - "date_of_insertion_unix" + "date_of_insertion_unix", + "data_is_outdated" ], "properties": { "date_start_unix": { @@ -30,6 +31,9 @@ }, "date_of_insertion_unix": { "type": "integer" + }, + "data_is_outdated": { + "type": "boolean" } } } diff --git a/packages/app/schema/gm_collection/vaccine_coverage_per_age_group.json b/packages/app/schema/gm_collection/vaccine_coverage_per_age_group.json index 8a98d9edbd..464ecf98b6 100644 --- a/packages/app/schema/gm_collection/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/gm_collection/vaccine_coverage_per_age_group.json @@ -5,14 +5,16 @@ "additionalProperties": false, "required": [ "gmcode", - "age_group_range", - "birthyear_range", - "autumn_2022_vaccinated_percentage", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage", - "fully_vaccinated_percentage_label", - "booster_shot_percentage", - "booster_shot_percentage_label", + "vaccination_type", + "birthyear_range_12_plus", + "birthyear_range_18_plus", + "birthyear_range_60_plus", + "vaccinated_percentage_12_plus", + "vaccinated_percentage_12_plus_label", + "vaccinated_percentage_18_plus", + "vaccinated_percentage_18_plus_label", + "vaccinated_percentage_60_plus", + "vaccinated_percentage_60_plus_label", "date_of_insertion_unix", "date_unix" ], @@ -21,32 +23,39 @@ "type": "string", "pattern": "^GM[0-9]+$" }, - "age_group_range": { - "type": "string", - "enum": ["12+", "18+", "60+"] - }, - "autumn_2022_vaccinated_percentage": { - "type": ["integer", "null"] - }, - "fully_vaccinated_percentage": { - "type": ["integer", "null"] + "vaccination_type": { + "type": "string" }, - "booster_shot_percentage": { - "type": ["integer", "null"] + "birthyear_range_12_plus": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "birthyear_range": { + "birthyear_range_18_plus": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "autumn_2022_vaccinated_percentage_label": { + "birthyear_range_60_plus": { + "type": ["string", "null"], + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" + }, + "vaccinated_percentage_12_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_12_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "fully_vaccinated_percentage_label": { + "vaccinated_percentage_18_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_18_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "booster_shot_percentage_label": { + "vaccinated_percentage_60_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_60_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, diff --git a/packages/app/schema/nl/__index.json b/packages/app/schema/nl/__index.json index 5ee9f640dc..b955224bdd 100644 --- a/packages/app/schema/nl/__index.json +++ b/packages/app/schema/nl/__index.json @@ -5,9 +5,9 @@ "required": [ "behavior", "behavior_annotations", - "booster_shot_administered", + "booster_shot_administered_archived_20220904", "repeating_shot_administered", - "booster_coverage", + "booster_coverage_archived_20220904", "code", "corona_melder_app_download", "corona_melder_app_warning", @@ -80,14 +80,14 @@ "named_difference": { "$ref": "__named_difference.json" }, - "booster_shot_administered": { - "$ref": "booster_shot_administered.json" + "booster_shot_administered_archived_20220904": { + "$ref": "booster_shot_administered_archived_20220904.json" }, "repeating_shot_administered": { "$ref": "repeating_shot_administered.json" }, - "booster_coverage": { - "$ref": "booster_coverage.json" + "booster_coverage_archived_20220904": { + "$ref": "booster_coverage_archived_20220904.json" }, "doctor": { "$ref": "doctor.json" diff --git a/packages/app/schema/nl/booster_coverage.json b/packages/app/schema/nl/booster_coverage_archived_20220904.json similarity index 88% rename from packages/app/schema/nl/booster_coverage.json rename to packages/app/schema/nl/booster_coverage_archived_20220904.json index f4b5cfff2f..b4e5eed9d7 100644 --- a/packages/app/schema/nl/booster_coverage.json +++ b/packages/app/schema/nl/booster_coverage_archived_20220904.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_booster_coverage", + "title": "nl_booster_coverage_archived_20220904", "type": "object", "properties": { "values": { @@ -16,7 +16,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_booster_coverage_value", + "title": "nl_booster_coverage_archived_20220904_value", "type": "object", "properties": { "age_group": { diff --git a/packages/app/schema/nl/booster_shot_administered.json b/packages/app/schema/nl/booster_shot_administered_archived_20220904.json similarity index 88% rename from packages/app/schema/nl/booster_shot_administered.json rename to packages/app/schema/nl/booster_shot_administered_archived_20220904.json index 5f6326eeea..995d274b89 100644 --- a/packages/app/schema/nl/booster_shot_administered.json +++ b/packages/app/schema/nl/booster_shot_administered_archived_20220904.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_booster_shot_administered", + "title": "nl_booster_shot_administered_archived_20220904", "type": "object", "properties": { "values": { @@ -19,7 +19,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_booster_shot_administered_value", + "title": "nl_booster_shot_administered_archived_20220904_value", "type": "object", "properties": { "administered_total": { diff --git a/packages/app/schema/nl/vaccine_coverage_per_age_group.json b/packages/app/schema/nl/vaccine_coverage_per_age_group.json index b0fd6482d5..b9d8acd305 100644 --- a/packages/app/schema/nl/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/nl/vaccine_coverage_per_age_group.json @@ -22,10 +22,8 @@ "age_group_range", "age_group_total", "autumn_2022_vaccinated", - "booster_shot", "autumn_2022_vaccinated_percentage", "fully_vaccinated_percentage", - "booster_shot_percentage", "date_of_insertion_unix", "date_unix", "date_of_report_unix", @@ -59,18 +57,12 @@ "fully_vaccinated": { "type": "integer" }, - "booster_shot": { - "type": ["integer", "null"] - }, "autumn_2022_vaccinated_percentage": { "type": ["integer", "null"] }, "fully_vaccinated_percentage": { "type": "number" }, - "booster_shot_percentage": { - "type": ["number", "null"] - }, "date_unix": { "type": "integer" }, diff --git a/packages/app/schema/vr/__index.json b/packages/app/schema/vr/__index.json index 88a856d288..026e0ed88d 100644 --- a/packages/app/schema/vr/__index.json +++ b/packages/app/schema/vr/__index.json @@ -27,7 +27,7 @@ "vaccine_coverage_per_age_group", "vaccine_coverage_per_age_group_archived", "vaccine_coverage_per_age_group_archived_20220908", - "booster_coverage" + "booster_coverage_archived_20220904" ], "additionalProperties": false, "properties": { @@ -106,8 +106,8 @@ "vaccine_coverage_per_age_group_archived_20220908": { "$ref": "vaccine_coverage_per_age_group_archived_20220908.json" }, - "booster_coverage": { - "$ref": "booster_coverage.json" + "booster_coverage_archived_20220904": { + "$ref": "booster_coverage_archived_20220904.json" } }, "$defs": { diff --git a/packages/app/schema/vr/booster_coverage.json b/packages/app/schema/vr/booster_coverage_archived_20220904.json similarity index 89% rename from packages/app/schema/vr/booster_coverage.json rename to packages/app/schema/vr/booster_coverage_archived_20220904.json index d07b6435de..565ba114c4 100644 --- a/packages/app/schema/vr/booster_coverage.json +++ b/packages/app/schema/vr/booster_coverage_archived_20220904.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "vr_booster_coverage", + "title": "vr_booster_coverage_archived_20220904", "type": "object", "properties": { "values": { @@ -16,7 +16,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "vr_booster_coverage_value", + "title": "vr_booster_coverage_archived_20220904_value", "type": "object", "properties": { "age_group": { diff --git a/packages/app/schema/vr/sewer.json b/packages/app/schema/vr/sewer.json index 55764ef52a..2b87d3e818 100644 --- a/packages/app/schema/vr/sewer.json +++ b/packages/app/schema/vr/sewer.json @@ -4,7 +4,7 @@ "title": "vr_sewer_value", "type": "object", "additionalProperties": false, - "required": ["date_unix", "average", "date_of_insertion_unix"], + "required": ["date_unix", "average", "date_of_insertion_unix", "data_is_outdated"], "properties": { "date_unix": { "type": "integer" @@ -14,6 +14,9 @@ }, "date_of_insertion_unix": { "type": "integer" + }, + "data_is_outdated": { + "type": "boolean" } } } diff --git a/packages/app/schema/vr/vaccine_coverage_per_age_group.json b/packages/app/schema/vr/vaccine_coverage_per_age_group.json index 05e0de9d45..1733d1c6a3 100644 --- a/packages/app/schema/vr/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/vr/vaccine_coverage_per_age_group.json @@ -18,44 +18,53 @@ "additionalProperties": false, "type": "object", "required": [ - "age_group_range", - "autumn_2022_vaccinated_percentage", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", - "birthyear_range", + "vaccination_type", + "birthyear_range_12_plus", + "birthyear_range_18_plus", + "birthyear_range_60_plus", + "vaccinated_percentage_12_plus", + "vaccinated_percentage_12_plus_label", + "vaccinated_percentage_18_plus", + "vaccinated_percentage_18_plus_label", + "vaccinated_percentage_60_plus", + "vaccinated_percentage_60_plus_label", "date_of_insertion_unix", "date_unix" ], "properties": { - "age_group_range": { - "type": "string", - "enum": ["12+", "18+", "60+"] - }, - "autumn_2022_vaccinated_percentage": { - "type": ["integer", "null"] - }, - "fully_vaccinated_percentage": { - "type": ["integer", "null"] + "vaccination_type": { + "type": "string" }, - "booster_shot_percentage": { - "type": ["integer", "null"] + "birthyear_range_12_plus": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "birthyear_range": { + "birthyear_range_18_plus": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "autumn_2022_vaccinated_percentage_label": { + "birthyear_range_60_plus": { + "type": ["string", "null"], + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" + }, + "vaccinated_percentage_12_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_12_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "fully_vaccinated_percentage_label": { + "vaccinated_percentage_18_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_18_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "booster_shot_percentage_label": { + "vaccinated_percentage_60_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_60_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, diff --git a/packages/app/schema/vr_collection/__index.json b/packages/app/schema/vr_collection/__index.json index f3e8198e6d..10416e6808 100644 --- a/packages/app/schema/vr_collection/__index.json +++ b/packages/app/schema/vr_collection/__index.json @@ -105,8 +105,8 @@ }, "vaccine_coverage_per_age_group": { "type": "array", - "minItems": 75, - "maxItems": 75, + "minItems": 50, + "maxItems": 50, "items": { "$ref": "vaccine_coverage_per_age_group.json" } diff --git a/packages/app/schema/vr_collection/sewer.json b/packages/app/schema/vr_collection/sewer.json index 7ea55377af..649f779eaf 100644 --- a/packages/app/schema/vr_collection/sewer.json +++ b/packages/app/schema/vr_collection/sewer.json @@ -3,7 +3,7 @@ "title": "vr_collection_sewer", "type": "object", "additionalProperties": false, - "required": ["date_unix", "vrcode", "average", "date_of_insertion_unix"], + "required": ["date_unix", "vrcode", "average", "date_of_insertion_unix", "data_is_outdated"], "properties": { "date_unix": { "type": "integer" @@ -17,6 +17,9 @@ }, "date_of_insertion_unix": { "type": "integer" + }, + "data_is_outdated": { + "type": "boolean" } } } diff --git a/packages/app/schema/vr_collection/vaccine_coverage_per_age_group.json b/packages/app/schema/vr_collection/vaccine_coverage_per_age_group.json index a9aaeddaa0..88915c2007 100644 --- a/packages/app/schema/vr_collection/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/vr_collection/vaccine_coverage_per_age_group.json @@ -5,14 +5,16 @@ "additionalProperties": false, "required": [ "vrcode", - "age_group_range", - "birthyear_range", - "autumn_2022_vaccinated_percentage", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage_label", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "booster_shot_percentage_label", + "vaccination_type", + "birthyear_range_12_plus", + "birthyear_range_18_plus", + "birthyear_range_60_plus", + "vaccinated_percentage_12_plus", + "vaccinated_percentage_12_plus_label", + "vaccinated_percentage_18_plus", + "vaccinated_percentage_18_plus_label", + "vaccinated_percentage_60_plus", + "vaccinated_percentage_60_plus_label", "date_of_insertion_unix", "date_unix" ], @@ -21,32 +23,39 @@ "type": "string", "pattern": "^VR[0-9]+$" }, - "age_group_range": { - "type": "string", - "enum": ["12+", "18+", "60+"] - }, - "autumn_2022_vaccinated_percentage": { - "type": ["integer", "null"] - }, - "fully_vaccinated_percentage": { - "type": ["integer", "null"] + "vaccination_type": { + "type": "string" }, - "booster_shot_percentage": { - "type": ["integer", "null"] + "birthyear_range_12_plus": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "birthyear_range": { + "birthyear_range_18_plus": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" }, - "autumn_2022_vaccinated_percentage_label": { + "birthyear_range_60_plus": { + "type": ["string", "null"], + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" + }, + "vaccinated_percentage_12_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_12_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "fully_vaccinated_percentage_label": { + "vaccinated_percentage_18_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_18_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, - "booster_shot_percentage_label": { + "vaccinated_percentage_60_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_60_plus_label": { "type": ["string", "null"], "pattern": "^([><][=][0-9]{1,2})$" }, diff --git a/packages/app/src/components/choropleth-legenda.tsx b/packages/app/src/components/choropleth-legenda.tsx index 75efeb0ce8..faeaa0b1c0 100644 --- a/packages/app/src/components/choropleth-legenda.tsx +++ b/packages/app/src/components/choropleth-legenda.tsx @@ -1,28 +1,26 @@ -import { ChoroplethThresholdsValue } from '@corona-dashboard/common'; +import { ChoroplethThresholdsValue, colors } from '@corona-dashboard/common'; import { css, SystemStyleObject } from '@styled-system/css'; import styled from 'styled-components'; import { ValueAnnotation } from '~/components/value-annotation'; import { useIntl } from '~/intl'; +import { space, fontSizes } from '~/style/theme'; import { replaceVariablesInText } from '~/utils'; import { useBreakpoints } from '~/utils/use-breakpoints'; import { useResizeObserver } from '~/utils/use-resize-observer'; import { Box } from './base'; import { Legend, LegendItem } from './legend'; -import { Text } from './typography'; +import { InlineText, Text } from './typography'; interface ChoroplethLegendaProps { title: string; thresholds: ChoroplethThresholdsValue[]; valueAnnotation?: string; type?: 'default' | 'bar'; + pageType?: string; + outdatedDataLabel?: string; } -export function ChoroplethLegenda({ - title, - thresholds, - valueAnnotation, - type = 'bar', -}: ChoroplethLegendaProps) { +export function ChoroplethLegenda({ title, thresholds, valueAnnotation, type = 'bar', pageType, outdatedDataLabel }: ChoroplethLegendaProps) { const [itemRef, itemSize] = useResizeObserver<HTMLLIElement>(); const [endLabelRef, endLabelSize] = useResizeObserver<HTMLSpanElement>(); const { commonTexts, formatNumber } = useIntl(); @@ -44,13 +42,18 @@ export function ChoroplethLegenda({ ); return ( - <Box - width="100%" - pr={`${endLabelSize.width ?? 0 / 2}px`} - spacing={2} - aria-hidden="true" - > + <Box width="100%" paddingRight={`${endLabelSize.width ?? 0 / 2}px`} spacing={2} aria-hidden="true"> {title && <Text variant="subtitle1">{title}</Text>} + + {pageType === 'sewer' && ( + <Box display="flex" alignItems="center" paddingBottom={space[2]}> + <LegendaColor first={true} width={`${100 / thresholds.length}%`} color={colors.yellow1} /> + <Box paddingLeft={space[3]} fontSize={fontSizes[1]}> + <InlineText>{outdatedDataLabel}</InlineText> + </Box> + </Box> + )} + {'bar' === type ? ( <List> {thresholds.map(({ color, threshold, label, endLabel }, index) => { @@ -60,20 +63,11 @@ export function ChoroplethLegenda({ const formattedTreshold = formatNumber(threshold); return ( - <Item - key={color + threshold} - ref={index === 0 ? itemRef : undefined} - > + <Item key={color + threshold} ref={index === 0 ? itemRef : undefined} width={`${100 / thresholds.length}%`}> <LegendaColor color={color} first={isFirst} last={isLast} /> - {isFirst ? ( - <StartLabel>{label ?? formattedTreshold}</StartLabel> - ) : ( - displayLabel && <Label>{label ?? formattedTreshold}</Label> - )} + {isFirst ? <StartLabel>{label ?? formattedTreshold}</StartLabel> : displayLabel && <Label>{label ?? formattedTreshold}</Label>} - {isLast && endLabel && ( - <EndLabel ref={endLabelRef}>{endLabel}</EndLabel> - )} + {isLast && endLabel && <EndLabel ref={endLabelRef}>{endLabel}</EndLabel>} </Item> ); })} @@ -96,9 +90,13 @@ const List = styled.ul( }) ); -const Item = styled.li( +// Assigning a flex-basis based on number of items in threshold so that legend items outside of the threshold array can be displayed using the same measurement. +const Item = styled.li<{ + width: string; +}>(({ width }) => css({ flex: 1, + flexBasis: width, position: 'relative', }) ); @@ -106,6 +104,7 @@ const Item = styled.li( const LegendaColor = styled.div<{ first?: boolean; last?: boolean; + width?: string; color: string; }>((x) => css({ @@ -113,6 +112,7 @@ const LegendaColor = styled.div<{ height: '10px', flexGrow: 0, flexShrink: 0, + flexBasis: x.width, borderRadius: x.first ? '2px 0 0 2px' : x.last ? '0 2px 2px 0' : 0, backgroundColor: x.color, }) diff --git a/packages/app/src/components/choropleth-tile.tsx b/packages/app/src/components/choropleth-tile.tsx index 3556fc5405..513c06c6b5 100644 --- a/packages/app/src/components/choropleth-tile.tsx +++ b/packages/app/src/components/choropleth-tile.tsx @@ -3,10 +3,7 @@ import { ChoroplethLegenda } from '~/components/choropleth-legenda'; import { DataProps } from '~/types/attributes'; import { useBreakpoints } from '~/utils/use-breakpoints'; import { Box } from './base'; -import { - ChartRegionControls, - RegionControlOption, -} from './chart-region-controls'; +import { ChartRegionControls, RegionControlOption } from './chart-region-controls'; import { ErrorBoundary } from './error-boundary'; import { FullscreenChartTile } from './fullscreen-chart-tile'; import { MetadataProps } from './metadata'; @@ -20,10 +17,12 @@ type ChoroplethTileProps = DataProps & { title: string; thresholds: ChoroplethThresholdsValue[]; type?: 'default' | 'bar'; + outdatedDataLabel?: string; }; metadata?: MetadataProps; valueAnnotation?: string; hasPadding?: boolean; + pageType?: string; } & ( | { onChartRegionChange: (v: RegionControlOption) => void; @@ -45,6 +44,7 @@ export function ChoroplethTile({ metadata, valueAnnotation, hasPadding, + pageType, ...dataProps }: ChoroplethTileProps) { const breakpoints = useBreakpoints(true); @@ -55,40 +55,23 @@ export function ChoroplethTile({ title={legend.title} valueAnnotation={valueAnnotation} type={legend.type} + pageType={pageType} + outdatedDataLabel={legend.outdatedDataLabel} /> </Box> ); return ( <FullscreenChartTile metadata={metadata}> - <Box - display="flex" - flexDirection={{ _: 'column', lg: 'row' }} - m={0} - as="figure" - {...dataProps} - height="100%" - spacing={3} - > + <Box display="flex" flexDirection={{ _: 'column', lg: 'row' }} m={0} as="figure" {...dataProps} height="100%" spacing={3}> <Box flex={{ lg: 1 }} as="figcaption" spacing={3}> <Heading level={3}>{title}</Heading> - {typeof description === 'string' ? ( - <Text>{description}</Text> - ) : ( - description - )} + {typeof description === 'string' ? <Text>{description}</Text> : description} {onChartRegionChange && chartRegion && ( - <Box - display="flex" - justifyContent={{ _: 'center', lg: 'flex-start' }} - pt={4} - > - <ChartRegionControls - value={chartRegion} - onChange={onChartRegionChange} - /> + <Box display="flex" justifyContent={{ _: 'center', lg: 'flex-start' }} pt={4}> + <ChartRegionControls value={chartRegion} onChange={onChartRegionChange} /> </Box> )} @@ -99,18 +82,8 @@ export function ChoroplethTile({ )} </Box> - <Box - flex={{ lg: 1 }} - display="flex" - flexDirection="column" - height="100%" - spacing={3} - > - <Box - height="100%" - mt={4} - pl={hasPadding && breakpoints.lg ? 4 : undefined} - > + <Box flex={{ lg: 1 }} display="flex" flexDirection="column" height="100%" spacing={3}> + <Box height="100%" mt={4} pl={hasPadding && breakpoints.lg ? 4 : undefined}> <ErrorBoundary>{children}</ErrorBoundary> </Box> diff --git a/packages/app/src/components/choropleth/logic/thresholds.ts b/packages/app/src/components/choropleth/logic/thresholds.ts index 465b87704f..8775e41609 100644 --- a/packages/app/src/components/choropleth/logic/thresholds.ts +++ b/packages/app/src/components/choropleth/logic/thresholds.ts @@ -1,9 +1,6 @@ import { colors } from '@corona-dashboard/common'; import { MapType } from '~/components/choropleth/logic'; -import { - BehaviorIdentifier, - behaviorIdentifiers, -} from '~/domain/behavior/logic/behavior-types'; +import { BehaviorIdentifier, behaviorIdentifiers } from '~/domain/behavior/logic/behavior-types'; const positiveTestedThresholds: ChoroplethThresholdsValue[] = [ { @@ -376,21 +373,21 @@ type Thresholds = Record<MapType, Record<string, ChoroplethThresholdsValue[]>>; export const thresholds: Thresholds = { gm: { infected_per_100k: positiveTestedThresholds, - admissions_on_date_of_admission_per_100000: - hospitalAdmissionsPer100000Thresholds, + admissions_on_date_of_admission_per_100000: hospitalAdmissionsPer100000Thresholds, admissions_on_date_of_admission: hospitalAdmissionsThresholds, elderly_at_home: elderlyAtHomeThresholds, average: sewerThresholds, fully_vaccinated_percentage: vaccineCoveragePercentageThresholds, - has_one_shot_percentage: vaccineCoveragePercentageThresholds, - booster_shot_percentage: vaccineCoveragePercentageThresholds, + primary_series_percentage: vaccineCoveragePercentageThresholds, autumn_2022_vaccinated_percentage: vaccineCoveragePercentageThresholds, + vaccinated_percentage_12_plus: vaccineCoveragePercentageThresholds, + vaccinated_percentage_18_plus: vaccineCoveragePercentageThresholds, + vaccinated_percentage_60_plus: vaccineCoveragePercentageThresholds, }, vr: { infected_per_100k: positiveTestedThresholds, admissions_on_date_of_admission: vrHospitalAdmissionsThresholds, - admissions_on_date_of_admission_per_100000: - hospitalAdmissionsPer100000Thresholds, + admissions_on_date_of_admission_per_100000: hospitalAdmissionsPer100000Thresholds, infected_locations_percentage: infectedLocationsPercentageThresholds, average: sewerThresholds, positive_tested_daily_per_100k: elderlyAtHomeThresholds, @@ -404,22 +401,17 @@ export const thresholds: Thresholds = { travel: situationsThreshold, hospitality: situationsThreshold, fully_vaccinated_percentage: vaccineCoveragePercentageThresholds, - has_one_shot_percentage: vaccineCoveragePercentageThresholds, - booster_shot_percentage: vaccineCoveragePercentageThresholds, + primary_series_percentage: vaccineCoveragePercentageThresholds, autumn_2022_vaccinated_percentage: vaccineCoveragePercentageThresholds, + vaccinated_percentage_12_plus: vaccineCoveragePercentageThresholds, + vaccinated_percentage_18_plus: vaccineCoveragePercentageThresholds, + vaccinated_percentage_60_plus: vaccineCoveragePercentageThresholds, other: situationsThreshold, - ...(Object.fromEntries( - behaviorIdentifiers.map((key) => [ - `${key}_support`, - behaviorSupportThresholds, - ]) - ) as Record<`${BehaviorIdentifier}_support`, ChoroplethThresholdsValue[]>), - ...(Object.fromEntries( - behaviorIdentifiers.map((key) => [ - `${key}_compliance`, - behaviorComplianceThresholds, - ]) - ) as Record< + ...(Object.fromEntries(behaviorIdentifiers.map((key) => [`${key}_support`, behaviorSupportThresholds])) as Record< + `${BehaviorIdentifier}_support`, + ChoroplethThresholdsValue[] + >), + ...(Object.fromEntries(behaviorIdentifiers.map((key) => [`${key}_compliance`, behaviorComplianceThresholds])) as Record< `${BehaviorIdentifier}_compliance`, ChoroplethThresholdsValue[] >), diff --git a/packages/app/src/components/choropleth/logic/use-fill-color.ts b/packages/app/src/components/choropleth/logic/use-fill-color.ts index 68088f29c0..3d77af034f 100644 --- a/packages/app/src/components/choropleth/logic/use-fill-color.ts +++ b/packages/app/src/components/choropleth/logic/use-fill-color.ts @@ -1,4 +1,4 @@ -import { assert, ChoroplethThresholdsValue } from '@corona-dashboard/common'; +import { assert, ChoroplethThresholdsValue, colors } from '@corona-dashboard/common'; import { scaleThreshold } from 'd3-scale'; import { useMemo } from 'react'; import { isDefined, isPresent } from 'ts-is-present'; @@ -17,70 +17,73 @@ import { isCodedValueType } from './utils'; * @param dataConfig * @returns */ -export function useFillColor<T extends ChoroplethDataItem>( - data: T[], - map: MapType, - dataConfig: DataConfig<T>, - thresholdMap?: MapType -) { +export function useFillColor<T extends ChoroplethDataItem>(data: T[], map: MapType, dataConfig: DataConfig<T>, thresholdMap?: MapType) { const codeType = mapToCodeType[map]; const { metricProperty, noDataFillColor } = dataConfig; - const getValueByCode = useMemo( - () => createGetValueByCode(metricProperty, codeType, data), - [metricProperty, codeType, data] - ); + const getValueByCode = useMemo(() => createGetValueByCode(metricProperty, codeType, data), [metricProperty, codeType, data]); + + const getIsOutdatedByCode = useMemo(() => createIsOutdatedByCode(codeType, data), [codeType, data]); const threshold = thresholds[thresholdMap || map][metricProperty as string]; - assert( - isDefined(threshold), - `[${ - useFillColor.name - }] No threshold configured for map type ${map} and metric property ${metricProperty.toString()}` - ); + assert(isDefined(threshold), `[${useFillColor.name}] No threshold configured for map type ${map} and metric property ${metricProperty.toString()}`); const colorScale = useMemo(() => createColorScale(threshold), [threshold]); - return useMemo( - () => createGetFillColor(getValueByCode, colorScale, noDataFillColor), - [getValueByCode, colorScale, noDataFillColor] - ); + return useMemo(() => createGetFillColor(getValueByCode, getIsOutdatedByCode, colorScale, noDataFillColor), [getValueByCode, getIsOutdatedByCode, colorScale, noDataFillColor]); } -export function getFillColor<T extends ChoroplethDataItem>( - data: T[], - map: MapType, - dataConfig: DataConfig<T>, - thresholdMap?: MapType -) { +export function getFillColor<T extends ChoroplethDataItem>(data: T[], map: MapType, dataConfig: DataConfig<T>, thresholdMap?: MapType) { const codeType = mapToCodeType[map]; const { metricProperty, noDataFillColor } = dataConfig; const getValueByCode = createGetValueByCode(metricProperty, codeType, data); + const getIsOutdatedByCode = createIsOutdatedByCode(codeType, data); + const threshold = thresholds[thresholdMap || map][metricProperty as string]; - assert( - isDefined(threshold), - `[${ - getFillColor.name - }] No threshold configured for map type ${map} and metric property ${metricProperty.toString()}` - ); + assert(isDefined(threshold), `[${getFillColor.name}] No threshold configured for map type ${map} and metric property ${metricProperty.toString()}`); const colorScale = createColorScale(threshold); - return createGetFillColor(getValueByCode, colorScale, noDataFillColor); + return createGetFillColor(getValueByCode, getIsOutdatedByCode, colorScale, noDataFillColor); } function createGetFillColor( getValueByCode: ReturnType<typeof createGetValueByCode>, + getIsOutdatedByCode: ReturnType<typeof createIsOutdatedByCode>, colorScale: ReturnType<typeof createColorScale>, noDataFillColor: string ) { return (code: string) => { const value = getValueByCode(code); - const result = isPresent(value) ? colorScale(value) : noDataFillColor; + const shouldOverrideDefaultColor = getIsOutdatedByCode(code); + let result = noDataFillColor; + + if (isPresent(value)) result = colorScale(value); + + // Override the default color scale when a datapoint contains outdated data. + if (shouldOverrideDefaultColor) result = colors.yellow1; + return result; }; } +// Returns a function which returns a boolean when the datapoint (matching the code passed in) contains outdated data. +function createIsOutdatedByCode<T extends ChoroplethDataItem>(codeType: CodeProp, data: T[]): (code: string) => boolean { + return (code: string) => { + const dataPointByCode = data.find((dataPoint) => { + if ((dataPoint as unknown as Record<string, string>)[codeType] === code) { + return dataPoint; + } + }); + + if (dataPointByCode && 'data_is_outdated' in dataPointByCode) { + return dataPointByCode.data_is_outdated; + } + + return false; + }; +} + function createColorScale(threshold: ChoroplethThresholdsValue<number>[]) { const domain = threshold.map((t) => t.threshold); domain.shift(); @@ -91,11 +94,7 @@ function createColorScale(threshold: ChoroplethThresholdsValue<number>[]) { return color; } -function createGetValueByCode<T extends ChoroplethDataItem>( - metricProperty: keyof T, - codeType: CodeProp, - data: T[] -) { +function createGetValueByCode<T extends ChoroplethDataItem>(metricProperty: keyof T, codeType: CodeProp, data: T[]) { return (code: string) => { const item = data .filter((x) => { @@ -104,8 +103,6 @@ function createGetValueByCode<T extends ChoroplethDataItem>( }) .find((x) => (x as unknown as Record<string, string>)[codeType] === code); - return isDefined(item) && isPresent(item[metricProperty]) - ? Number(item[metricProperty]) - : undefined; + return isDefined(item) && isPresent(item[metricProperty]) ? Number(item[metricProperty]) : undefined; }; } diff --git a/packages/app/src/components/choropleth/tooltips/choropleth-tooltip.tsx b/packages/app/src/components/choropleth/tooltips/choropleth-tooltip.tsx index c2281a4448..c593efe39f 100644 --- a/packages/app/src/components/choropleth/tooltips/choropleth-tooltip.tsx +++ b/packages/app/src/components/choropleth/tooltips/choropleth-tooltip.tsx @@ -4,9 +4,10 @@ import { Markdown, VisuallyHidden } from '~/components'; import { Box } from '~/components/base'; import { useIntl } from '~/intl'; import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; -import { ChoroplethDataItem } from '../logic'; +import { ChoroplethDataItem, isVrData } from '../logic'; import { TooltipContent } from './tooltip-content'; import { TooltipSubject } from './tooltip-subject'; +import { TooltipNotification } from './tooltip-notification'; import { TooltipData } from './types'; type ChoroplethDataItemProps<T extends ChoroplethDataItem> = { @@ -14,61 +15,29 @@ type ChoroplethDataItemProps<T extends ChoroplethDataItem> = { dataFormatters?: Partial<Record<keyof T, (input: string | number) => string>>; }; -export function ChoroplethTooltip<T extends ChoroplethDataItem>( - props: ChoroplethDataItemProps<T> -) { +export function ChoroplethTooltip<T extends ChoroplethDataItem>(props: ChoroplethDataItemProps<T>) { const { data, dataFormatters } = props; - const { - commonTexts, - formatNumber, - formatPercentage, - formatDate, - formatDateFromSeconds, - formatDateFromMilliseconds, - formatRelativeDate, - formatDateSpan, - } = useIntl(); + const { commonTexts, formatNumber, formatPercentage, formatDate, formatDateFromSeconds, formatDateFromMilliseconds, formatRelativeDate, formatDateSpan } = useIntl(); const text = commonTexts.choropleth_tooltip; - const subject = ( - text as unknown as Record<string, Record<string, Record<string, string>>> - )[data.map]?.[data.dataConfig.metricProperty as string]?.subject; - assert( - isDefined(subject), - `[${ - ChoroplethTooltip.name - }] No tooltip subject found in siteText.choropleth_tooltip.${ - data.map - }.${data.dataConfig.metricProperty.toString()}` - ); + const subject = (text as unknown as Record<string, Record<string, Record<string, string>>>)[data.map]?.[data.dataConfig.metricProperty as string]?.subject; + assert(isDefined(subject), `[${ChoroplethTooltip.name}] No tooltip subject found in siteText.choropleth_tooltip.${data.map}.${data.dataConfig.metricProperty.toString()}`); - const tooltipContent = ( - text as unknown as Record<string, Record<string, Record<string, string>>> - )[data.map]?.[data.dataConfig.metricProperty as string]?.content; - assert( - isDefined(tooltipContent), - `[${ - ChoroplethTooltip.name - }] No tooltip content found in siteText.choropleth_tooltip.${ - data.map - }.${data.dataConfig.metricProperty.toString()}` - ); + const tooltipContent = (text as unknown as Record<string, Record<string, Record<string, string>>>)[data.map]?.[data.dataConfig.metricProperty as string]?.content; + assert(isDefined(tooltipContent), `[${ChoroplethTooltip.name}] No tooltip content found in siteText.choropleth_tooltip.${data.map}.${data.dataConfig.metricProperty.toString()}`); const tooltipVars = { ...data.dataItem, ...data.dataOptions.tooltipVariables, } as Record<string, string | number>; - const formattedTooltipVars = Object.entries(dataFormatters || {}).reduce( - (acc, [key, formatter]) => { - return { - ...acc, - [key]: formatter(tooltipVars[key]), - }; - }, - tooltipVars - ); + const formattedTooltipVars = Object.entries(dataFormatters || {}).reduce((accumulator, [key, formatter]) => { + return { + ...accumulator, + [key]: formatter(tooltipVars[key]), + }; + }, tooltipVars); const content = replaceVariablesInText(tooltipContent, formattedTooltipVars, { formatNumber, @@ -85,25 +54,36 @@ export function ChoroplethTooltip<T extends ChoroplethDataItem>( const dataItem = data.dataItem[data.dataConfig.metricProperty]; const filterBelow = typeof dataItem === 'number' ? dataItem : null; + const showNotification = tooltipVars?.data_is_outdated; + let outdatedDataDate; + let tooltipNotification; + if (showNotification) { + tooltipNotification = (text as unknown as Record<string, Record<string, Record<string, string>>>)[data.map]?.[data.dataConfig.metricProperty as string] + ?.outdated_data_notification; + assert( + isDefined(tooltipNotification), + `[${ChoroplethTooltip.name}] No tooltip notification found in siteText.choropleth_tooltip.${data.map}.${data.dataConfig.metricProperty.toString()}` + ); + + // VRData does not contain the property 'date_end_unix' so 'date_unix' is used instead. + outdatedDataDate = formatDateFromSeconds(tooltipVars[!isVrData(tooltipVars) ? 'date_end_unix' : 'date_unix'] as number, 'medium'); + tooltipNotification = replaceVariablesInText(tooltipNotification as string, { date: outdatedDataDate }); + } + return ( - <TooltipContent - title={data.featureName} - link={ - data.dataOptions.getLink - ? data.dataOptions.getLink(data.code) - : undefined - } - > - <TooltipSubject - subject={replaceVariablesInText(subject, tooltipVars)} - thresholdValues={data.thresholdValues} - filterBelow={filterBelow} - > + <TooltipContent title={data.featureName} link={data.dataOptions.getLink ? data.dataOptions.getLink(data.code) : undefined}> + <TooltipSubject subject={replaceVariablesInText(subject, tooltipVars)} thresholdValues={data.thresholdValues} filterBelow={filterBelow}> <VisuallyHidden>{ariaContent}</VisuallyHidden> <Box aria-hidden> <Markdown content={content} /> </Box> </TooltipSubject> + + {showNotification && outdatedDataDate && tooltipNotification && ( + <TooltipNotification ariaContent={tooltipNotification}> + <Markdown content={tooltipNotification} /> + </TooltipNotification> + )} </TooltipContent> ); } diff --git a/packages/app/src/components/choropleth/tooltips/tooltip-content.tsx b/packages/app/src/components/choropleth/tooltips/tooltip-content.tsx index 2d71593db3..048307e4c3 100644 --- a/packages/app/src/components/choropleth/tooltips/tooltip-content.tsx +++ b/packages/app/src/components/choropleth/tooltips/tooltip-content.tsx @@ -3,6 +3,7 @@ import css from '@styled-system/css'; import { ReactNode } from 'react'; import styled from 'styled-components'; import { Text } from '~/components/typography'; +import { space } from '~/style/theme'; import { useIsTouchDevice } from '~/utils/use-is-touch-device'; interface IProps { @@ -17,11 +18,7 @@ export function TooltipContent(props: IProps) { const isTouch = useIsTouchDevice(); return ( - <StyledTooltipContent - isInteractive={isTouch} - onClick={onSelect} - aria-live="polite" - > + <StyledTooltipContent isInteractive={isTouch} onClick={onSelect} aria-live="polite"> <TooltipHeader href={link}> <Text variant="choroplethTooltipHeader"> <StyledLocationIcon> @@ -47,13 +44,7 @@ const StyledTooltipContent = styled.div<{ isInteractive: boolean }>((x) => }) ); -function TooltipHeader({ - href, - children, -}: { - href?: string; - children: ReactNode; -}) { +function TooltipHeader({ href, children }: { href?: string; children: ReactNode }) { if (href) { return ( <StyledTooltipHeader href={href} as="a"> @@ -96,8 +87,7 @@ const TooltipInfo = styled.div( cursor: 'pointer', borderTop: '1px solid', borderTopColor: 'gray3', - py: 2, - px: 3, + padding: `${space[2]} ${space[3]}`, }) ); diff --git a/packages/app/src/components/choropleth/tooltips/tooltip-notification.tsx b/packages/app/src/components/choropleth/tooltips/tooltip-notification.tsx new file mode 100644 index 0000000000..51e44c9975 --- /dev/null +++ b/packages/app/src/components/choropleth/tooltips/tooltip-notification.tsx @@ -0,0 +1,28 @@ +import { colors } from '@corona-dashboard/common'; +import { VisuallyHidden } from '~/components'; +import { space } from '~/style/theme'; +import styled from 'styled-components'; + +interface TooltipNotificationProps { + children: React.ReactNode; + ariaContent?: string; +} + +export const TooltipNotification = (props: TooltipNotificationProps) => { + const { children, ariaContent } = props; + + return ( + <StyledTooltipNotification> + {ariaContent && <VisuallyHidden>{ariaContent.replace(/(\n|\*)/g, '')}</VisuallyHidden>} + + {children} + </StyledTooltipNotification> + ); +}; + +// Negative margin is used her to offset the padding from the parent component and to not alter styles for tooltips without a notification. +const StyledTooltipNotification = styled.div` + background-color: ${colors.yellow1}; + margin: ${space[2]} -${space[3]} -${space[2]}; + padding: ${space[2]} ${space[3]}; +`; diff --git a/packages/app/src/components/choropleth/tooltips/tooltip-subject.tsx b/packages/app/src/components/choropleth/tooltips/tooltip-subject.tsx index e1ef6ff5a7..3ae6733424 100644 --- a/packages/app/src/components/choropleth/tooltips/tooltip-subject.tsx +++ b/packages/app/src/components/choropleth/tooltips/tooltip-subject.tsx @@ -4,6 +4,7 @@ import { ReactNode } from 'react'; import { isDefined, isPresent } from 'ts-is-present'; import { Box } from '~/components/base'; import { BoldText } from '~/components/typography'; +import { space } from '~/style/theme'; import { getThresholdValue } from '~/utils/get-threshold-value'; interface TooltipSubjectProps { @@ -14,13 +15,7 @@ interface TooltipSubjectProps { noDataFillColor?: string; } -export function TooltipSubject({ - subject, - thresholdValues, - filterBelow, - children, - noDataFillColor, -}: TooltipSubjectProps) { +export function TooltipSubject({ subject, thresholdValues, filterBelow, children, noDataFillColor }: TooltipSubjectProps) { const color = !isPresent(filterBelow) && isDefined(thresholdValues) ? noDataFillColor || getThresholdValue(thresholdValues, 0).color @@ -32,26 +27,17 @@ export function TooltipSubject({ <Box spacing={1}> {subject && <BoldText>{subject}</BoldText>} <Box - m={0} + margin={space[0]} spacingHorizontal={2} + display="flex" + alignItems="center" + flexWrap="nowrap" css={css({ - display: 'flex', - alignItems: 'center', - flexWrap: 'nowrap', whiteSpace: 'pre-wrap', })} > {children} - <Box - flexShrink={0} - height={13} - width={13} - borderRadius={'2px'} - ml={'auto'} - mb={'auto'} - mt={'5px'} - backgroundColor={color} - /> + <Box flexShrink={0} height="13px" width="13px" borderRadius="2px" marginLeft="auto" marginBottom="auto" marginTop="5px" backgroundColor={color} /> </Box> </Box> ); diff --git a/packages/app/src/components/choropleth/tooltips/tooltip.tsx b/packages/app/src/components/choropleth/tooltips/tooltip.tsx index 7e5d771716..82f78a7df6 100644 --- a/packages/app/src/components/choropleth/tooltips/tooltip.tsx +++ b/packages/app/src/components/choropleth/tooltips/tooltip.tsx @@ -28,25 +28,14 @@ const padding = { top: 12, }; -export function Tooltip<T extends ChoroplethDataItem>({ - left, - top, - formatTooltip, - data, - dataFormatters, - placement = 'bottom-right', -}: TTooltipProps<T>) { +export function Tooltip<T extends ChoroplethDataItem>({ left, top, formatTooltip, data, dataFormatters, placement = 'bottom-right' }: TTooltipProps<T>) { const viewportSize = useViewport(); const isMounted = useIsMounted({ delayMs: 10 }); const [ref, { height = 0 }] = useResizeObserver<HTMLDivElement>(); const [boundingBox, boundingBoxRef] = useBoundingBox<HTMLDivElement>(); const isTouch = useIsTouchDevice(); - const content = isDefined(formatTooltip) ? ( - formatTooltip(data) - ) : ( - <ChoroplethTooltip data={data} dataFormatters={dataFormatters} /> - ); + const content = isDefined(formatTooltip) ? formatTooltip(data) : <ChoroplethTooltip data={data} dataFormatters={dataFormatters} />; if (!content) return null; @@ -56,25 +45,16 @@ export function Tooltip<T extends ChoroplethDataItem>({ const maxx = boundingBox?.width ?? 400; const maxy = viewportSize.height ?? 480; - const t = ( - placement: ChoroplethTooltipPlacement, - top: number, - left: number - ): string => { + const t = (placement: ChoroplethTooltipPlacement, top: number, left: number): string => { switch (placement) { case 'top-center': { - const xt = (current: number) => - Math.round((100 * (current - minx)) / (maxx - minx)); + const xt = (current: number) => Math.round((100 * (current - minx)) / (maxx - minx)); return `translateX(-${xt(left)}%)`; } case 'bottom-right': default: { - const xt = (current: number) => - Math.round((100 * (current - minx)) / (maxx - minx)); - const yt = (current: number) => - Math.round( - current > maxy / 2 ? -(height + padding.top) : padding.top - ); + const xt = (current: number) => Math.round((100 * (current - minx)) / (maxx - minx)); + const yt = (current: number) => Math.round(current > maxy / 2 ? -(height + padding.top) : padding.top); const bboxTop = boundingBox?.top ?? 0; return `translate(-${xt(left)}%, ${yt(bboxTop + top)}px)`; } @@ -82,18 +62,8 @@ export function Tooltip<T extends ChoroplethDataItem>({ }; return ( - <Box - ref={boundingBoxRef} - position="absolute" - top="0" - left="0" - width="100%" - height="100%" - > - <Box - position="absolute" - style={{ top, left, width: '1px', height: '1px' }} - > + <Box ref={boundingBoxRef} position="absolute" top="0" left="0" width="100%" height="100%"> + <Box position="absolute" style={{ top, left, width: '1px', height: '1px' }}> <Box bg="white" ref={ref} diff --git a/packages/app/src/domain/measures/types.ts b/packages/app/src/domain/measures/types.ts index eebc2a642a..ae40da03a0 100644 --- a/packages/app/src/domain/measures/types.ts +++ b/packages/app/src/domain/measures/types.ts @@ -1,5 +1,5 @@ import { Measures } from '~/types/cms'; export interface GeldendeAdviezenData { - measures: Measures; -}; \ No newline at end of file + measures: Measures; +} diff --git a/packages/app/src/domain/vaccine/common.ts b/packages/app/src/domain/vaccine/common.ts index f20a5929ab..47a0b67a7a 100644 --- a/packages/app/src/domain/vaccine/common.ts +++ b/packages/app/src/domain/vaccine/common.ts @@ -1,4 +1,4 @@ -import { colors } from '@corona-dashboard/common'; +import { colors, GmCollectionVaccineCoveragePerAgeGroup, VrCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; export const COLOR_FULLY_VACCINATED = colors.scale.blueDetailed[3]; export const COLOR_FULLY_BOOSTERED = colors.scale.blue[5]; @@ -9,15 +9,37 @@ export const ARCHIVED_COLORS = { COLOR_FULLY_VACCINATED: colors.primary, }; -type FullyVaccinatedAges = '12+' | '18+'; -type Autumn2022Vaccinated = '12+' | '60+'; +// set Age groups once inside AllAgeGroups and use them on the AgeGroups type and variable +const AllAgeGroups = ['12', '18', '60'] as const; +type AgeGroupsCombined = typeof AllAgeGroups; +export type AgeGroups = AgeGroupsCombined[number]; +export const ageGroups = Object.values(AllAgeGroups); + +type PrimarySeriesVaccinatedAges = Extract<AgeGroups, '18' | '12'>; +type Autumn2022Vaccinated = Extract<AgeGroups, '60' | '12'>; type MatchingVaccineCoverageAgeGroupsType = { - autumn_2022_vaccinated_percentage: Autumn2022Vaccinated[]; - fully_vaccinated_percentage: FullyVaccinatedAges[]; + autumn_2022: Autumn2022Vaccinated[]; + primary_series: PrimarySeriesVaccinatedAges[]; }; +export type VaccineCoverageData = GmCollectionVaccineCoveragePerAgeGroup | VrCollectionVaccineCoveragePerAgeGroup; + export const matchingAgeGroups: MatchingVaccineCoverageAgeGroupsType = { - autumn_2022_vaccinated_percentage: ['12+', '60+'], - fully_vaccinated_percentage: ['12+', '18+'], + autumn_2022: ['60', '12'], + primary_series: ['18', '12'], +}; + +export type PercentageKeysOfAgeGroups = Pick<VaccineCoverageData, 'vaccinated_percentage_12_plus' | 'vaccinated_percentage_18_plus' | 'vaccinated_percentage_60_plus'>; + +export type PercentageLabelKeysOfAgeGroups = Pick< + VaccineCoverageData, + 'vaccinated_percentage_12_plus_label' | 'vaccinated_percentage_18_plus_label' | 'vaccinated_percentage_60_plus_label' +>; +export type BirthyearRangeKeysOfAgeGroups = Pick<VaccineCoverageData, 'birthyear_range_12_plus' | 'birthyear_range_18_plus' | 'birthyear_range_60_plus'>; + +export type DataPerAgeGroup = { + birthyear_range_plus: BirthyearRangeKeysOfAgeGroups; + vaccinated_percentage_plus: PercentageKeysOfAgeGroups; + vaccinated_percentage_plus_label: PercentageLabelKeysOfAgeGroups; }; diff --git a/packages/app/src/domain/vaccine/components/age-group-select.tsx b/packages/app/src/domain/vaccine/components/age-group-select.tsx index 35262b893c..6a3c6de0bd 100644 --- a/packages/app/src/domain/vaccine/components/age-group-select.tsx +++ b/packages/app/src/domain/vaccine/components/age-group-select.tsx @@ -8,19 +8,19 @@ import { useIntl } from '~/intl'; import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; import { parseBirthyearRange } from '../logic/parse-birthyear-range'; -export type AgeGroup = '12+' | '18+' | '60+'; +export type AgeGroup = '12' | '18' | '60'; const AGE_GROUPS = [ { - ageGroup: '60+', + ageGroup: '60', birthyearRange: '-1961', }, { - ageGroup: '18+', + ageGroup: '18', birthyearRange: '-2003', }, { - ageGroup: '12+', + ageGroup: '12', birthyearRange: '-2009', }, ] as const; @@ -32,7 +32,7 @@ type AgeGroupSelectProps = { }; export function AgeGroupSelect(props: AgeGroupSelectProps) { - const { onChange, initialValue = '18+', shownAgeGroups } = props; + const { onChange, initialValue = '18', shownAgeGroups } = props; const { commonTexts } = useIntl(); diff --git a/packages/app/src/domain/vaccine/components/vaccination-coverage-kind-select.tsx b/packages/app/src/domain/vaccine/components/vaccination-coverage-kind-select.tsx index c4aca57eaf..88c3a49760 100644 --- a/packages/app/src/domain/vaccine/components/vaccination-coverage-kind-select.tsx +++ b/packages/app/src/domain/vaccine/components/vaccination-coverage-kind-select.tsx @@ -6,24 +6,17 @@ import { Option } from '~/components/rich-content-select/types'; import { Text } from '~/components/typography'; import { useIntl } from '~/intl'; -export type CoverageKindProperty = - | 'autumn_2022_vaccinated_percentage' - | 'fully_vaccinated_percentage'; +export type CoverageKindProperty = 'autumn_2022' | 'primary_series'; -const COVERAGE_KINDS: CoverageKindProperty[] = [ - 'autumn_2022_vaccinated_percentage', - 'fully_vaccinated_percentage', -]; +const COVERAGE_KINDS: CoverageKindProperty[] = ['autumn_2022', 'primary_series']; type VaccinationCoverageKindSelectProps = { onChange: (value: CoverageKindProperty) => void; initialValue?: CoverageKindProperty; }; -export function VaccinationCoverageKindSelect( - props: VaccinationCoverageKindSelectProps -) { - const { onChange, initialValue = 'fully_vaccinated_percentage' } = props; +export function VaccinationCoverageKindSelect(props: VaccinationCoverageKindSelectProps) { + const { onChange, initialValue = 'primary_series' } = props; const { commonTexts } = useIntl(); diff --git a/packages/app/src/domain/vaccine/data-selection/select-vaccine-coverage-data.ts b/packages/app/src/domain/vaccine/data-selection/select-vaccine-coverage-data.ts deleted file mode 100644 index d97211f8e1..0000000000 --- a/packages/app/src/domain/vaccine/data-selection/select-vaccine-coverage-data.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { - GmCollectionVaccineCoveragePerAgeGroup, - VrCollectionVaccineCoveragePerAgeGroup, - VrVaccineCoveragePerAgeGroupValue, -} from '@corona-dashboard/common'; -import { isPresent } from 'ts-is-present'; -import { parseVaccinatedPercentageLabel } from '../logic/parse-vaccinated-percentage-label'; - -export function selectVaccineCoverageData< - T extends - | GmCollectionVaccineCoveragePerAgeGroup - | VrCollectionVaccineCoveragePerAgeGroup - | VrVaccineCoveragePerAgeGroupValue ->(data: T[]) { - return data.map((vaccineCoveragePerAgeGroup) => { - const parsedLabels: { - fully_vaccinated_percentage?: number; - autumn_2022_vaccinated_percentage?: number; - } = {}; - - if (isPresent(vaccineCoveragePerAgeGroup.fully_vaccinated_percentage_label)) { - const result = parseVaccinatedPercentageLabel( - vaccineCoveragePerAgeGroup.fully_vaccinated_percentage_label - ); - - if (isPresent(result)) { - parsedLabels.fully_vaccinated_percentage = - result.sign === '>' ? 100 : 0; - } - } - - if (isPresent(vaccineCoveragePerAgeGroup.autumn_2022_vaccinated_percentage_label)) { - const result = parseVaccinatedPercentageLabel( - vaccineCoveragePerAgeGroup.autumn_2022_vaccinated_percentage_label - ); - - if (isPresent(result)) { - parsedLabels.autumn_2022_vaccinated_percentage = - result.sign === '>' ? 100 : 0; - } - } - - return { ...vaccineCoveragePerAgeGroup, ...parsedLabels }; - }); -} diff --git a/packages/app/src/domain/vaccine/index.ts b/packages/app/src/domain/vaccine/index.ts index 6053218406..dda47aab72 100644 --- a/packages/app/src/domain/vaccine/index.ts +++ b/packages/app/src/domain/vaccine/index.ts @@ -1,5 +1,4 @@ export { selectAdministrationData } from './data-selection/select-administration-data'; -export { selectVaccineCoverageData } from './data-selection/select-vaccine-coverage-data'; export { BoosterShotCoveragePerAgeGroup } from './booster-shot-coverage-per-age-group/booster-shot-coverage-per-age-group'; export { Autumn2022ShotCoveragePerAgeGroup } from './autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group'; export { VaccinationsOverTimeTile } from './vaccinations-over-time-tile'; diff --git a/packages/app/src/domain/vaccine/logic/use-agegroup-labels.ts b/packages/app/src/domain/vaccine/logic/use-agegroup-labels.ts deleted file mode 100644 index 97037ae019..0000000000 --- a/packages/app/src/domain/vaccine/logic/use-agegroup-labels.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { - GmVaccineCoveragePerAgeGroupValue, - VrVaccineCoveragePerAgeGroupValue, -} from '@corona-dashboard/common'; -import { useMemo } from 'react'; -import { isDefined } from 'ts-is-present'; -import { useIntl } from '~/intl'; -import { getRenderedVaccinatedLabel } from './parse-vaccinated-percentage-label'; - -export function useAgegroupLabels( - dataValue: - | VrVaccineCoveragePerAgeGroupValue - | GmVaccineCoveragePerAgeGroupValue - | undefined, - lowerCased?: boolean -) { - const { commonTexts, formatPercentage } = useIntl(); - const labelsText = commonTexts.common; - - return useMemo(() => { - const fullyVaccinatedLabel = isDefined(dataValue) - ? getRenderedVaccinatedLabel( - dataValue.fully_vaccinated_percentage_label, - dataValue.fully_vaccinated_percentage, - labelsText.meer_dan, - labelsText.minder_dan, - formatPercentage - ) - : '0'; - const oneShotLabel = isDefined(dataValue) - ? getRenderedVaccinatedLabel( - dataValue.autumn_2022_vaccinated_percentage_label, - dataValue.autumn_2022_vaccinated_percentage, - labelsText.meer_dan, - labelsText.minder_dan, - formatPercentage - ) - : '0'; - - return { - fully_vaccinated_percentage: lowerCased - ? fullyVaccinatedLabel.toLocaleLowerCase() - : fullyVaccinatedLabel, - autumn_2022_vaccinated_percentage: lowerCased - ? oneShotLabel.toLocaleLowerCase() - : oneShotLabel, - }; - }, [ - dataValue, - labelsText.meer_dan, - labelsText.minder_dan, - formatPercentage, - lowerCased, - ]); -} diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx index 1325aadc7a..b8b4c4b66c 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx @@ -1,9 +1,9 @@ import { colors, GmCollectionVaccineCoveragePerAgeGroup, VrCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; import { SiteText } from '~/locale'; -import { matchingAgeGroups } from './common'; +import { matchingAgeGroups, VaccineCoverageData, DataPerAgeGroup, BirthyearRangeKeysOfAgeGroups, PercentageKeysOfAgeGroups, PercentageLabelKeysOfAgeGroups } from './common'; import css from '@styled-system/css'; import { useState } from 'react'; -import { hasValueAtKey } from 'ts-is-present'; +import { space } from '~/style/theme'; import { Box } from '~/components/base'; import { RegionControlOption } from '~/components/chart-region-controls'; import { DynamicChoropleth } from '~/components/choropleth'; @@ -18,7 +18,7 @@ import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; import { useReverseRouter } from '~/utils/use-reverse-router'; import { AgeGroup, AgeGroupSelect } from './components/age-group-select'; import { CoverageKindProperty, VaccinationCoverageKindSelect } from './components/vaccination-coverage-kind-select'; -import { useVaccineCoveragePercentageFormatter } from './logic/use-vaccine-coverage-percentage-formatter'; +import { parseVaccinatedPercentageLabel } from './logic/parse-vaccinated-percentage-label'; interface VaccineCoverageChoroplethProps { data: { @@ -30,8 +30,8 @@ interface VaccineCoverageChoroplethProps { export const VaccineCoverageChoropleth = ({ data }: VaccineCoverageChoroplethProps) => { const { commonTexts } = useIntl(); const [selectedMap, setSelectedMap] = useState<RegionControlOption>('gm'); - const [selectedAgeGroup, setSelectedAgeGroup] = useState<AgeGroup>('18+'); - const [selectedCoverageKind, setSelectedCoverageKind] = useState<CoverageKindProperty>('fully_vaccinated_percentage'); + const [selectedAgeGroup, setSelectedAgeGroup] = useState<AgeGroup>('18'); + const [selectedCoverageKind, setSelectedCoverageKind] = useState<CoverageKindProperty>('primary_series'); const reverseRouter = useReverseRouter(); /** @@ -40,8 +40,8 @@ export const VaccineCoverageChoropleth = ({ data }: VaccineCoverageChoroplethPro */ const setSelectedCoverageKindAndAge = (coverageKind: CoverageKindProperty) => { if (coverageKind === selectedCoverageKind) return; - if (selectedAgeGroup !== '12+') { - setSelectedAgeGroup(selectedAgeGroup === '18+' ? '60+' : '18+'); + if (selectedAgeGroup !== '12') { + setSelectedAgeGroup(selectedAgeGroup === '18' ? '60' : '18'); } setSelectedCoverageKind(coverageKind); }; @@ -50,8 +50,8 @@ export const VaccineCoverageChoropleth = ({ data }: VaccineCoverageChoroplethPro regio: commonTexts.choropleth.choropleth_vaccination_coverage.shared[selectedMap], }; - const choroplethDataVr: VrCollectionVaccineCoveragePerAgeGroup[] = data.vr.filter(hasValueAtKey('age_group_range', selectedAgeGroup)); - const choroplethDataGm: GmCollectionVaccineCoveragePerAgeGroup[] = data.gm.filter(hasValueAtKey('age_group_range', selectedAgeGroup)); + const choroplethDataVr: VrCollectionVaccineCoveragePerAgeGroup[] = data.vr.filter((choroplethDataSingleVR) => choroplethDataSingleVR.vaccination_type === selectedCoverageKind); + const choroplethDataGm: GmCollectionVaccineCoveragePerAgeGroup[] = data.gm.filter((choroplethDataSingleGM) => choroplethDataSingleGM.vaccination_type === selectedCoverageKind); return ( <ChoroplethTile @@ -64,7 +64,7 @@ export const VaccineCoverageChoropleth = ({ data }: VaccineCoverageChoroplethPro as="legend" css={css({ flexBasis: '100%', - mb: 2, + marginBottom: space[2], })} > {commonTexts.choropleth.vaccination_coverage.shared.dropdowns_title} @@ -82,12 +82,15 @@ export const VaccineCoverageChoropleth = ({ data }: VaccineCoverageChoroplethPro </> } legend={{ - thresholds: thresholds.gm.fully_vaccinated_percentage, + thresholds: selectedMap === 'gm' ? thresholds.gm.primary_series_percentage : thresholds.vr.primary_series_percentage, title: commonTexts.choropleth.choropleth_vaccination_coverage.shared.legend_title, }} metadata={{ source: commonTexts.choropleth.vaccination_coverage.shared.bronnen.rivm, - date: data[selectedMap][0].date_unix, + date: + selectedMap === 'gm' + ? data.gm.find((item: GmCollectionVaccineCoveragePerAgeGroup | VrCollectionVaccineCoveragePerAgeGroup) => item.vaccination_type === selectedCoverageKind)?.date_unix + : data.vr.find((item: GmCollectionVaccineCoveragePerAgeGroup | VrCollectionVaccineCoveragePerAgeGroup) => item.vaccination_type === selectedCoverageKind)?.date_unix, }} chartRegion={selectedMap} onChartRegionChange={setSelectedMap} @@ -99,20 +102,13 @@ export const VaccineCoverageChoropleth = ({ data }: VaccineCoverageChoroplethPro data={choroplethDataGm} dataConfig={{ metricName: 'vaccine_coverage_per_age_group', - metricProperty: selectedCoverageKind, + metricProperty: `vaccinated_percentage_${selectedAgeGroup}_plus`, }} dataOptions={{ isPercentage: true, getLink: (gmcode) => reverseRouter.gm.vaccinaties(gmcode), }} - formatTooltip={(context) => ( - <ChoroplethTooltip - data={context} - mapData={data.gm.filter((singleGM) => singleGM.gmcode === context.code)} - ageGroups={matchingAgeGroups[selectedCoverageKind]} - selectedCoverageKind={selectedCoverageKind} - /> - )} + formatTooltip={(context) => <ChoroplethTooltip data={context} ageGroups={matchingAgeGroups[selectedCoverageKind]} selectedCoverageKind={selectedCoverageKind} />} /> )} @@ -123,74 +119,79 @@ export const VaccineCoverageChoropleth = ({ data }: VaccineCoverageChoroplethPro data={choroplethDataVr} dataConfig={{ metricName: 'vaccine_coverage_per_age_group', - metricProperty: selectedCoverageKind, + metricProperty: `vaccinated_percentage_${selectedAgeGroup}_plus`, }} dataOptions={{ isPercentage: true, getLink: (vrcode) => reverseRouter.vr.vaccinaties(vrcode), }} - formatTooltip={(context) => ( - <ChoroplethTooltip - data={context} - mapData={data.vr.filter((singleVR) => singleVR.vrcode === context.code)} - ageGroups={matchingAgeGroups[selectedCoverageKind]} - selectedCoverageKind={selectedCoverageKind} - /> - )} + formatTooltip={(context) => <ChoroplethTooltip data={context} ageGroups={matchingAgeGroups[selectedCoverageKind]} selectedCoverageKind={selectedCoverageKind} />} /> )} </ChoroplethTile> ); }; -type VaccineCoverageData = GmCollectionVaccineCoveragePerAgeGroup | VrCollectionVaccineCoveragePerAgeGroup; - type ChoroplethTooltipProps<T extends VaccineCoverageData> = { data: TooltipData<T>; selectedCoverageKind: CoverageKindProperty; ageGroups: AgeGroup[]; - mapData: GmCollectionVaccineCoveragePerAgeGroup[] | VrCollectionVaccineCoveragePerAgeGroup[]; }; -export function ChoroplethTooltip<T extends VaccineCoverageData>({ data, ageGroups, selectedCoverageKind, mapData }: ChoroplethTooltipProps<T>) { - const { commonTexts } = useIntl(); +export function ChoroplethTooltip<T extends VaccineCoverageData>({ data, selectedCoverageKind, ageGroups }: ChoroplethTooltipProps<T>) { + const { commonTexts, formatPercentage } = useIntl(); const coverageKindsText = commonTexts.vaccinations.coverage_kinds; const ageGroupsText: SiteText['common']['common']['age_groups'] = commonTexts.common.age_groups; - const formatCoveragePercentage = useVaccineCoveragePercentageFormatter(); - - const secondaryContent = mapData - .sort((a, b) => { - const age1 = Number(a.age_group_range.replace(/\D/g, '')); - const age2 = Number(b.age_group_range.replace(/\D/g, '')); - return age2 - age1; // This logic does not reflect the business logic properly.It matches the business logic right now because for both campaigns the older age group happens to be the primary focus group. This might not be the case for a new campaign. - }) - .map((vrOrGmData) => { - const selectionMatchesAgeGroup = ageGroups.includes(vrOrGmData.age_group_range); - - if (!selectionMatchesAgeGroup) { - return; - } - const filterBelow = vrOrGmData[selectedCoverageKind]; + const tooltipContentValues = ageGroups.map((ageGroup) => { + const ageGroupKeys: DataPerAgeGroup = { + birthyear_range_plus: `birthyear_range_${ageGroup}_plus` as unknown as BirthyearRangeKeysOfAgeGroups, + vaccinated_percentage_plus: `vaccinated_percentage_${ageGroup}_plus` as unknown as PercentageKeysOfAgeGroups, + vaccinated_percentage_plus_label: `vaccinated_percentage_${ageGroup}_plus_label` as unknown as PercentageLabelKeysOfAgeGroups, + }; - return ( - <TooltipSubject thresholdValues={data.thresholdValues} filterBelow={filterBelow as number | null} noDataFillColor={colors.white} key={vrOrGmData.age_group_range}> - <Box spacingHorizontal={2} display="flex" alignItems="center" justifyContent="space-between" flexGrow={1} mr={13} pr={2} key={vrOrGmData.age_group_range}> - <Box display="inline" minWidth={vrOrGmData[`${selectedCoverageKind}_label`] !== null ? '150px' : 'false'}> - <Markdown content={ageGroupsText[vrOrGmData.age_group_range]} /> - </Box> - <Box display="inline" minWidth={vrOrGmData[`${selectedCoverageKind}_label`] !== null ? '100px' : 'false'}> - {formatCoveragePercentage(vrOrGmData, selectedCoverageKind)} - </Box> + const parsedLabel: { + vaccinated_percentage_plus_label?: string | null; + } = {}; + + const ageGroupPercentage = data.dataItem[ageGroupKeys.vaccinated_percentage_plus as unknown as keyof VaccineCoverageData] as number; + const coveragePercentageLabel = data.dataItem[ageGroupKeys.vaccinated_percentage_plus_label as unknown as keyof VaccineCoverageData] as string; + const minWidthOfLabel = coveragePercentageLabel !== null ? '120px' : undefined; + + const result = coveragePercentageLabel ? parseVaccinatedPercentageLabel(coveragePercentageLabel) : null; + + if (result) { + const content = result.sign === '>' ? commonTexts.common.meer_dan : commonTexts.common.minder_dan; + parsedLabel.vaccinated_percentage_plus_label = replaceVariablesInText(content, { + value: `${formatPercentage(ageGroupPercentage)}%`, + }); + } + + return ( + <TooltipSubject + thresholdValues={data.thresholdValues} + filterBelow={data.dataItem[ageGroupKeys.vaccinated_percentage_plus as unknown as keyof VaccineCoverageData] as number} + noDataFillColor={colors.white} + key={ageGroup} + > + <Box spacingHorizontal={2} display="flex" alignItems="center" justifyContent="space-between" flexGrow={1} marginRight={'13px'} paddingRight={space[2]}> + <Box display="inline" minWidth={minWidthOfLabel} textAlign="left"> + <Markdown content={ageGroupsText[ageGroup]} /> </Box> - </TooltipSubject> - ); - }); + {typeof ageGroupPercentage === 'number' && ( + <Box display="inline" minWidth={minWidthOfLabel} textAlign="right"> + {parsedLabel.vaccinated_percentage_plus_label ? parsedLabel.vaccinated_percentage_plus_label : `${formatPercentage(ageGroupPercentage)}%`} + </Box> + )} + </Box> + </TooltipSubject> + ); + }); return ( <TooltipContent title={data.featureName} link={data.dataOptions.getLink ? data.dataOptions.getLink(data.code) : undefined}> <BoldText>{coverageKindsText[selectedCoverageKind]}</BoldText> - {secondaryContent} + {tooltipContentValues} </TooltipContent> ); } diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-choropleth_vr_and_gm.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth_vr_and_gm.tsx new file mode 100644 index 0000000000..dece3be298 --- /dev/null +++ b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth_vr_and_gm.tsx @@ -0,0 +1,159 @@ +import { colors, GmCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; +import { SiteText } from '~/locale'; +import { matchingAgeGroups, VaccineCoverageData, DataPerAgeGroup, BirthyearRangeKeysOfAgeGroups, PercentageKeysOfAgeGroups, PercentageLabelKeysOfAgeGroups } from './common'; +import css from '@styled-system/css'; +import { useState } from 'react'; +import { space } from '~/style/theme'; +import { Box } from '~/components/base'; +import { DataOptions, DynamicChoropleth } from '~/components/choropleth'; +import { ChoroplethTile } from '~/components/choropleth-tile'; +import { thresholds } from '~/components/choropleth/logic'; +import { TooltipContent, TooltipSubject } from '~/components/choropleth/tooltips'; +import { TooltipData } from '~/components/choropleth/tooltips/types'; +import { Markdown } from '~/components/markdown'; +import { BoldText } from '~/components/typography'; +import { useIntl } from '~/intl'; +import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; +import { AgeGroup, AgeGroupSelect } from './components/age-group-select'; +import { CoverageKindProperty, VaccinationCoverageKindSelect } from './components/vaccination-coverage-kind-select'; +import { parseVaccinatedPercentageLabel } from './logic/parse-vaccinated-percentage-label'; + +interface VaccineCoverageChoroplethProps { + data: GmCollectionVaccineCoveragePerAgeGroup[]; + vrOrGmOptions: { + dataOptions: DataOptions; + text: { + title: string; + description: string; + }; + }; +} + +export const VaccineCoverageChoroplethVrAndGm = ({ data, vrOrGmOptions }: VaccineCoverageChoroplethProps) => { + const { commonTexts } = useIntl(); + const [selectedAgeGroup, setSelectedAgeGroup] = useState<AgeGroup>('18'); + const [selectedCoverageKind, setSelectedCoverageKind] = useState<CoverageKindProperty>('primary_series'); + + const setSelectedCoverageKindAndAge = (coverageKind: CoverageKindProperty) => { + if (coverageKind === selectedCoverageKind) return; + if (selectedAgeGroup !== '12') { + setSelectedAgeGroup(selectedAgeGroup === '18' ? '60' : '18'); + } + setSelectedCoverageKind(coverageKind); + }; + + const choroplethDataGm: GmCollectionVaccineCoveragePerAgeGroup[] = data.filter((choroplethDataSingleGM) => choroplethDataSingleGM.vaccination_type === selectedCoverageKind); + + return ( + <ChoroplethTile + title={vrOrGmOptions.text.title} + description={ + <> + <Markdown content={vrOrGmOptions.text.description} /> + <Box display="flex" flexDirection="row" justifyContent="flex-start" spacingHorizontal={2} as={'fieldset'}> + <BoldText + as="legend" + css={css({ + flexBasis: '100%', + marginBottom: space[2], + })} + > + {commonTexts.choropleth.vaccination_coverage.shared.dropdowns_title} + </BoldText> + + <Box display="flex" width="100%" spacingHorizontal={{ xs: 2 }} flexWrap="wrap" flexDirection={{ _: 'column', xs: 'row' }}> + <Box flex="1"> + <VaccinationCoverageKindSelect onChange={setSelectedCoverageKindAndAge} initialValue={selectedCoverageKind} /> + </Box> + <Box flex="1"> + <Box maxWidth="20rem"> + <AgeGroupSelect onChange={setSelectedAgeGroup} initialValue={selectedAgeGroup} shownAgeGroups={matchingAgeGroups[selectedCoverageKind]} /> + </Box> + </Box> + </Box> + </Box> + </> + } + legend={{ + thresholds: thresholds.gm.primary_series_percentage, + title: commonTexts.choropleth.choropleth_vaccination_coverage.shared.legend_title, + }} + metadata={{ + source: commonTexts.choropleth.vaccination_coverage.shared.bronnen.rivm, + date: data.find((item) => item.vaccination_type === selectedCoverageKind)?.date_unix, + }} + hasPadding + > + <DynamicChoropleth + accessibility={{ key: 'vaccine_coverage_nl_choropleth' }} + map="gm" + data={choroplethDataGm} + dataConfig={{ + metricName: 'vaccine_coverage_per_age_group', + metricProperty: `vaccinated_percentage_${selectedAgeGroup}_plus`, + }} + dataOptions={vrOrGmOptions.dataOptions} + formatTooltip={(context) => <ChoroplethTooltip data={context} ageGroups={matchingAgeGroups[selectedCoverageKind]} selectedCoverageKind={selectedCoverageKind} />} + /> + </ChoroplethTile> + ); +}; + +type ChoroplethTooltipProps<T extends VaccineCoverageData> = { + data: TooltipData<T>; + selectedCoverageKind: CoverageKindProperty; + ageGroups: AgeGroup[]; +}; + +export function ChoroplethTooltip<T extends VaccineCoverageData>({ data, selectedCoverageKind, ageGroups }: ChoroplethTooltipProps<T>) { + const { commonTexts, formatPercentage } = useIntl(); + const coverageKindsText = commonTexts.vaccinations.coverage_kinds; + const ageGroupsText: SiteText['common']['common']['age_groups'] = commonTexts.common.age_groups; + + const secondaryContent = ageGroups.map((ageGroup) => { + const ageGroupKeys: DataPerAgeGroup = { + birthyear_range_plus: `birthyear_range_${ageGroup}_plus` as unknown as BirthyearRangeKeysOfAgeGroups, + vaccinated_percentage_plus: `vaccinated_percentage_${ageGroup}_plus` as unknown as PercentageKeysOfAgeGroups, + vaccinated_percentage_plus_label: `vaccinated_percentage_${ageGroup}_plus_label` as unknown as PercentageLabelKeysOfAgeGroups, + }; + + const parsedLabel: { + vaccinated_percentage_plus_label?: string | null; + } = {}; + + const ageGroupPercentage = data.dataItem[ageGroupKeys.vaccinated_percentage_plus as unknown as keyof VaccineCoverageData] as number; + const coveragePercentageLabel = data.dataItem[ageGroupKeys.vaccinated_percentage_plus_label as unknown as keyof VaccineCoverageData] as string; + const minWidthOfLabel = coveragePercentageLabel !== null ? '120px' : undefined; + + const result = coveragePercentageLabel ? parseVaccinatedPercentageLabel(coveragePercentageLabel) : null; + + if (result) { + const content = result.sign === '>' ? commonTexts.common.meer_dan : commonTexts.common.minder_dan; + parsedLabel.vaccinated_percentage_plus_label = replaceVariablesInText(content, { + value: `${formatPercentage(ageGroupPercentage)}%`, + }); + } + + return ( + <TooltipSubject thresholdValues={data.thresholdValues} filterBelow={ageGroupPercentage as number} noDataFillColor={colors.white} key={ageGroup}> + <Box spacingHorizontal={2} display="flex" alignItems="center" justifyContent="space-between" flexGrow={1} marginRight={'13px'} paddingRight={space[2]}> + <Box display="inline" minWidth={minWidthOfLabel} textAlign="left"> + <Markdown content={ageGroupsText[ageGroup]} /> + </Box> + {typeof ageGroupPercentage === 'number' && ( + <Box display="inline" minWidth={minWidthOfLabel} textAlign="right"> + {parsedLabel.vaccinated_percentage_plus_label ? parsedLabel.vaccinated_percentage_plus_label : `${formatPercentage(ageGroupPercentage)}%`} + </Box> + )} + </Box> + </TooltipSubject> + ); + }); + + return ( + <TooltipContent title={data.featureName} link={data.dataOptions.getLink ? data.dataOptions.getLink(data.code) : undefined}> + <BoldText>{coverageKindsText[selectedCoverageKind]}</BoldText> + {secondaryContent} + </TooltipContent> + ); +} diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-tile/vaccine-coverage-tile.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-tile/vaccine-coverage-tile.tsx index 776d3bdd68..0ac353635a 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-tile/vaccine-coverage-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-tile/vaccine-coverage-tile.tsx @@ -20,9 +20,9 @@ type BarType = { color: string; }; -type AgeDataType = { +export type AgeDataType = { value: number | null; - birthyear: string; + birthyear: string | null; title: string; description: string; bar: BarType; @@ -40,14 +40,7 @@ interface VaccineCoverageTileProps { dateUnix: number; } -export const VaccineCoverageTile = ({ - title, - description, - source, - descriptionFooter, - dateUnix, - coverageData, -}: VaccineCoverageTileProps) => { +export const VaccineCoverageTile = ({ title, description, source, descriptionFooter, dateUnix, coverageData }: VaccineCoverageTileProps) => { const metadata: MetadataProps = { date: dateUnix, source: source, @@ -84,16 +77,11 @@ interface AgeGroupBlockProps { const AgeGroupBlock = ({ data, bar, children }: AgeGroupBlockProps) => { const { commonTexts, formatPercentage } = useIntl(); - const parsedAgePercentage = data.value - ? `${formatPercentage(data.value)}%` - : '-'; + const parsedAgePercentage = data.value ? `${formatPercentage(data.value)}%` : '-'; - const parsedBirthyearRange = parseBirthyearRange(data.birthyear); + const parsedBirthyearRange = data.birthyear ? parseBirthyearRange(data.birthyear) : null; - assert( - parsedBirthyearRange, - `[${AgeGroupBlock.name}] Something went wrong with parsing the birthyear: ${data.birthyear}` - ); + assert(parsedBirthyearRange, `[${AgeGroupBlock.name}] Something went wrong with parsing the birthyear: ${data.birthyear}`); return ( <Box> @@ -106,10 +94,7 @@ const AgeGroupBlock = ({ data, bar, children }: AgeGroupBlockProps) => { </Box> <Markdown content={replaceVariablesInText(data.description, { - birthyear: replaceVariablesInText( - commonTexts.common.birthyear_ranges[parsedBirthyearRange.type], - parsedBirthyearRange - ), + birthyear: replaceVariablesInText(commonTexts.common.birthyear_ranges[parsedBirthyearRange.type], parsedBirthyearRange), })} /> {children} diff --git a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx index 0feae720d3..d92fd82f21 100644 --- a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx +++ b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx @@ -1,20 +1,14 @@ import { colors, GmCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; -import css from '@styled-system/css'; import { Vaccinaties as VaccinatieIcon } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { useState } from 'react'; -import { hasValueAtKey, isDefined, isPresent } from 'ts-is-present'; -import { Box } from '~/components/base'; -import { DynamicChoropleth, ChoroplethTile, Markdown, PageInformationBlock, TileList, Divider } from '~/components'; -import { thresholds } from '~/components/choropleth/logic'; +import { isDefined, isPresent } from 'ts-is-present'; +import { PageInformationBlock, TileList, Divider } from '~/components'; import { gmCodesByVrCode, vrCodeByGmCode } from '~/data'; import { Layout, GmLayout } from '~/domain/layout'; import { Languages, SiteText } from '~/locale'; -import { BoldText } from '~/components/typography'; -import { matchingAgeGroups } from '~/domain/vaccine/common'; -import { AgeGroup, AgeGroupSelect } from '~/domain/vaccine/components/age-group-select'; -import { VaccinationCoverageKindSelect, CoverageKindProperty } from '~/domain/vaccine/components/vaccination-coverage-kind-select'; -import { selectVaccineCoverageData, VaccineCoverageToggleTile, ChoroplethTooltip, VaccineCoveragePerAgeGroup, VaccineCoverageTile } from '~/domain/vaccine'; +import { VaccineCoverageToggleTile, VaccineCoveragePerAgeGroup, VaccineCoverageTile } from '~/domain/vaccine'; +import { AgeDataType } from '~/domain/vaccine/vaccine-coverage-tile/vaccine-coverage-tile'; import { useIntl } from '~/intl'; import { getArticleParts, getLinkParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; @@ -23,8 +17,9 @@ import { ArticleParts, LinkParts, PagePartQueryResult } from '~/types/cms'; import { assert, replaceVariablesInText, useReverseRouter, useFormatLokalizePercentage } from '~/utils'; import { getLastInsertionDateOfPage } from '~/utils/get-last-insertion-date-of-page'; import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; +import { VaccineCoverageChoroplethVrAndGm } from '~/domain/vaccine/vaccine-coverage-choropleth_vr_and_gm'; -const pageMetrics = ['vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'booster_coverage']; +const pageMetrics = ['vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'booster_coverage_archived_20220904']; const selectLokalizeTexts = (siteText: SiteText) => ({ textGm: siteText.pages.vaccinations_page.gm, @@ -34,12 +29,23 @@ const selectLokalizeTexts = (siteText: SiteText) => ({ type LokalizeTexts = ReturnType<typeof selectLokalizeTexts>; +type ParsedCoverageData = { + autumn2022: [AgeDataType, AgeDataType]; + primarySeries: [AgeDataType, AgeDataType]; +}; + export { getStaticPaths } from '~/static-paths/gm'; export const getStaticProps = createGetStaticProps( ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), getLastGeneratedDate, - selectGmData('code', 'vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'vaccine_coverage_per_age_group_archived_20220908', 'booster_coverage'), + selectGmData( + 'code', + 'vaccine_coverage_per_age_group', + 'vaccine_coverage_per_age_group_archived', + 'vaccine_coverage_per_age_group_archived_20220908', + 'booster_coverage_archived_20220904' + ), createGetChoroplethData({ gm: ({ vaccine_coverage_per_age_group }, ctx) => { if (!isDefined(vaccine_coverage_per_age_group)) { @@ -50,9 +56,9 @@ export const getStaticProps = createGetStaticProps( const vrCode = isPresent(ctx.params?.code) ? vrCodeByGmCode[ctx.params?.code as 'string'] : undefined; return { - vaccine_coverage_per_age_group: selectVaccineCoverageData( - isDefined(vrCode) ? vaccine_coverage_per_age_group.filter((el) => gmCodesByVrCode[vrCode].includes(el.gmcode)) : vaccine_coverage_per_age_group - ), + vaccine_coverage_per_age_group: isDefined(vrCode) + ? vaccine_coverage_per_age_group.filter((vaccineCoveragePerAgeGroup) => gmCodesByVrCode[vrCode].includes(vaccineCoveragePerAgeGroup.gmcode)) + : vaccine_coverage_per_age_group, }; }, }), @@ -71,11 +77,9 @@ export const getStaticProps = createGetStaticProps( export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => { const { pageText, choropleth, municipalityName, selectedGmData: data, content, lastGenerated } = props; const { commonTexts } = useIntl(); - const reverseRouter = useReverseRouter(); - const [selectedAgeGroup, setSelectedAgeGroup] = useState<AgeGroup>('18+'); - const [selectedCoverageKind, setSelectedCoverageKind] = useState<CoverageKindProperty>('fully_vaccinated_percentage'); const { formatPercentageAsNumber } = useFormatLokalizePercentage(); const [hasHideArchivedCharts, setHideArchivedCharts] = useState<boolean>(false); + const reverseRouter = useReverseRouter(); const { textGm, textNl, textShared } = useDynamicLokalizeTexts<LokalizeTexts>(pageText, selectLokalizeTexts); @@ -89,49 +93,71 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => }), }; - /** - * When changing between coverage kinds where the selected age group isn't available, - * the other coverage kind set the non-matching age group to a default one. - */ - const setSelectedCoverageKindAndAge = (coverageKind: CoverageKindProperty) => { - if (coverageKind === selectedCoverageKind) return; - if (selectedAgeGroup !== '12+') { - setSelectedAgeGroup(selectedAgeGroup === '18+' ? '60+' : '18+'); - } - setSelectedCoverageKind(coverageKind); + const filteredVaccination = { + primarySeries: data.vaccine_coverage_per_age_group.values.find((item) => item.vaccination_type === 'primary_series'), + autumn2022: data.vaccine_coverage_per_age_group.values.find((item) => item.vaccination_type === 'autumn_2022'), }; - /** - * Filter out only the the 12+ and 18+ for the toggle component. - */ - const filteredAgeGroup60Plus = data.vaccine_coverage_per_age_group.values.find((x) => x.age_group_range === '60+'); - - const filteredAgeGroup18Plus = data.vaccine_coverage_per_age_group.values.find((x) => x.age_group_range === '18+'); + assert(filteredVaccination.primarySeries, `[${VaccinationsGmPage.name}] Could not find data for the vaccine coverage per age group for the primary series`); + assert(filteredVaccination.autumn2022, `[${VaccinationsGmPage.name}] Could not find data for the vaccine coverage per age group for the autumn 2022 series`); - const filteredAgeGroup12Plus = data.vaccine_coverage_per_age_group.values.find((x) => x.age_group_range === '12+'); + const boosterCoverage18PlusArchivedValue = data.booster_coverage_archived_20220904?.values?.find((v) => v.age_group === '18+'); + const boosterCoverage12PlusArchivedValue = data.booster_coverage_archived_20220904?.values?.find((v) => v.age_group === '12+'); - /** - * Archived - Filter out only the the 12+ and 18+ for the toggle component. - */ const filteredArchivedAgeGroup18Plus = data.vaccine_coverage_per_age_group_archived_20220908.values.find((x) => x.age_group_range === '18+'); - const filteredArchivedAgeGroup12Plus = data.vaccine_coverage_per_age_group_archived_20220908.values.find((x) => x.age_group_range === '12+'); - const boosterCoverage18PlusValue = data.booster_coverage?.values?.find((v) => v.age_group === '18+'); - const boosterCoverage12PlusValue = data.booster_coverage?.values?.find((v) => v.age_group === '12+'); - - assert(filteredAgeGroup60Plus, `[${VaccinationsGmPage.name}] Could not find data for the vaccine coverage per age group for the age 60+`); - - assert(filteredAgeGroup18Plus, `[${VaccinationsGmPage.name}] Could not find data for the vaccine coverage per age group for the age 18+`); - - assert(filteredAgeGroup12Plus, `[${VaccinationsGmPage.name}] Could not find data for the vaccine coverage per age group for the age 12+`); - assert(filteredArchivedAgeGroup18Plus, `[${VaccinationsGmPage.name}] Could not find data for the archived vaccine coverage per age group for the age 18+`); - assert(filteredArchivedAgeGroup12Plus, `[${VaccinationsGmPage.name}] Could not find data for the archived vaccine coverage per age group for the age 12+`); const lastInsertionDateOfPage = getLastInsertionDateOfPage(data, pageMetrics); - const choroplethData: GmCollectionVaccineCoveragePerAgeGroup[] = choropleth.gm.vaccine_coverage_per_age_group.filter(hasValueAtKey('age_group_range', selectedAgeGroup)); + + const parsedVaccineCoverageData: ParsedCoverageData = { + autumn2022: [ + { + value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus, + birthyear: filteredVaccination.autumn2022.birthyear_range_60_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, + bar: { + value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus || 0, + color: colors.scale.blueDetailed[8], + }, + }, + { + value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus, + birthyear: filteredVaccination.autumn2022.birthyear_range_12_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, + bar: { + value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus || 0, + color: colors.scale.blueDetailed[8], + }, + }, + ], + primarySeries: [ + { + value: filteredVaccination.primarySeries.vaccinated_percentage_18_plus, + birthyear: filteredVaccination.primarySeries.birthyear_range_18_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_18_plus, + description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_18_plus, + bar: { + value: filteredVaccination.primarySeries.vaccinated_percentage_18_plus || 0, + color: colors.scale.blueDetailed[3], + }, + }, + { + value: filteredVaccination.primarySeries.vaccinated_percentage_12_plus, + birthyear: filteredVaccination.primarySeries.birthyear_range_12_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, + description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_12_plus, + bar: { + value: filteredVaccination.primarySeries.vaccinated_percentage_12_plus || 0, + color: colors.scale.blueDetailed[3], + }, + }, + ], + }; return ( <Layout {...metadata} lastGenerated={lastGenerated}> @@ -146,7 +172,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => icon={<VaccinatieIcon aria-hidden="true" />} metadata={{ datumsText: textGm.vaccination_coverage.top_level_information_block.dates, - dateOrRange: filteredAgeGroup18Plus.date_unix, + dateOrRange: filteredVaccination.primarySeries.date_unix, dateOfInsertionUnix: lastInsertionDateOfPage, dataSources: [], }} @@ -156,131 +182,34 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => vrNameOrGmName={municipalityName} warning={textGm.warning} /> - <VaccineCoverageTile - title={textShared.vaccination_grade_tile.autumn_labels.title} - description={textShared.vaccination_grade_tile.autumn_labels.description} - source={textShared.vaccination_grade_tile.autumn_labels.source} - descriptionFooter={textShared.vaccination_grade_tile.autumn_labels.description_footer} - coverageData={[ - { - value: filteredAgeGroup60Plus.autumn_2022_vaccinated_percentage, - birthyear: filteredAgeGroup60Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, - bar: { - value: filteredAgeGroup60Plus.autumn_2022_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[8], - }, - }, - { - value: filteredAgeGroup12Plus.autumn_2022_vaccinated_percentage, - birthyear: filteredAgeGroup12Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, - bar: { - value: filteredAgeGroup12Plus.autumn_2022_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[8], - }, - }, - ]} - dateUnix={filteredArchivedAgeGroup12Plus.date_unix} - /> + {filteredVaccination.autumn2022.birthyear_range_60_plus && ( + <VaccineCoverageTile + title={textShared.vaccination_grade_tile.autumn_labels.title} + description={textShared.vaccination_grade_tile.autumn_labels.description} + source={textShared.vaccination_grade_tile.autumn_labels.source} + descriptionFooter={textShared.vaccination_grade_tile.autumn_labels.description_footer} + coverageData={parsedVaccineCoverageData.autumn2022} + dateUnix={filteredVaccination.autumn2022.date_unix} + /> + )} <VaccineCoverageTile title={textShared.vaccination_grade_tile.fully_vaccinated_labels.title} description={textShared.vaccination_grade_tile.fully_vaccinated_labels.description} source={textShared.vaccination_grade_tile.fully_vaccinated_labels.source} descriptionFooter={textShared.vaccination_grade_tile.fully_vaccinated_labels.description_footer} - coverageData={[ - { - value: filteredAgeGroup18Plus.fully_vaccinated_percentage, - birthyear: filteredAgeGroup18Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_18_plus, - description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_18_plus, - bar: { - value: filteredAgeGroup18Plus.fully_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[3], - }, - }, - { - value: filteredAgeGroup12Plus.fully_vaccinated_percentage, - birthyear: filteredAgeGroup12Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, - description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_12_plus, - bar: { - value: filteredAgeGroup12Plus.fully_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[3], - }, - }, - ]} - dateUnix={filteredAgeGroup12Plus.date_unix} + coverageData={parsedVaccineCoverageData.primarySeries} + dateUnix={filteredVaccination.primarySeries.date_unix} /> - - <ChoroplethTile - title={replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.title, { municipalityName: municipalityName })} - description={ - <> - <Markdown content={replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.description, { municipalityName: municipalityName })} /> - - <Box display="flex" flexDirection="row" justifyContent="flex-start" spacingHorizontal={2} as={'fieldset'}> - <BoldText - as="legend" - css={css({ - flexBasis: '100%', - mb: 2, - })} - > - {commonTexts.choropleth.vaccination_coverage.shared.dropdowns_title} - </BoldText> - - <Box display="flex" width="100%" spacingHorizontal={{ xs: 2 }} flexWrap="wrap" flexDirection={{ _: 'column', xs: 'row' }}> - <Box flex="1"> - <VaccinationCoverageKindSelect onChange={setSelectedCoverageKindAndAge} initialValue={selectedCoverageKind} /> - </Box> - <Box flex="1"> - <Box maxWidth="20rem"> - <AgeGroupSelect onChange={setSelectedAgeGroup} initialValue={selectedAgeGroup} shownAgeGroups={matchingAgeGroups[selectedCoverageKind]} /> - </Box> - </Box> - </Box> - </Box> - </> - } - legend={{ - thresholds: thresholds.gm.fully_vaccinated_percentage, - title: commonTexts.choropleth.choropleth_vaccination_coverage.shared.legend_title, - }} - metadata={{ - source: commonTexts.choropleth.vaccination_coverage.shared.bronnen.rivm, - date: choropleth.gm.vaccine_coverage_per_age_group[0].date_unix, + <VaccineCoverageChoroplethVrAndGm + data={choropleth.gm.vaccine_coverage_per_age_group} + vrOrGmOptions={{ + dataOptions: { getLink: reverseRouter.gm.vaccinaties, selectedCode: data.code, isPercentage: true }, + text: { + title: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.title, { municipalityName: municipalityName }), + description: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.description, { municipalityName: municipalityName }), + }, }} - hasPadding - > - <DynamicChoropleth - accessibility={{ key: 'vaccine_coverage_nl_choropleth' }} - map="gm" - data={choroplethData} - dataConfig={{ - metricName: 'vaccine_coverage_per_age_group', - metricProperty: selectedCoverageKind, - }} - dataOptions={{ - getLink: reverseRouter.gm.vaccinaties, - highlightSelection: true, - selectedCode: data.code, - tooltipVariables: { - age_group: commonTexts.common.age_groups[selectedAgeGroup], - }, - }} - formatTooltip={(context) => ( - <ChoroplethTooltip - data={context} - mapData={choropleth.gm.vaccine_coverage_per_age_group.filter((singleGm) => singleGm.gmcode === context.code)} - ageGroups={matchingAgeGroups[selectedCoverageKind]} - selectedCoverageKind={selectedCoverageKind} - /> - )} - /> - </ChoroplethTile> + /> <Divider /> <PageInformationBlock title={textNl.section_archived.title} @@ -301,9 +230,9 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => birthyear: filteredArchivedAgeGroup18Plus.birthyear_range, fully_vaccinated_label: filteredArchivedAgeGroup18Plus.fully_vaccinated_percentage_label, has_one_shot_label: filteredArchivedAgeGroup18Plus.has_one_shot_percentage_label, - boostered: formatPercentageAsNumber(`${boosterCoverage18PlusValue?.percentage}`), - boostered_label: boosterCoverage18PlusValue?.percentage_label, - dateUnixBoostered: boosterCoverage18PlusValue?.date_unix, + boostered: formatPercentageAsNumber(`${boosterCoverage18PlusArchivedValue?.percentage}`), + boostered_label: boosterCoverage18PlusArchivedValue?.percentage_label, + dateUnixBoostered: boosterCoverage18PlusArchivedValue?.date_unix, }} age12Plus={{ fully_vaccinated: filteredArchivedAgeGroup12Plus.fully_vaccinated_percentage, @@ -311,9 +240,9 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => birthyear: filteredArchivedAgeGroup12Plus.birthyear_range, fully_vaccinated_label: filteredArchivedAgeGroup12Plus.fully_vaccinated_percentage_label, has_one_shot_label: filteredArchivedAgeGroup12Plus.has_one_shot_percentage_label, - boostered: formatPercentageAsNumber(`${boosterCoverage12PlusValue?.percentage}`), - boostered_label: boosterCoverage12PlusValue?.percentage_label, - dateUnixBoostered: boosterCoverage12PlusValue?.date_unix, + boostered: formatPercentageAsNumber(`${boosterCoverage12PlusArchivedValue?.percentage}`), + boostered_label: boosterCoverage12PlusArchivedValue?.percentage_label, + dateUnixBoostered: boosterCoverage12PlusArchivedValue?.date_unix, }} age12PlusToggleText={textGm.vaccination_grade_toggle_tile.age_12_plus} age18PlusToggleText={textGm.vaccination_grade_toggle_tile.age_18_plus} diff --git a/packages/app/src/pages/landelijk/rioolwater.tsx b/packages/app/src/pages/landelijk/rioolwater.tsx index ab02725bff..6274dffa61 100644 --- a/packages/app/src/pages/landelijk/rioolwater.tsx +++ b/packages/app/src/pages/landelijk/rioolwater.tsx @@ -17,29 +17,13 @@ import { NlLayout } from '~/domain/layout/nl-layout'; import { SewerChart } from '~/domain/sewer/sewer-chart'; import { useIntl } from '~/intl'; import { Languages, SiteText } from '~/locale'; -import { - getArticleParts, - getPagePartsQuery, -} from '~/queries/get-page-parts-query'; -import { - createGetStaticProps, - StaticProps, -} from '~/static-props/create-get-static-props'; -import { - createGetChoroplethData, - createGetContent, - getLastGeneratedDate, - selectNlData, - getLokalizeTexts, -} from '~/static-props/get-data'; +import { getArticleParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; +import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; +import { createGetChoroplethData, createGetContent, getLastGeneratedDate, selectNlData, getLokalizeTexts } from '~/static-props/get-data'; import { ArticleParts, PagePartQueryResult } from '~/types/cms'; import { useReverseRouter } from '~/utils/use-reverse-router'; import { getLastInsertionDateOfPage } from '~/utils/get-last-insertion-date-of-page'; -import { - ElementsQueryResult, - getElementsQuery, - getTimelineEvents, -} from '~/queries/get-elements-query'; +import { ElementsQueryResult, getElementsQuery, getTimelineEvents } from '~/queries/get-elements-query'; import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; const pageMetrics = ['sewer']; @@ -47,8 +31,7 @@ const pageMetrics = ['sewer']; const selectLokalizeTexts = (siteText: SiteText) => ({ caterogyTexts: { category: siteText.common.sidebar.categories.development_of_the_virus.title, - screenReaderCategory: - siteText.common.sidebar.metrics.sewage_measurement.title, + screenReaderCategory: siteText.common.sidebar.metrics.sewage_measurement.title, }, metadataTexts: siteText.pages.topical_page.nl.nationaal_metadata, textNl: siteText.pages.sewer_page.nl, @@ -58,8 +41,7 @@ const selectLokalizeTexts = (siteText: SiteText) => ({ type LokalizeTexts = ReturnType<typeof selectLokalizeTexts>; export const getStaticProps = createGetStaticProps( - ({ locale }: { locale: keyof Languages }) => - getLokalizeTexts(selectLokalizeTexts, locale), + ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), getLastGeneratedDate, selectNlData('sewer', 'difference.sewer__average'), createGetChoroplethData({ @@ -89,16 +71,9 @@ export const getStaticProps = createGetStaticProps( const SewerWater = (props: StaticProps<typeof getStaticProps>) => { const { commonTexts, formatNumber } = useIntl(); const reverseRouter = useReverseRouter(); - const { - pageText, - selectedNlData: data, - choropleth, - content, - lastGenerated, - } = props; - - const { caterogyTexts, metadataTexts, textNl, textShared } = - useDynamicLokalizeTexts<LokalizeTexts>(pageText, selectLokalizeTexts); + const { pageText, selectedNlData: data, choropleth, content, lastGenerated } = props; + + const { caterogyTexts, metadataTexts, textNl, textShared } = useDynamicLokalizeTexts<LokalizeTexts>(pageText, selectLokalizeTexts); const sewerAverages = data.sewer; const [selectedMap, setSelectedMap] = useState<RegionControlOption>('gm'); @@ -130,9 +105,7 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => { articles={content.articles} /> - {!isEmpty(textNl.warning_method) && ( - <WarningTile message={textNl.warning_method} icon={Experimenteel} /> - )} + {!isEmpty(textNl.warning_method) && <WarningTile message={textNl.warning_method} icon={Experimenteel} />} <TwoKpiSection> <KpiTile @@ -152,10 +125,7 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => { /> </KpiTile> - <KpiTile - title={textNl.tile_explanation_title} - description={textNl.tile_explanation_description} - /> + <KpiTile title={textNl.tile_explanation_title} description={textNl.tile_explanation_description} /> </TwoKpiSection> <SewerChart @@ -170,23 +140,14 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => { averagesDataLabel: commonTexts.common.daggemiddelde, valueAnnotation: commonTexts.waarde_annotaties.riool_normalized, }} - timelineEvents={getTimelineEvents( - content.elements.timeSeries, - 'sewer' - )} + timelineEvents={getTimelineEvents(content.elements.timeSeries, 'sewer')} /> <ChoroplethTile title={textNl.map_titel} description={textNl.map_toelichting} metadata={{ - date: - selectedMap === 'gm' - ? [ - choropleth.gm.sewer[0].date_start_unix, - choropleth.gm.sewer[0].date_end_unix, - ] - : choropleth.vr.sewer[0].date_unix, + date: selectedMap === 'gm' ? [choropleth.gm.sewer[0].date_start_unix, choropleth.gm.sewer[0].date_end_unix] : choropleth.vr.sewer[0].date_unix, source: textNl.bronnen.rivm, }} onChartRegionChange={setSelectedMap} @@ -195,7 +156,9 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => { legend={{ title: textNl.legenda_titel, thresholds: thresholds.vr.average, + outdatedDataLabel: textNl.choropleth_legend_outdated_data_label, }} + pageType="sewer" > {selectedMap === 'gm' && ( <DynamicChoropleth diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index a7f3366f5e..bc69c4250d 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -3,12 +3,10 @@ import { Vaccinaties as VaccinatieIcon } from '@corona-dashboard/icons'; import { isEmpty } from 'lodash'; import { GetStaticPropsContext } from 'next'; import { useState } from 'react'; -import { isDefined } from 'ts-is-present'; import { ChartTile, PageInformationBlock, TileList, TimeSeriesChart, WarningTile, Divider } from '~/components'; import { Layout, NlLayout } from '~/domain/layout'; import { selectAdministrationData, - selectVaccineCoverageData, VaccinationsOverTimeTile, VaccineBoosterAdministrationsKpiSection, VaccinationsShotKpiSection, @@ -50,8 +48,8 @@ const pageMetrics = [ 'vaccine_coverage_per_age_group_estimated_autumn_2022', 'vaccine_campaigns', 'vaccine_planned', - 'booster_coverage', - 'booster_shot_administered', + 'booster_coverage_archived_20220904', + 'booster_shot_administered_archived_20220904', 'repeating_shot_administered', ]; @@ -86,8 +84,8 @@ export const getStaticProps = createGetStaticProps( 'vaccine_campaigns_archived_20220908', 'vaccine_planned', 'vaccine_planned_archived_20220908', - 'booster_coverage', - 'booster_shot_administered', + 'booster_coverage_archived_20220904', + 'booster_shot_administered_archived_20220904', 'repeating_shot_administered' ), () => selectAdministrationData(getNlData().data.vaccine_administered), @@ -116,18 +114,8 @@ export const getStaticProps = createGetStaticProps( }; }, createGetChoroplethData({ - gm: ({ vaccine_coverage_per_age_group }) => { - if (isDefined(vaccine_coverage_per_age_group)) { - return selectVaccineCoverageData(vaccine_coverage_per_age_group); - } - return vaccine_coverage_per_age_group ?? null; - }, - vr: ({ vaccine_coverage_per_age_group }) => { - if (isDefined(vaccine_coverage_per_age_group)) { - return selectVaccineCoverageData(vaccine_coverage_per_age_group); - } - return vaccine_coverage_per_age_group ?? null; - }, + gm: ({ vaccine_coverage_per_age_group }) => vaccine_coverage_per_age_group ?? null, + vr: ({ vaccine_coverage_per_age_group }) => vaccine_coverage_per_age_group ?? null, }) ); @@ -150,13 +138,13 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { const vaccineCoverageEstimatedArchivedLastValue = data.vaccine_coverage_per_age_group_estimated_archived_20220908.last_value; - const boosterShotAdministeredLastValue = data.booster_shot_administered.last_value; + const boosterShotAdministeredArchivedLastValue = data.booster_shot_administered_archived_20220904.last_value; - const boosterCoverage18PlusValue = data.booster_coverage.values.find((v) => v.age_group === '18+'); - const boosterCoverage12PlusValue = data.booster_coverage.values.find((v) => v.age_group === '12+'); + const boosterCoverage18PlusArchivedValue = data.booster_coverage_archived_20220904.values.find((v) => v.age_group === '18+'); + const boosterCoverage12PlusArchivedValue = data.booster_coverage_archived_20220904.values.find((v) => v.age_group === '12+'); - assert(boosterCoverage18PlusValue, `[${VaccinationPage.name}] Missing value for booster_coverage 18+`); - assert(boosterCoverage12PlusValue, `[${VaccinationPage.name}] Missing value for booster_coverage 12+`); + assert(boosterCoverage18PlusArchivedValue, `[${VaccinationPage.name}] Missing value for booster_coverage 18+`); + assert(boosterCoverage12PlusArchivedValue, `[${VaccinationPage.name}] Missing value for booster_coverage 12+`); const repeatingShotAdministeredLastValue = data.repeating_shot_administered?.last_value; @@ -313,16 +301,16 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { age18Plus={{ fully_vaccinated: vaccineCoverageEstimatedArchivedLastValue.age_18_plus_fully_vaccinated, has_one_shot: vaccineCoverageEstimatedArchivedLastValue.age_18_plus_has_one_shot, - boostered: formatPercentageAsNumber(`${boosterCoverage18PlusValue.percentage}`), + boostered: formatPercentageAsNumber(`${boosterCoverage18PlusArchivedValue.percentage}`), birthyear: vaccineCoverageEstimatedArchivedLastValue.age_18_plus_birthyear, - dateUnixBoostered: boosterCoverage18PlusValue.date_unix, + dateUnixBoostered: boosterCoverage18PlusArchivedValue.date_unix, }} age12Plus={{ fully_vaccinated: vaccineCoverageEstimatedArchivedLastValue.age_12_plus_fully_vaccinated, has_one_shot: vaccineCoverageEstimatedArchivedLastValue.age_12_plus_has_one_shot, - boostered: formatPercentageAsNumber(`${boosterCoverage12PlusValue.percentage}`), + boostered: formatPercentageAsNumber(`${boosterCoverage12PlusArchivedValue.percentage}`), birthyear: vaccineCoverageEstimatedArchivedLastValue.age_12_plus_birthyear, - dateUnixBoostered: boosterCoverage12PlusValue.date_unix, + dateUnixBoostered: boosterCoverage12PlusArchivedValue.date_unix, }} numFractionDigits={1} age12PlusToggleText={textNl.vaccination_grade_toggle_tile.age_12_plus} @@ -345,8 +333,8 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { /> <VaccinationsKpiHeader text={textNl.repeating_shot_information_block} - dateUnix={boosterShotAdministeredLastValue.date_unix} - dateOfInsertionUnix={boosterShotAdministeredLastValue.date_of_insertion_unix} + dateUnix={boosterShotAdministeredArchivedLastValue.date_unix} + dateOfInsertionUnix={boosterShotAdministeredArchivedLastValue.date_of_insertion_unix} /> <VaccinationsShotKpiSection @@ -375,34 +363,34 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { <VaccinationsKpiHeader text={textNl.booster_information_block} - dateUnix={boosterShotAdministeredLastValue.date_unix} - dateOfInsertionUnix={boosterShotAdministeredLastValue.date_of_insertion_unix} + dateUnix={boosterShotAdministeredArchivedLastValue.date_unix} + dateOfInsertionUnix={boosterShotAdministeredArchivedLastValue.date_of_insertion_unix} /> <VaccineBoosterAdministrationsKpiSection text={textNl.booster_kpi} - totalBoosterShots={boosterShotAdministeredLastValue.administered_total} + totalBoosterShots={boosterShotAdministeredArchivedLastValue.administered_total} metadateBoosterShots={{ datumsText: textNl.booster_kpi.datums, - date: boosterShotAdministeredLastValue.date_unix, + date: boosterShotAdministeredArchivedLastValue.date_unix, source: { href: textNl.booster_kpi.sources.href, text: textNl.booster_kpi.sources.text, }, }} - boosterGgdValue={boosterShotAdministeredLastValue.ggd_administered_total} + boosterGgdValue={boosterShotAdministeredArchivedLastValue.ggd_administered_total} metadateBoosterGgd={{ datumsText: textNl.booster_kpi.datums, - date: boosterShotAdministeredLastValue.date_unix, + date: boosterShotAdministeredArchivedLastValue.date_unix, source: { href: textNl.booster_kpi.sources.href, text: textNl.booster_kpi.sources.text, }, }} - boosterEstimatedValue={boosterShotAdministeredLastValue.others_administered_total} + boosterEstimatedValue={boosterShotAdministeredArchivedLastValue.others_administered_total} metadateBoosterEstimated={{ datumsText: textNl.booster_kpi.datums, - date: boosterShotAdministeredLastValue.date_unix, + date: boosterShotAdministeredArchivedLastValue.date_unix, source: { href: textNl.booster_kpi.sources.href, text: textNl.booster_kpi.sources.text, diff --git a/packages/app/src/pages/veiligheidsregio/[code]/vaccinaties.tsx b/packages/app/src/pages/veiligheidsregio/[code]/vaccinaties.tsx index 661fa06e9f..9b8ae0fc80 100644 --- a/packages/app/src/pages/veiligheidsregio/[code]/vaccinaties.tsx +++ b/packages/app/src/pages/veiligheidsregio/[code]/vaccinaties.tsx @@ -1,18 +1,14 @@ -import { colors, GmCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; +import { colors } from '@corona-dashboard/common'; import { Vaccinaties as VaccinatieIcon } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { useRouter } from 'next/router'; import { useState } from 'react'; -import { hasValueAtKey, isDefined, isPresent } from 'ts-is-present'; -import { Box } from '~/components/base'; -import { thresholds } from '~/components/choropleth/logic'; -import { TileList, PageInformationBlock, Markdown, ChoroplethTile, DynamicChoropleth, Divider } from '~/components'; +import { isDefined, isPresent } from 'ts-is-present'; +import { TileList, PageInformationBlock, Divider } from '~/components'; import { gmCodesByVrCode } from '~/data'; import { Layout, VrLayout } from '~/domain/layout'; -import { AgeGroup, AgeGroupSelect } from '~/domain/vaccine/components/age-group-select'; -import { VaccinationCoverageKindSelect, CoverageKindProperty } from '~/domain/vaccine/components/vaccination-coverage-kind-select'; -import { matchingAgeGroups } from '~/domain/vaccine/common'; -import { selectVaccineCoverageData, ChoroplethTooltip, VaccineCoveragePerAgeGroup, VaccineCoverageToggleTile, VaccineCoverageTile } from '~/domain/vaccine'; +import { VaccineCoveragePerAgeGroup, VaccineCoverageToggleTile, VaccineCoverageTile } from '~/domain/vaccine'; +import { AgeDataType } from '~/domain/vaccine/vaccine-coverage-tile/vaccine-coverage-tile'; import { useIntl } from '~/intl'; import { Languages, SiteText } from '~/locale'; import { getArticleParts, getLinkParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; @@ -22,10 +18,9 @@ import { ArticleParts, LinkParts, PagePartQueryResult } from '~/types/cms'; import { assert, replaceVariablesInText, useReverseRouter, useFormatLokalizePercentage } from '~/utils'; import { getLastInsertionDateOfPage } from '~/utils/get-last-insertion-date-of-page'; import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; -import { BoldText } from '~/components/typography'; -import css from '@styled-system/css'; +import { VaccineCoverageChoroplethVrAndGm } from '~/domain/vaccine/vaccine-coverage-choropleth_vr_and_gm'; -const pageMetrics = ['vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'booster_coverage']; +const pageMetrics = ['vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'booster_coverage_archived_20220904']; const selectLokalizeTexts = (siteText: SiteText) => ({ textNl: siteText.pages.vaccinations_page.nl, @@ -35,12 +30,22 @@ const selectLokalizeTexts = (siteText: SiteText) => ({ type LokalizeTexts = ReturnType<typeof selectLokalizeTexts>; +type ParsedCoverageData = { + autumn2022: [AgeDataType, AgeDataType]; + primarySeries: [AgeDataType, AgeDataType]; +}; + export { getStaticPaths } from '~/static-paths/vr'; export const getStaticProps = createGetStaticProps( ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), getLastGeneratedDate, - selectVrData('vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'vaccine_coverage_per_age_group_archived_20220908', 'booster_coverage'), + selectVrData( + 'vaccine_coverage_per_age_group', + 'vaccine_coverage_per_age_group_archived', + 'vaccine_coverage_per_age_group_archived_20220908', + 'booster_coverage_archived_20220904' + ), createGetChoroplethData({ gm: ({ vaccine_coverage_per_age_group }, ctx) => { if (!isDefined(vaccine_coverage_per_age_group)) { @@ -49,11 +54,9 @@ export const getStaticProps = createGetStaticProps( }; } return { - vaccine_coverage_per_age_group: selectVaccineCoverageData( - isPresent(ctx.params?.code) - ? vaccine_coverage_per_age_group.filter((el) => gmCodesByVrCode[ctx.params?.code as string].includes(el.gmcode)) - : vaccine_coverage_per_age_group - ), + vaccine_coverage_per_age_group: isPresent(ctx.params?.code) + ? vaccine_coverage_per_age_group.filter((vaccineCoveragePerAgeGroup) => gmCodesByVrCode[ctx.params?.code as string].includes(vaccineCoveragePerAgeGroup.gmcode)) + : vaccine_coverage_per_age_group, }; }, }), @@ -76,23 +79,9 @@ export const VaccinationsVrPage = (props: StaticProps<typeof getStaticProps>) => const router = useRouter(); const { formatPercentageAsNumber } = useFormatLokalizePercentage(); const [hasHideArchivedCharts, setHideArchivedCharts] = useState<boolean>(false); - const [selectedAgeGroup, setSelectedAgeGroup] = useState<AgeGroup>('18+'); - const [selectedCoverageKind, setSelectedCoverageKind] = useState<CoverageKindProperty>('fully_vaccinated_percentage'); const { textNl, textVr, textShared } = useDynamicLokalizeTexts<LokalizeTexts>(pageText, selectLokalizeTexts); - /** - * When changing between coverage kinds where the selected age group isn't available, - * the other coverage kind set the non-matching age group to a default one. - */ - const setSelectedCoverageKindAndAge = (coverageKind: CoverageKindProperty) => { - if (coverageKind === selectedCoverageKind) return; - if (selectedAgeGroup !== '12+') { - setSelectedAgeGroup(selectedAgeGroup === '18+' ? '60+' : '18+'); - } - setSelectedCoverageKind(coverageKind); - }; - const metadata = { ...textVr.metadata, title: replaceVariablesInText(textVr.metadata.title, { @@ -107,37 +96,71 @@ export const VaccinationsVrPage = (props: StaticProps<typeof getStaticProps>) => const selectedGmCode = gmCodes ? gmCodes[0] : undefined; const lastInsertionDateOfPage = getLastInsertionDateOfPage(data, pageMetrics); - const choroplethData: GmCollectionVaccineCoveragePerAgeGroup[] = choropleth.gm.vaccine_coverage_per_age_group.filter(hasValueAtKey('age_group_range', selectedAgeGroup)); - /** - * Filter out only the 12+ and 18+ for the toggle component. - */ - const filteredAgeGroup60Plus = data.vaccine_coverage_per_age_group.values.find((item) => item.age_group_range === '60+'); + const filteredVaccination = { + primarySeries: data.vaccine_coverage_per_age_group.values.find((item) => item.vaccination_type === 'primary_series'), + autumn2022: data.vaccine_coverage_per_age_group.values.find((item) => item.vaccination_type === 'autumn_2022'), + }; - const filteredAgeGroup18Plus = data.vaccine_coverage_per_age_group.values.find((item) => item.age_group_range === '18+'); + assert(filteredVaccination.primarySeries, `[${VaccinationsVrPage.name}] Could not find data for the vaccine coverage per age group for the primary series`); + assert(filteredVaccination.autumn2022, `[${VaccinationsVrPage.name}] Could not find data for the vaccine coverage per age group for the autumn 2022 series`); - const filteredAgeGroup12Plus = data.vaccine_coverage_per_age_group.values.find((item) => item.age_group_range === '12+'); + const boosterCoverage18PlusArchivedValue = data.booster_coverage_archived_20220904.values.find((v) => v.age_group === '18+'); + const boosterCoverage12PlusArchivedValue = data.booster_coverage_archived_20220904.values.find((v) => v.age_group === '12+'); - /** - * Archived - Filter out only the the 12+ and 18+ for the toggle component. - */ const filteredAgeGroup18PlusArchived = data.vaccine_coverage_per_age_group_archived_20220908.values.find((item) => item.age_group_range === '18+'); - const filteredAgeGroup12PlusArchived = data.vaccine_coverage_per_age_group_archived_20220908.values.find((item) => item.age_group_range === '12+'); - const boosterCoverage18PlusValue = data.booster_coverage.values.find((v) => v.age_group === '18+'); - const boosterCoverage12PlusValue = data.booster_coverage.values.find((v) => v.age_group === '12+'); - - assert(filteredAgeGroup60Plus, `[${VaccinationsVrPage.name}] Could not find data for the vaccine coverage per age group for the age 18+`); - - assert(filteredAgeGroup18Plus, `[${VaccinationsVrPage.name}] Could not find data for the vaccine coverage per age group for the age 18+`); - - assert(filteredAgeGroup12Plus, `[${VaccinationsVrPage.name}] Could not find data for the vaccine coverage per age group for the age 12+`); - assert(filteredAgeGroup18PlusArchived, `[${VaccinationsVrPage.name}] Could not find archived data for the vaccine coverage per age group for the age 18+`); - assert(filteredAgeGroup12PlusArchived, `[${VaccinationsVrPage.name}] Could not find archived data for the vaccine coverage per age group for the age 12+`); + const parsedVaccineCoverageData: ParsedCoverageData = { + autumn2022: [ + { + value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus, + birthyear: filteredVaccination.autumn2022.birthyear_range_60_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, + bar: { + value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus || 0, + color: colors.scale.blueDetailed[8], + }, + }, + { + value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus, + birthyear: filteredVaccination.autumn2022.birthyear_range_12_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, + bar: { + value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus || 0, + color: colors.scale.blueDetailed[8], + }, + }, + ], + primarySeries: [ + { + value: filteredVaccination.primarySeries.vaccinated_percentage_18_plus, + birthyear: filteredVaccination.primarySeries.birthyear_range_18_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_18_plus, + description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_18_plus, + bar: { + value: filteredVaccination.primarySeries.vaccinated_percentage_18_plus || 0, + color: colors.scale.blueDetailed[3], + }, + }, + { + value: filteredVaccination.primarySeries.vaccinated_percentage_12_plus, + birthyear: filteredVaccination.primarySeries.birthyear_range_12_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, + description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_12_plus, + bar: { + value: filteredVaccination.primarySeries.vaccinated_percentage_12_plus || 0, + color: colors.scale.blueDetailed[3], + }, + }, + ], + }; + return ( <Layout {...metadata} lastGenerated={lastGenerated}> <VrLayout vrName={vrName}> @@ -151,7 +174,7 @@ export const VaccinationsVrPage = (props: StaticProps<typeof getStaticProps>) => icon={<VaccinatieIcon aria-hidden="true" />} metadata={{ datumsText: textVr.vaccination_coverage.top_level_information_block.dates, - dateOrRange: filteredAgeGroup18Plus.date_unix, + dateOrRange: filteredVaccination.primarySeries.date_unix, dateOfInsertionUnix: lastInsertionDateOfPage, dataSources: [], }} @@ -161,130 +184,39 @@ export const VaccinationsVrPage = (props: StaticProps<typeof getStaticProps>) => vrNameOrGmName={vrName} warning={textVr.warning} /> + {filteredVaccination.autumn2022.birthyear_range_60_plus && ( + <VaccineCoverageTile + title={textShared.vaccination_grade_tile.autumn_labels.title} + description={textShared.vaccination_grade_tile.autumn_labels.description} + source={textShared.vaccination_grade_tile.autumn_labels.source} + descriptionFooter={textShared.vaccination_grade_tile.autumn_labels.description_footer} + coverageData={parsedVaccineCoverageData.autumn2022} + dateUnix={filteredVaccination.autumn2022.date_unix} + /> + )} - <VaccineCoverageTile - title={textShared.vaccination_grade_tile.autumn_labels.title} - description={textShared.vaccination_grade_tile.autumn_labels.description} - source={textShared.vaccination_grade_tile.autumn_labels.source} - descriptionFooter={textShared.vaccination_grade_tile.autumn_labels.description_footer} - coverageData={[ - { - value: filteredAgeGroup60Plus.autumn_2022_vaccinated_percentage, - birthyear: filteredAgeGroup60Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, - bar: { - value: filteredAgeGroup60Plus.autumn_2022_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[8], - }, - }, - { - value: filteredAgeGroup12Plus.autumn_2022_vaccinated_percentage, - birthyear: filteredAgeGroup12Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, - bar: { - value: filteredAgeGroup12Plus.autumn_2022_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[8], - }, - }, - ]} - dateUnix={filteredAgeGroup12Plus.date_unix} - /> <VaccineCoverageTile title={textShared.vaccination_grade_tile.fully_vaccinated_labels.title} description={textShared.vaccination_grade_tile.fully_vaccinated_labels.description} source={textShared.vaccination_grade_tile.fully_vaccinated_labels.source} descriptionFooter={textShared.vaccination_grade_tile.fully_vaccinated_labels.description_footer} - coverageData={[ - { - value: filteredAgeGroup18Plus.fully_vaccinated_percentage, - birthyear: filteredAgeGroup18Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_18_plus, - description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_18_plus, - bar: { - value: filteredAgeGroup18Plus.fully_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[3], - }, - }, - { - value: filteredAgeGroup12Plus.fully_vaccinated_percentage, - birthyear: filteredAgeGroup12Plus.birthyear_range, - title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, - description: textShared.vaccination_grade_tile.fully_vaccinated_labels.description_12_plus, - bar: { - value: filteredAgeGroup12Plus.fully_vaccinated_percentage || 0, - color: colors.scale.blueDetailed[3], - }, - }, - ]} - dateUnix={filteredAgeGroup12Plus.date_unix} + coverageData={parsedVaccineCoverageData.primarySeries} + dateUnix={filteredVaccination.primarySeries.date_unix} /> - - <ChoroplethTile - title={replaceVariablesInText(commonTexts.choropleth.vaccination_coverage.vr.title, { safetyRegionName: vrName })} - description={ - <> - <Markdown content={replaceVariablesInText(commonTexts.choropleth.vaccination_coverage.vr.description, { safetyRegionName: vrName })} /> - <Box display="flex" flexDirection="row" justifyContent="flex-start" spacingHorizontal={2} as={'fieldset'}> - <BoldText - as="legend" - css={css({ - flexBasis: '100%', - mb: 2, - })} - > - {commonTexts.choropleth.vaccination_coverage.shared.dropdowns_title} - </BoldText> - - <Box display="flex" width="100%" spacingHorizontal={{ xs: 2 }} flexWrap="wrap" flexDirection={{ _: 'column', xs: 'row' }}> - <Box flex="1"> - <VaccinationCoverageKindSelect onChange={setSelectedCoverageKindAndAge} initialValue={selectedCoverageKind} /> - </Box> - <Box flex="1"> - <Box maxWidth="20rem"> - <AgeGroupSelect onChange={setSelectedAgeGroup} initialValue={selectedAgeGroup} shownAgeGroups={matchingAgeGroups[selectedCoverageKind]} /> - </Box> - </Box> - </Box> - </Box> - </> - } - legend={{ - thresholds: thresholds.gm.fully_vaccinated_percentage, - title: commonTexts.choropleth.choropleth_vaccination_coverage.shared.legend_title, - }} - metadata={{ - source: commonTexts.choropleth.vaccination_coverage.shared.bronnen.rivm, - date: choropleth.gm.vaccine_coverage_per_age_group[0].date_unix, - }} - hasPadding - > - <DynamicChoropleth - accessibility={{ key: 'vaccine_coverage_nl_choropleth' }} - map="gm" - data={choroplethData} - dataConfig={{ - metricName: 'vaccine_coverage_per_age_group', - metricProperty: selectedCoverageKind, - }} - dataOptions={{ + <VaccineCoverageChoroplethVrAndGm + data={choropleth.gm.vaccine_coverage_per_age_group} + vrOrGmOptions={{ + dataOptions: { getLink: reverseRouter.gm.vaccinaties, selectedCode: selectedGmCode, - tooltipVariables: { - age_group: commonTexts.common.age_groups[selectedAgeGroup], - }, - }} - formatTooltip={(context) => ( - <ChoroplethTooltip - data={context} - mapData={choropleth.gm.vaccine_coverage_per_age_group.filter((singleGm) => singleGm.gmcode === context.code)} - ageGroups={matchingAgeGroups[selectedCoverageKind]} - selectedCoverageKind={selectedCoverageKind} - /> - )} - /> - </ChoroplethTile> + isPercentage: true, + }, + text: { + title: replaceVariablesInText(commonTexts.choropleth.vaccination_coverage.vr.title, { safetyRegionName: vrName }), + description: replaceVariablesInText(commonTexts.choropleth.vaccination_coverage.vr.description, { safetyRegionName: vrName }), + }, + }} + /> <Divider /> <PageInformationBlock title={textNl.section_archived.title} @@ -305,9 +237,9 @@ export const VaccinationsVrPage = (props: StaticProps<typeof getStaticProps>) => birthyear: filteredAgeGroup18PlusArchived.birthyear_range, fully_vaccinated_label: filteredAgeGroup18PlusArchived.fully_vaccinated_percentage_label, has_one_shot_label: filteredAgeGroup18PlusArchived.has_one_shot_percentage_label, - boostered: formatPercentageAsNumber(`${boosterCoverage18PlusValue?.percentage}`), - boostered_label: boosterCoverage18PlusValue?.percentage_label, - dateUnixBoostered: boosterCoverage18PlusValue?.date_unix, + boostered: formatPercentageAsNumber(`${boosterCoverage18PlusArchivedValue?.percentage}`), + boostered_label: boosterCoverage18PlusArchivedValue?.percentage_label, + dateUnixBoostered: boosterCoverage18PlusArchivedValue?.date_unix, }} age12Plus={{ fully_vaccinated: filteredAgeGroup12PlusArchived.fully_vaccinated_percentage, @@ -315,9 +247,9 @@ export const VaccinationsVrPage = (props: StaticProps<typeof getStaticProps>) => birthyear: filteredAgeGroup12PlusArchived.birthyear_range, fully_vaccinated_label: filteredAgeGroup12PlusArchived.fully_vaccinated_percentage_label, has_one_shot_label: filteredAgeGroup12PlusArchived.has_one_shot_percentage_label, - boostered: formatPercentageAsNumber(`${boosterCoverage12PlusValue?.percentage}`), - boostered_label: boosterCoverage12PlusValue?.percentage_label, - dateUnixBoostered: boosterCoverage12PlusValue?.date_unix, + boostered: formatPercentageAsNumber(`${boosterCoverage12PlusArchivedValue?.percentage}`), + boostered_label: boosterCoverage12PlusArchivedValue?.percentage_label, + dateUnixBoostered: boosterCoverage12PlusArchivedValue?.date_unix, }} age12PlusToggleText={textVr.vaccination_grade_toggle_tile.age_12_plus} age18PlusToggleText={textVr.vaccination_grade_toggle_tile.age_18_plus} diff --git a/packages/app/src/types/cms.d.ts b/packages/app/src/types/cms.d.ts index fe72e4b8b5..5f4fd430b0 100644 --- a/packages/app/src/types/cms.d.ts +++ b/packages/app/src/types/cms.d.ts @@ -47,11 +47,7 @@ export type RichTextParts = { text: RichContentBlock[]; } & PageBasePart; -export type PagePart = - | ArticleParts - | LinkParts - | HighlightedItemParts - | RichTextParts; +export type PagePart = ArticleParts | LinkParts | HighlightedItemParts | RichTextParts; export type PagePartQueryResult<T extends PagePart = PagePart> = { pageParts: T[]; @@ -175,9 +171,9 @@ export type Measures = { _rev: string; _type: 'measures'; _updatedAt: string; - icon: string ; + icon: string; title: string; - description: RichContentBlock[] | null + description: RichContentBlock[] | null; measuresCollection: MeasuresCollection[]; }; declare module 'picosanity' { diff --git a/packages/cms/src/data/data-structure.ts b/packages/cms/src/data/data-structure.ts index d7babd9fed..3e2f06c0b8 100644 --- a/packages/cms/src/data/data-structure.ts +++ b/packages/cms/src/data/data-structure.ts @@ -4,631 +4,481 @@ */ export const dataStructure = { gm: { - deceased_rivm: ["covid_daily", "covid_daily_moving_average", "covid_total"], + deceased_rivm: ['covid_daily', 'covid_daily_moving_average', 'covid_total'], hospital_nice: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_moving_average", - "admissions_on_date_of_admission_moving_average_rounded", - "admissions_on_date_of_reporting", - ], - tested_overall: [ - "infected", - "infected_moving_average", - "infected_moving_average_rounded", - "infected_per_100k", - "infected_per_100k_moving_average", - ], - sewer: [ - "average", - "total_number_of_samples", - "sampled_installation_count", - "total_installation_count", + 'admissions_on_date_of_admission', + 'admissions_on_date_of_admission_moving_average', + 'admissions_on_date_of_admission_moving_average_rounded', + 'admissions_on_date_of_reporting', ], + tested_overall: ['infected', 'infected_moving_average', 'infected_moving_average_rounded', 'infected_per_100k', 'infected_per_100k_moving_average'], + sewer: ['average', 'total_number_of_samples', 'sampled_installation_count', 'total_installation_count'], vaccine_coverage_per_age_group: [ - "age_group_range", - "autumn_2022_vaccinated_percentage", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "birthyear_range", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", + 'age_group_range', + 'autumn_2022_vaccinated_percentage', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'birthyear_range', + 'autumn_2022_vaccinated_percentage_label', + 'fully_vaccinated_percentage_label', + 'booster_shot_percentage_label', ], vaccine_coverage_per_age_group_archived: [ - "age_group_range", - "fully_vaccinated_percentage", - "has_one_shot_percentage", - "birthyear_range", - "fully_vaccinated_percentage_label", - "has_one_shot_percentage_label", + 'age_group_range', + 'fully_vaccinated_percentage', + 'has_one_shot_percentage', + 'birthyear_range', + 'fully_vaccinated_percentage_label', + 'has_one_shot_percentage_label', ], vaccine_coverage_per_age_group_archived_20220908: [ - "age_group_range", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "has_one_shot_percentage", - "birthyear_range", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", - "has_one_shot_percentage_label", - ], - booster_coverage: ["age_group", "percentage", "percentage_label"], + 'age_group_range', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'has_one_shot_percentage', + 'birthyear_range', + 'fully_vaccinated_percentage_label', + 'booster_shot_percentage_label', + 'has_one_shot_percentage_label', + ], + booster_coverage: ['age_group', 'percentage', 'percentage_label'], }, gm_collection: { - hospital_nice: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_per_100000", - "admissions_on_date_of_reporting", - ], - hospital_nice_choropleth: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_per_100000", - "admissions_on_date_of_reporting", - ], - tested_overall: ["infected_per_100k", "infected"], - sewer: ["average", "total_installation_count"], + hospital_nice: ['admissions_on_date_of_admission', 'admissions_on_date_of_admission_per_100000', 'admissions_on_date_of_reporting'], + hospital_nice_choropleth: ['admissions_on_date_of_admission', 'admissions_on_date_of_admission_per_100000', 'admissions_on_date_of_reporting'], + tested_overall: ['infected_per_100k', 'infected'], + sewer: ['average', 'total_installation_count'], vaccine_coverage_per_age_group: [ - "age_group_range", - "autumn_2022_vaccinated_percentage", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "birthyear_range", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", + 'age_group_range', + 'autumn_2022_vaccinated_percentage', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'birthyear_range', + 'autumn_2022_vaccinated_percentage_label', + 'fully_vaccinated_percentage_label', + 'booster_shot_percentage_label', ], }, nl: { - booster_shot_administered: [ - "administered_total", - "ggd_administered_total", - "others_administered_total", - ], - repeating_shot_administered: ["ggd_administered_total"], - booster_coverage: ["age_group", "percentage"], - doctor: ["covid_symptoms_per_100k", "covid_symptoms"], - g_number: ["g_number"], - infectious_people: ["margin_low", "estimate", "margin_high"], + booster_shot_administered: ['administered_total', 'ggd_administered_total', 'others_administered_total'], + repeating_shot_administered: ['ggd_administered_total'], + booster_coverage: ['age_group', 'percentage'], + doctor: ['covid_symptoms_per_100k', 'covid_symptoms'], + g_number: ['g_number'], + infectious_people: ['margin_low', 'estimate', 'margin_high'], intensive_care_nice: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_moving_average", - "admissions_on_date_of_admission_moving_average_rounded", - "admissions_on_date_of_reporting", + 'admissions_on_date_of_admission', + 'admissions_on_date_of_admission_moving_average', + 'admissions_on_date_of_admission_moving_average_rounded', + 'admissions_on_date_of_reporting', ], intensive_care_nice_per_age_group: [ - "admissions_age_0_19_per_million", - "admissions_age_20_29_per_million", - "admissions_age_30_39_per_million", - "admissions_age_40_49_per_million", - "admissions_age_50_59_per_million", - "admissions_age_60_69_per_million", - "admissions_age_70_79_per_million", - "admissions_age_80_89_per_million", - "admissions_age_90_plus_per_million", - "admissions_overall_per_million", - ], - tested_overall: [ - "infected", - "infected_moving_average", - "infected_moving_average_rounded", - "infected_per_100k", - "infected_per_100k_moving_average", - ], + 'admissions_age_0_19_per_million', + 'admissions_age_20_29_per_million', + 'admissions_age_30_39_per_million', + 'admissions_age_40_49_per_million', + 'admissions_age_50_59_per_million', + 'admissions_age_60_69_per_million', + 'admissions_age_70_79_per_million', + 'admissions_age_80_89_per_million', + 'admissions_age_90_plus_per_million', + 'admissions_overall_per_million', + ], + tested_overall: ['infected', 'infected_moving_average', 'infected_moving_average_rounded', 'infected_per_100k', 'infected_per_100k_moving_average'], tested_per_age_group: [ - "infected_age_0_9_per_100k", - "infected_age_10_19_per_100k", - "infected_age_20_29_per_100k", - "infected_age_30_39_per_100k", - "infected_age_40_49_per_100k", - "infected_age_50_59_per_100k", - "infected_age_60_69_per_100k", - "infected_age_70_79_per_100k", - "infected_age_80_89_per_100k", - "infected_age_90_plus_per_100k", - "infected_overall_per_100k", - ], - reproduction: ["index_low", "index_average", "index_high"], - sewer: ["average"], + 'infected_age_0_9_per_100k', + 'infected_age_10_19_per_100k', + 'infected_age_20_29_per_100k', + 'infected_age_30_39_per_100k', + 'infected_age_40_49_per_100k', + 'infected_age_50_59_per_100k', + 'infected_age_60_69_per_100k', + 'infected_age_70_79_per_100k', + 'infected_age_80_89_per_100k', + 'infected_age_90_plus_per_100k', + 'infected_overall_per_100k', + ], + reproduction: ['index_low', 'index_average', 'index_high'], + sewer: ['average'], hospital_nice: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_moving_average", - "admissions_on_date_of_admission_moving_average_rounded", - "admissions_on_date_of_reporting", + 'admissions_on_date_of_admission', + 'admissions_on_date_of_admission_moving_average', + 'admissions_on_date_of_admission_moving_average_rounded', + 'admissions_on_date_of_reporting', ], hospital_nice_per_age_group: [ - "admissions_age_0_19_per_million", - "admissions_age_20_29_per_million", - "admissions_age_30_39_per_million", - "admissions_age_40_49_per_million", - "admissions_age_50_59_per_million", - "admissions_age_60_69_per_million", - "admissions_age_70_79_per_million", - "admissions_age_80_89_per_million", - "admissions_age_90_plus_per_million", - "admissions_overall_per_million", - ], - hospital_lcps: ["beds_occupied_covid"], - intensive_care_lcps: [ - "beds_occupied_covid", - "beds_occupied_non_covid", - "beds_occupied_covid_percentage", - ], + 'admissions_age_0_19_per_million', + 'admissions_age_20_29_per_million', + 'admissions_age_30_39_per_million', + 'admissions_age_40_49_per_million', + 'admissions_age_50_59_per_million', + 'admissions_age_60_69_per_million', + 'admissions_age_70_79_per_million', + 'admissions_age_80_89_per_million', + 'admissions_age_90_plus_per_million', + 'admissions_overall_per_million', + ], + hospital_lcps: ['beds_occupied_covid'], + intensive_care_lcps: ['beds_occupied_covid', 'beds_occupied_non_covid', 'beds_occupied_covid_percentage'], tested_ggd: [ - "infected", - "infected_moving_average", - "infected_percentage", - "infected_percentage_moving_average", - "tested_total", - "tested_total_moving_average", - "tested_total_moving_average_rounded", - ], - tested_ggd_archived: [ - "infected_percentage", - "infected_percentage_moving_average", - ], + 'infected', + 'infected_moving_average', + 'infected_percentage', + 'infected_percentage_moving_average', + 'tested_total', + 'tested_total_moving_average', + 'tested_total_moving_average_rounded', + ], + tested_ggd_archived: ['infected_percentage', 'infected_percentage_moving_average'], nursing_home: [ - "newly_infected_people", - "newly_infected_people_moving_average", - "deceased_daily", - "deceased_daily_moving_average", - "newly_infected_locations", - "infected_locations_total", - "infected_locations_percentage", + 'newly_infected_people', + 'newly_infected_people_moving_average', + 'deceased_daily', + 'deceased_daily_moving_average', + 'newly_infected_locations', + 'infected_locations_total', + 'infected_locations_percentage', ], disability_care: [ - "newly_infected_people", - "newly_infected_people_moving_average", - "deceased_daily", - "deceased_daily_moving_average", - "newly_infected_locations", - "infected_locations_total", - "infected_locations_percentage", + 'newly_infected_people', + 'newly_infected_people_moving_average', + 'deceased_daily', + 'deceased_daily_moving_average', + 'newly_infected_locations', + 'infected_locations_total', + 'infected_locations_percentage', ], behavior: [ - "number_of_participants", - "curfew_compliance", - "curfew_compliance_trend", - "wash_hands_compliance", - "wash_hands_compliance_trend", - "keep_distance_compliance", - "keep_distance_compliance_trend", - "work_from_home_compliance", - "work_from_home_compliance_trend", - "avoid_crowds_compliance", - "avoid_crowds_compliance_trend", - "symptoms_stay_home_if_mandatory_compliance", - "symptoms_stay_home_if_mandatory_compliance_trend", - "symptoms_get_tested_compliance", - "symptoms_get_tested_compliance_trend", - "wear_mask_public_indoors_compliance", - "wear_mask_public_indoors_compliance_trend", - "wear_mask_public_transport_compliance", - "wear_mask_public_transport_compliance_trend", - "sneeze_cough_elbow_compliance", - "sneeze_cough_elbow_compliance_trend", - "max_visitors_compliance", - "max_visitors_compliance_trend", - "ventilate_home_compliance", - "ventilate_home_compliance_trend", - "selftest_visit_compliance", - "selftest_visit_compliance_trend", - "posttest_isolation_compliance", - "posttest_isolation_compliance_trend", - "curfew_support", - "curfew_support_trend", - "wash_hands_support", - "wash_hands_support_trend", - "keep_distance_support", - "keep_distance_support_trend", - "work_from_home_support", - "work_from_home_support_trend", - "avoid_crowds_support", - "avoid_crowds_support_trend", - "symptoms_stay_home_if_mandatory_support", - "symptoms_stay_home_if_mandatory_support_trend", - "symptoms_get_tested_support", - "symptoms_get_tested_support_trend", - "wear_mask_public_indoors_support", - "wear_mask_public_indoors_support_trend", - "wear_mask_public_transport_support", - "wear_mask_public_transport_support_trend", - "sneeze_cough_elbow_support", - "sneeze_cough_elbow_support_trend", - "max_visitors_support", - "max_visitors_support_trend", - "ventilate_home_support", - "ventilate_home_support_trend", - "selftest_visit_support", - "selftest_visit_support_trend", - "posttest_isolation_support", - "posttest_isolation_support_trend", - ], - behavior_get_tested_support_per_age_group: [ - "percentage_average", - "percentage_70_plus", - "percentage_55_69", - "percentage_40_54", - "percentage_25_39", - "percentage_16_24", - ], - behavior_annotations: [ - "behavior_indicator", - "message_title_nl", - "message_title_en", - "message_desc_nl", - "message_desc_en", - ], - deceased_rivm: ["covid_daily", "covid_daily_moving_average", "covid_total"], - deceased_rivm_per_age_group: [ - "age_group_range", - "age_group_percentage", - "covid_percentage", - ], - deceased_cbs: ["registered", "expected", "expected_min", "expected_max"], - elderly_at_home: [ - "positive_tested_daily", - "positive_tested_daily_moving_average", - "positive_tested_daily_per_100k", - "deceased_daily", - "deceased_daily_moving_average", - ], - vaccine_vaccinated_or_support: [ - "percentage_average", - "percentage_70_plus", - "percentage_55_69", - "percentage_40_54", - "percentage_25_39", - "percentage_16_24", - ], - corona_melder_app_download: ["count"], - corona_melder_app_warning: ["count"], - vaccine_coverage: [ - "booster_vaccinated", - "partially_vaccinated", - "fully_vaccinated", - "partially_or_fully_vaccinated", - ], - vaccine_delivery_estimate: ["total"], - vaccine_delivery_per_supplier: [ - "total", - "bio_n_tech_pfizer", - "moderna", - "astra_zeneca", - "cure_vac", - "janssen", - "sanofi", - "is_estimate", - "week_number", - "date_of_report_unix", - ], - vaccine_administered: [ - "pfizer", - "moderna", - "astra_zeneca", - "cure_vac", - "janssen", - "sanofi", - "novavax", - "total", - ], - vaccine_administered_doctors: ["estimated"], - vaccine_administered_ggd_ghor: ["reported"], - vaccine_administered_ggd: ["estimated"], - vaccine_administered_hospitals_and_care_institutions: ["estimated"], - vaccine_administered_total: ["estimated", "reported"], - vaccine_administered_planned: ["doses"], + 'number_of_participants', + 'curfew_compliance', + 'curfew_compliance_trend', + 'wash_hands_compliance', + 'wash_hands_compliance_trend', + 'keep_distance_compliance', + 'keep_distance_compliance_trend', + 'work_from_home_compliance', + 'work_from_home_compliance_trend', + 'avoid_crowds_compliance', + 'avoid_crowds_compliance_trend', + 'symptoms_stay_home_if_mandatory_compliance', + 'symptoms_stay_home_if_mandatory_compliance_trend', + 'symptoms_get_tested_compliance', + 'symptoms_get_tested_compliance_trend', + 'wear_mask_public_indoors_compliance', + 'wear_mask_public_indoors_compliance_trend', + 'wear_mask_public_transport_compliance', + 'wear_mask_public_transport_compliance_trend', + 'sneeze_cough_elbow_compliance', + 'sneeze_cough_elbow_compliance_trend', + 'max_visitors_compliance', + 'max_visitors_compliance_trend', + 'ventilate_home_compliance', + 'ventilate_home_compliance_trend', + 'selftest_visit_compliance', + 'selftest_visit_compliance_trend', + 'posttest_isolation_compliance', + 'posttest_isolation_compliance_trend', + 'curfew_support', + 'curfew_support_trend', + 'wash_hands_support', + 'wash_hands_support_trend', + 'keep_distance_support', + 'keep_distance_support_trend', + 'work_from_home_support', + 'work_from_home_support_trend', + 'avoid_crowds_support', + 'avoid_crowds_support_trend', + 'symptoms_stay_home_if_mandatory_support', + 'symptoms_stay_home_if_mandatory_support_trend', + 'symptoms_get_tested_support', + 'symptoms_get_tested_support_trend', + 'wear_mask_public_indoors_support', + 'wear_mask_public_indoors_support_trend', + 'wear_mask_public_transport_support', + 'wear_mask_public_transport_support_trend', + 'sneeze_cough_elbow_support', + 'sneeze_cough_elbow_support_trend', + 'max_visitors_support', + 'max_visitors_support_trend', + 'ventilate_home_support', + 'ventilate_home_support_trend', + 'selftest_visit_support', + 'selftest_visit_support_trend', + 'posttest_isolation_support', + 'posttest_isolation_support_trend', + ], + behavior_get_tested_support_per_age_group: ['percentage_average', 'percentage_70_plus', 'percentage_55_69', 'percentage_40_54', 'percentage_25_39', 'percentage_16_24'], + behavior_annotations: ['behavior_indicator', 'message_title_nl', 'message_title_en', 'message_desc_nl', 'message_desc_en'], + deceased_rivm: ['covid_daily', 'covid_daily_moving_average', 'covid_total'], + deceased_rivm_per_age_group: ['age_group_range', 'age_group_percentage', 'covid_percentage'], + deceased_cbs: ['registered', 'expected', 'expected_min', 'expected_max'], + elderly_at_home: ['positive_tested_daily', 'positive_tested_daily_moving_average', 'positive_tested_daily_per_100k', 'deceased_daily', 'deceased_daily_moving_average'], + vaccine_vaccinated_or_support: ['percentage_average', 'percentage_70_plus', 'percentage_55_69', 'percentage_40_54', 'percentage_25_39', 'percentage_16_24'], + corona_melder_app_download: ['count'], + corona_melder_app_warning: ['count'], + vaccine_coverage: ['booster_vaccinated', 'partially_vaccinated', 'fully_vaccinated', 'partially_or_fully_vaccinated'], + vaccine_delivery_estimate: ['total'], + vaccine_delivery_per_supplier: ['total', 'bio_n_tech_pfizer', 'moderna', 'astra_zeneca', 'cure_vac', 'janssen', 'sanofi', 'is_estimate', 'week_number', 'date_of_report_unix'], + vaccine_administered: ['pfizer', 'moderna', 'astra_zeneca', 'cure_vac', 'janssen', 'sanofi', 'novavax', 'total'], + vaccine_administered_doctors: ['estimated'], + vaccine_administered_ggd_ghor: ['reported'], + vaccine_administered_ggd: ['estimated'], + vaccine_administered_hospitals_and_care_institutions: ['estimated'], + vaccine_administered_total: ['estimated', 'reported'], + vaccine_administered_planned: ['doses'], vaccine_coverage_per_age_group: [ - "age_group_range", - "age_group_percentage", - "age_group_total", - "autumn_2022_vaccinated", - "fully_vaccinated", - "booster_shot", - "autumn_2022_vaccinated_percentage", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "date_of_report_unix", - "birthyear_range", + 'age_group_range', + 'age_group_percentage', + 'age_group_total', + 'autumn_2022_vaccinated', + 'fully_vaccinated', + 'booster_shot', + 'autumn_2022_vaccinated_percentage', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'date_of_report_unix', + 'birthyear_range', ], vaccine_coverage_per_age_group_archived: [ - "age_group_range", - "age_group_percentage", - "age_group_total", - "fully_vaccinated", - "has_one_shot", - "fully_vaccinated_percentage", - "has_one_shot_percentage", - "date_of_report_unix", - "birthyear_range", + 'age_group_range', + 'age_group_percentage', + 'age_group_total', + 'fully_vaccinated', + 'has_one_shot', + 'fully_vaccinated_percentage', + 'has_one_shot_percentage', + 'date_of_report_unix', + 'birthyear_range', ], vaccine_coverage_per_age_group_archived_20220908: [ - "age_group_range", - "age_group_percentage", - "age_group_total", - "fully_vaccinated", - "booster_shot", - "has_one_shot", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "has_one_shot_percentage", - "date_of_report_unix", - "birthyear_range", - ], - vaccine_coverage_per_age_group_estimated_fully_vaccinated: [ - "age_12_plus_birthyear", - "age_12_plus_vaccinated", - "age_18_plus_birthyear", - "age_18_plus_vaccinated", - ], - vaccine_coverage_per_age_group_estimated_autumn_2022: [ - "age_12_plus_birthyear", - "age_12_plus_vaccinated", - "age_60_plus_birthyear", - "age_60_plus_vaccinated", - ], + 'age_group_range', + 'age_group_percentage', + 'age_group_total', + 'fully_vaccinated', + 'booster_shot', + 'has_one_shot', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'has_one_shot_percentage', + 'date_of_report_unix', + 'birthyear_range', + ], + vaccine_coverage_per_age_group_estimated_fully_vaccinated: ['age_12_plus_birthyear', 'age_12_plus_vaccinated', 'age_18_plus_birthyear', 'age_18_plus_vaccinated'], + vaccine_coverage_per_age_group_estimated_autumn_2022: ['age_12_plus_birthyear', 'age_12_plus_vaccinated', 'age_60_plus_birthyear', 'age_60_plus_vaccinated'], vaccine_coverage_per_age_group_estimated_archived_20220908: [ - "age_18_plus_fully_vaccinated", - "age_18_plus_has_one_shot", - "age_18_plus_birthyear", - "age_12_plus_fully_vaccinated", - "age_12_plus_has_one_shot", - "age_12_plus_birthyear", + 'age_18_plus_fully_vaccinated', + 'age_18_plus_has_one_shot', + 'age_18_plus_birthyear', + 'age_12_plus_fully_vaccinated', + 'age_12_plus_has_one_shot', + 'age_12_plus_birthyear', ], vaccine_stock: [ - "total_available", - "total_not_available", - "bio_n_tech_pfizer_available", - "bio_n_tech_pfizer_not_available", - "bio_n_tech_pfizer_total", - "moderna_available", - "moderna_not_available", - "moderna_total", - "astra_zeneca_available", - "astra_zeneca_not_available", - "astra_zeneca_total", - "janssen_available", - "janssen_not_available", - "janssen_total", - ], - variants: ["variant_code", "values", "last_value"], + 'total_available', + 'total_not_available', + 'bio_n_tech_pfizer_available', + 'bio_n_tech_pfizer_not_available', + 'bio_n_tech_pfizer_total', + 'moderna_available', + 'moderna_not_available', + 'moderna_total', + 'astra_zeneca_available', + 'astra_zeneca_not_available', + 'astra_zeneca_total', + 'janssen_available', + 'janssen_not_available', + 'janssen_total', + ], + variants: ['variant_code', 'values', 'last_value'], }, topical: {}, vr: { - g_number: ["g_number"], - sewer: ["average"], - tested_overall: [ - "infected", - "infected_moving_average", - "infected_moving_average_rounded", - "infected_per_100k", - "infected_per_100k_moving_average", - ], + g_number: ['g_number'], + sewer: ['average'], + tested_overall: ['infected', 'infected_moving_average', 'infected_moving_average_rounded', 'infected_per_100k', 'infected_per_100k_moving_average'], hospital_nice: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_moving_average", - "admissions_on_date_of_admission_moving_average_rounded", - "admissions_on_date_of_reporting", + 'admissions_on_date_of_admission', + 'admissions_on_date_of_admission_moving_average', + 'admissions_on_date_of_admission_moving_average_rounded', + 'admissions_on_date_of_reporting', ], tested_ggd: [ - "infected", - "infected_moving_average", - "infected_percentage", - "infected_percentage_moving_average", - "tested_total", - "tested_total_moving_average", - "tested_total_moving_average_rounded", - ], - tested_ggd_archived: [ - "infected_percentage", - "infected_percentage_moving_average", - ], + 'infected', + 'infected_moving_average', + 'infected_percentage', + 'infected_percentage_moving_average', + 'tested_total', + 'tested_total_moving_average', + 'tested_total_moving_average_rounded', + ], + tested_ggd_archived: ['infected_percentage', 'infected_percentage_moving_average'], nursing_home: [ - "newly_infected_people", - "newly_infected_people_moving_average", - "newly_infected_locations", - "infected_locations_total", - "infected_locations_percentage", - "deceased_daily", - "deceased_daily_moving_average", + 'newly_infected_people', + 'newly_infected_people_moving_average', + 'newly_infected_locations', + 'infected_locations_total', + 'infected_locations_percentage', + 'deceased_daily', + 'deceased_daily_moving_average', ], disability_care: [ - "newly_infected_people", - "newly_infected_people_moving_average", - "newly_infected_locations", - "infected_locations_total", - "infected_locations_percentage", - "deceased_daily", - "deceased_daily_moving_average", + 'newly_infected_people', + 'newly_infected_people_moving_average', + 'newly_infected_locations', + 'infected_locations_total', + 'infected_locations_percentage', + 'deceased_daily', + 'deceased_daily_moving_average', ], behavior_archived_20221019: [ - "number_of_participants", - "curfew_compliance", - "curfew_compliance_trend", - "wash_hands_compliance", - "wash_hands_compliance_trend", - "keep_distance_compliance", - "keep_distance_compliance_trend", - "work_from_home_compliance", - "work_from_home_compliance_trend", - "avoid_crowds_compliance", - "avoid_crowds_compliance_trend", - "wear_mask_public_indoors_compliance", - "wear_mask_public_indoors_compliance_trend", - "sneeze_cough_elbow_compliance", - "sneeze_cough_elbow_compliance_trend", - "max_visitors_compliance", - "max_visitors_compliance_trend", - "ventilate_home_compliance", - "ventilate_home_compliance_trend", - "selftest_visit_compliance", - "selftest_visit_compliance_trend", - "curfew_support", - "curfew_support_trend", - "wash_hands_support", - "wash_hands_support_trend", - "keep_distance_support", - "keep_distance_support_trend", - "work_from_home_support", - "work_from_home_support_trend", - "avoid_crowds_support", - "avoid_crowds_support_trend", - "wear_mask_public_indoors_support", - "wear_mask_public_indoors_support_trend", - "sneeze_cough_elbow_support", - "sneeze_cough_elbow_support_trend", - "max_visitors_support", - "max_visitors_support_trend", - "ventilate_home_support", - "ventilate_home_support_trend", - "selftest_visit_support", - "selftest_visit_support_trend", - ], - deceased_rivm: ["covid_daily", "covid_daily_moving_average", "covid_total"], - deceased_cbs: ["registered", "expected", "expected_min", "expected_max"], - elderly_at_home: [ - "positive_tested_daily", - "positive_tested_daily_moving_average", - "positive_tested_daily_per_100k", - "deceased_daily", - "deceased_daily_moving_average", - ], - tested_overall_sum: ["infected_per_100k"], - hospital_nice_sum: ["admissions_per_1m"], + 'number_of_participants', + 'curfew_compliance', + 'curfew_compliance_trend', + 'wash_hands_compliance', + 'wash_hands_compliance_trend', + 'keep_distance_compliance', + 'keep_distance_compliance_trend', + 'work_from_home_compliance', + 'work_from_home_compliance_trend', + 'avoid_crowds_compliance', + 'avoid_crowds_compliance_trend', + 'wear_mask_public_indoors_compliance', + 'wear_mask_public_indoors_compliance_trend', + 'sneeze_cough_elbow_compliance', + 'sneeze_cough_elbow_compliance_trend', + 'max_visitors_compliance', + 'max_visitors_compliance_trend', + 'ventilate_home_compliance', + 'ventilate_home_compliance_trend', + 'selftest_visit_compliance', + 'selftest_visit_compliance_trend', + 'curfew_support', + 'curfew_support_trend', + 'wash_hands_support', + 'wash_hands_support_trend', + 'keep_distance_support', + 'keep_distance_support_trend', + 'work_from_home_support', + 'work_from_home_support_trend', + 'avoid_crowds_support', + 'avoid_crowds_support_trend', + 'wear_mask_public_indoors_support', + 'wear_mask_public_indoors_support_trend', + 'sneeze_cough_elbow_support', + 'sneeze_cough_elbow_support_trend', + 'max_visitors_support', + 'max_visitors_support_trend', + 'ventilate_home_support', + 'ventilate_home_support_trend', + 'selftest_visit_support', + 'selftest_visit_support_trend', + ], + deceased_rivm: ['covid_daily', 'covid_daily_moving_average', 'covid_total'], + deceased_cbs: ['registered', 'expected', 'expected_min', 'expected_max'], + elderly_at_home: ['positive_tested_daily', 'positive_tested_daily_moving_average', 'positive_tested_daily_per_100k', 'deceased_daily', 'deceased_daily_moving_average'], + tested_overall_sum: ['infected_per_100k'], + hospital_nice_sum: ['admissions_per_1m'], situations: [ - "has_sufficient_data", - "situations_known_percentage", - "situations_known_total", - "investigations_total", - "home_and_visits", - "work", - "school_and_day_care", - "health_care", - "gathering", - "travel", - "hospitality", - "other", + 'has_sufficient_data', + 'situations_known_percentage', + 'situations_known_total', + 'investigations_total', + 'home_and_visits', + 'work', + 'school_and_day_care', + 'health_care', + 'gathering', + 'travel', + 'hospitality', + 'other', ], vaccine_coverage_per_age_group: [ - "age_group_range", - "autumn_2022_vaccinated_percentage", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "birthyear_range", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", + 'age_group_range', + 'autumn_2022_vaccinated_percentage', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'birthyear_range', + 'autumn_2022_vaccinated_percentage_label', + 'fully_vaccinated_percentage_label', + 'booster_shot_percentage_label', ], vaccine_coverage_per_age_group_archived: [ - "age_group_range", - "fully_vaccinated_percentage", - "has_one_shot_percentage", - "birthyear_range", - "fully_vaccinated_percentage_label", - "has_one_shot_percentage_label", + 'age_group_range', + 'fully_vaccinated_percentage', + 'has_one_shot_percentage', + 'birthyear_range', + 'fully_vaccinated_percentage_label', + 'has_one_shot_percentage_label', ], vaccine_coverage_per_age_group_archived_20220908: [ - "age_group_range", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "has_one_shot_percentage", - "birthyear_range", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", - "has_one_shot_percentage_label", - ], - booster_coverage: ["age_group", "percentage", "percentage_label"], + 'age_group_range', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'has_one_shot_percentage', + 'birthyear_range', + 'fully_vaccinated_percentage_label', + 'booster_shot_percentage_label', + 'has_one_shot_percentage_label', + ], + booster_coverage: ['age_group', 'percentage', 'percentage_label'], }, vr_collection: { - hospital_nice: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_per_100000", - "admissions_on_date_of_reporting", - ], - hospital_nice_choropleth: [ - "admissions_on_date_of_admission", - "admissions_on_date_of_admission_per_100000", - "admissions_on_date_of_reporting", - ], - tested_overall: ["infected_per_100k", "infected"], - nursing_home: [ - "newly_infected_people", - "newly_infected_locations", - "infected_locations_total", - "infected_locations_percentage", - "deceased_daily", - ], - sewer: ["average"], + hospital_nice: ['admissions_on_date_of_admission', 'admissions_on_date_of_admission_per_100000', 'admissions_on_date_of_reporting'], + hospital_nice_choropleth: ['admissions_on_date_of_admission', 'admissions_on_date_of_admission_per_100000', 'admissions_on_date_of_reporting'], + tested_overall: ['infected_per_100k', 'infected'], + nursing_home: ['newly_infected_people', 'newly_infected_locations', 'infected_locations_total', 'infected_locations_percentage', 'deceased_daily'], + sewer: ['average'], behavior_archived_20221019: [ - "number_of_participants", - "curfew_compliance", - "curfew_compliance_trend", - "wash_hands_compliance", - "wash_hands_compliance_trend", - "keep_distance_compliance", - "keep_distance_compliance_trend", - "work_from_home_compliance", - "work_from_home_compliance_trend", - "avoid_crowds_compliance", - "avoid_crowds_compliance_trend", - "wear_mask_public_indoors_compliance", - "wear_mask_public_indoors_compliance_trend", - "sneeze_cough_elbow_compliance", - "sneeze_cough_elbow_compliance_trend", - "max_visitors_compliance", - "max_visitors_compliance_trend", - "ventilate_home_compliance", - "ventilate_home_compliance_trend", - "curfew_support", - "curfew_support_trend", - "wash_hands_support", - "wash_hands_support_trend", - "keep_distance_support", - "keep_distance_support_trend", - "work_from_home_support", - "work_from_home_support_trend", - "avoid_crowds_support", - "avoid_crowds_support_trend", - "wear_mask_public_indoors_support", - "wear_mask_public_indoors_support_trend", - "sneeze_cough_elbow_support", - "sneeze_cough_elbow_support_trend", - "max_visitors_support", - "max_visitors_support_trend", - "ventilate_home_support", - "ventilate_home_support_trend", - ], - disability_care: [ - "newly_infected_people", - "newly_infected_locations", - "infected_locations_total", - "infected_locations_percentage", - "deceased_daily", - ], - elderly_at_home: [ - "positive_tested_daily", - "positive_tested_daily_per_100k", - "deceased_daily", - ], - situations: [ - "has_sufficient_data", - "home_and_visits", - "work", - "school_and_day_care", - "health_care", - "gathering", - "travel", - "hospitality", - "other", - ], + 'number_of_participants', + 'curfew_compliance', + 'curfew_compliance_trend', + 'wash_hands_compliance', + 'wash_hands_compliance_trend', + 'keep_distance_compliance', + 'keep_distance_compliance_trend', + 'work_from_home_compliance', + 'work_from_home_compliance_trend', + 'avoid_crowds_compliance', + 'avoid_crowds_compliance_trend', + 'wear_mask_public_indoors_compliance', + 'wear_mask_public_indoors_compliance_trend', + 'sneeze_cough_elbow_compliance', + 'sneeze_cough_elbow_compliance_trend', + 'max_visitors_compliance', + 'max_visitors_compliance_trend', + 'ventilate_home_compliance', + 'ventilate_home_compliance_trend', + 'curfew_support', + 'curfew_support_trend', + 'wash_hands_support', + 'wash_hands_support_trend', + 'keep_distance_support', + 'keep_distance_support_trend', + 'work_from_home_support', + 'work_from_home_support_trend', + 'avoid_crowds_support', + 'avoid_crowds_support_trend', + 'wear_mask_public_indoors_support', + 'wear_mask_public_indoors_support_trend', + 'sneeze_cough_elbow_support', + 'sneeze_cough_elbow_support_trend', + 'max_visitors_support', + 'max_visitors_support_trend', + 'ventilate_home_support', + 'ventilate_home_support_trend', + ], + disability_care: ['newly_infected_people', 'newly_infected_locations', 'infected_locations_total', 'infected_locations_percentage', 'deceased_daily'], + elderly_at_home: ['positive_tested_daily', 'positive_tested_daily_per_100k', 'deceased_daily'], + situations: ['has_sufficient_data', 'home_and_visits', 'work', 'school_and_day_care', 'health_care', 'gathering', 'travel', 'hospitality', 'other'], vaccine_coverage_per_age_group: [ - "age_group_range", - "autumn_2022_vaccinated_percentage", - "fully_vaccinated_percentage", - "booster_shot_percentage", - "birthyear_range", - "autumn_2022_vaccinated_percentage_label", - "fully_vaccinated_percentage_label", - "booster_shot_percentage_label", + 'age_group_range', + 'autumn_2022_vaccinated_percentage', + 'fully_vaccinated_percentage', + 'booster_shot_percentage', + 'birthyear_range', + 'autumn_2022_vaccinated_percentage_label', + 'fully_vaccinated_percentage_label', + 'booster_shot_percentage_label', ], }, }; diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index a7c6419a8a..29d273cf79 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -1 +1,17 @@ timestamp,action,key,document_id,move_to +2022-11-07T15:09:11.939Z,add,common.choropleth_tooltip.gm.outdated_data_notification,TrUIlGMFRR6fBR627mmYKT,__ +2022-11-07T15:41:35.054Z,delete,common.choropleth_tooltip.gm.outdated_data_notification,TrUIlGMFRR6fBR627mmYKT,__ +2022-11-07T15:57:14.611Z,add,common.choropleth_tooltip.outdated_data_notification,Fgb5SAAswLDPRQ9KRzHRc8,__ +2022-11-07T16:00:34.118Z,delete,common.choropleth_tooltip.outdated_data_notification,Fgb5SAAswLDPRQ9KRzHRc8,__ +2022-11-07T16:01:10.105Z,add,common.choropleth_tooltip.gm.average.outdated_data_notification,Fgb5SAAswLDPRQ9KRzIAnG,__ +2022-11-07T16:01:11.103Z,add,common.choropleth_tooltip.vr.average.outdated_data_notification,BBCOmHCrMQzaQKV1wWKvZ9,__ +2022-11-11T08:49:48.826Z,add,pages.sewer_page.nl.choropleth_legend_outdated_data_label,TrUIlGMFRR6fBR628D5VMd,__ +2022-11-21T09:11:46.413Z,add,common.common.age_groups.12,UE7TbOA80ovT85nyy1gcYy,__ +2022-11-21T09:11:47.332Z,add,common.common.age_groups.18,UE7TbOA80ovT85nyy1gcqO,__ +2022-11-21T09:11:48.400Z,add,common.common.age_groups.60,Tg1qSQfR7l8JBUWv7hoA0J,__ +2022-11-21T09:11:49.412Z,add,common.vaccinations.coverage_kinds.autumn_2022,cMBWaVHxQUmXKxLgJyJ8LF,__ +2022-11-21T09:11:50.358Z,add,common.vaccinations.coverage_kinds.fully_basisserie,cMBWaVHxQUmXKxLgJyJ8aT,__ +2022-11-21T09:11:50.359Z,delete,common.vaccinations.coverage_kinds.autumn_2022_vaccinated_percentage,NGAoa2ArqEakZsIxnSDBhz,__ +2022-11-21T09:11:50.360Z,delete,common.vaccinations.coverage_kinds.fully_vaccinated_percentage,jDbv30Y7XYH5kl8ZaoSZwv,__ +2022-11-23T09:37:10.394Z,add,common.vaccinations.coverage_kinds.primary_series,cMBWaVHxQUmXKxLgKD55A5,__ +2022-11-23T09:37:10.395Z,delete,common.vaccinations.coverage_kinds.fully_basisserie,cMBWaVHxQUmXKxLgJyJ8aT,__ diff --git a/packages/cms/src/schemas/measures/measures.ts b/packages/cms/src/schemas/measures/measures.ts index cfda9098ab..aa6f7fe5f8 100644 --- a/packages/cms/src/schemas/measures/measures.ts +++ b/packages/cms/src/schemas/measures/measures.ts @@ -29,7 +29,7 @@ export const measures = { description: 'De maatregelen zijn onderverdeeld in groepen', name: 'measuresCollection', type: 'array', - of: [{ type: 'reference', to: { type: 'measuresCollection'} }], + of: [{ type: 'reference', to: { type: 'measuresCollection' } }], }, ], }; diff --git a/packages/cms/src/schemas/schema.ts b/packages/cms/src/schemas/schema.ts index 3ce670d084..fd8f2a57de 100644 --- a/packages/cms/src/schemas/schema.ts +++ b/packages/cms/src/schemas/schema.ts @@ -24,6 +24,6 @@ export default createSchema({ ...Object.values(objects), ...Object.values(locale), ...Object.values(elements), - ...Object.values(topicalPageConfig), - ), + ...Object.values(topicalPageConfig) + ), }); diff --git a/packages/cms/src/schemas/topical/index.ts b/packages/cms/src/schemas/topical/index.ts index 9d4c961a95..12f14e9ef8 100644 --- a/packages/cms/src/schemas/topical/index.ts +++ b/packages/cms/src/schemas/topical/index.ts @@ -13,6 +13,6 @@ export * from './thermometer-level'; export * from './thermometer-timeline'; export * from './thermometer-timeline-event'; export * from './trend-icon'; -export * from './weekly-summary' -export * from './weekly-summary-item' -export * from './weekly-summary-collection' +export * from './weekly-summary'; +export * from './weekly-summary-item'; +export * from './weekly-summary-collection'; diff --git a/packages/cms/src/schemas/topical/measure-tile-collection.ts b/packages/cms/src/schemas/topical/measure-tile-collection.ts index 41eabdc0d1..683f3346c2 100644 --- a/packages/cms/src/schemas/topical/measure-tile-collection.ts +++ b/packages/cms/src/schemas/topical/measure-tile-collection.ts @@ -1,4 +1,3 @@ - import { REQUIRED } from '../../validation'; export const measureTileCollection = { diff --git a/packages/cms/src/schemas/topical/measure-tile.ts b/packages/cms/src/schemas/topical/measure-tile.ts index 1e57259cde..c8733d81f7 100644 --- a/packages/cms/src/schemas/topical/measure-tile.ts +++ b/packages/cms/src/schemas/topical/measure-tile.ts @@ -25,4 +25,4 @@ export const measureTile = { title: 'description.nl', }, }, -}; \ No newline at end of file +}; diff --git a/packages/cms/src/schemas/topical/thermometer.ts b/packages/cms/src/schemas/topical/thermometer.ts index 5569cde11b..5348230c41 100644 --- a/packages/cms/src/schemas/topical/thermometer.ts +++ b/packages/cms/src/schemas/topical/thermometer.ts @@ -27,12 +27,12 @@ export const thermometer = { { title: 'De beschrijving boven de thermometer', name: 'subTitle', - type: 'localeRichContentBlock' + type: 'localeRichContentBlock', }, { title: 'De titel binnen de thermometer tegel', name: 'tileTitle', - type: 'localeString' + type: 'localeString', }, { title: 'Huidige stand', diff --git a/packages/cms/src/schemas/topical/weekly-summary-collection.ts b/packages/cms/src/schemas/topical/weekly-summary-collection.ts index 56cd96d142..ca5513f93d 100644 --- a/packages/cms/src/schemas/topical/weekly-summary-collection.ts +++ b/packages/cms/src/schemas/topical/weekly-summary-collection.ts @@ -1,4 +1,3 @@ - import { REQUIRED } from '../../validation'; export const weeklySummaryCollection = { diff --git a/packages/cms/src/schemas/topical/weekly-summary-item.ts b/packages/cms/src/schemas/topical/weekly-summary-item.ts index 7a7c7aaf4c..4ac31a37e0 100644 --- a/packages/cms/src/schemas/topical/weekly-summary-item.ts +++ b/packages/cms/src/schemas/topical/weekly-summary-item.ts @@ -30,4 +30,4 @@ export const weeklySummaryItem = { title: 'description.nl', }, }, -}; \ No newline at end of file +}; diff --git a/packages/cms/src/validation/index.ts b/packages/cms/src/validation/index.ts index 0ac316c2eb..7a608fda35 100644 --- a/packages/cms/src/validation/index.ts +++ b/packages/cms/src/validation/index.ts @@ -1,5 +1,4 @@ - import { Rule } from '~/sanity'; export const REQUIRED_MIN_MAX = (rule: Rule, min: number, max: number) => rule.required().min(min).max(max); -export const REQUIRED = (rule: Rule) => rule.required(); \ No newline at end of file +export const REQUIRED = (rule: Rule) => rule.required(); diff --git a/packages/common/src/types/data.ts b/packages/common/src/types/data.ts index 132ca2a3ce..020fa4d12a 100644 --- a/packages/common/src/types/data.ts +++ b/packages/common/src/types/data.ts @@ -1,8 +1,8 @@ /** -* This file was automatically generated by json-schema-to-typescript. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run 'yarn generate-data-types' to regenerate this file. -*/ + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run 'yarn generate-data-types' to regenerate this file. + */ export type GmCode = string; @@ -21,7 +21,7 @@ export interface Gm { vaccine_coverage_per_age_group: GmVaccineCoveragePerAgeGroup; vaccine_coverage_per_age_group_archived: GmVaccineCoveragePerAgeGroupArchived; vaccine_coverage_per_age_group_archived_20220908: GmVaccineCoveragePerAgeGroupArchived_20220908; - booster_coverage: GmBoosterCoverage; + booster_coverage_archived_20220904: GmBoosterCoverageArchived_20220904; } export interface GmStaticValues { population_count: number; @@ -93,6 +93,7 @@ export interface GmSewerValue { sampled_installation_count: number; total_installation_count: number; date_of_insertion_unix: number; + data_is_outdated: boolean; } export interface GmSewerPerInstallation { values: MunicipalSewerPerInstallationInstallation[]; @@ -111,14 +112,16 @@ export interface GmVaccineCoveragePerAgeGroup { values: GmVaccineCoveragePerAgeGroupValue[]; } export interface GmVaccineCoveragePerAgeGroupValue { - age_group_range: "12+" | "18+" | "60+"; - autumn_2022_vaccinated_percentage: number | null; - fully_vaccinated_percentage: number | null; - booster_shot_percentage: number | null; - birthyear_range: string; - autumn_2022_vaccinated_percentage_label: string | null; - fully_vaccinated_percentage_label: string | null; - booster_shot_percentage_label: string | null; + vaccination_type: string; + birthyear_range_12_plus: string; + birthyear_range_18_plus: string; + birthyear_range_60_plus: string | null; + vaccinated_percentage_12_plus: number | null; + vaccinated_percentage_12_plus_label: string | null; + vaccinated_percentage_18_plus: number | null; + vaccinated_percentage_18_plus_label: string | null; + vaccinated_percentage_60_plus: number | null; + vaccinated_percentage_60_plus_label: string | null; date_unix: number; date_of_insertion_unix: number; } @@ -126,7 +129,7 @@ export interface GmVaccineCoveragePerAgeGroupArchived { values: GmVaccineCoveragePerAgeGroupArchivedValue[]; } export interface GmVaccineCoveragePerAgeGroupArchivedValue { - age_group_range: "12+" | "18+"; + age_group_range: '12+' | '18+'; fully_vaccinated_percentage: number | null; has_one_shot_percentage: number | null; birthyear_range: string; @@ -139,7 +142,7 @@ export interface GmVaccineCoveragePerAgeGroupArchived_20220908 { values: GmVaccineCoveragePerAgeGroupArchived_20220908Value[]; } export interface GmVaccineCoveragePerAgeGroupArchived_20220908Value { - age_group_range: "12+" | "18+"; + age_group_range: '12+' | '18+'; fully_vaccinated_percentage: number | null; booster_shot_percentage: number | null; has_one_shot_percentage: number | null; @@ -150,18 +153,18 @@ export interface GmVaccineCoveragePerAgeGroupArchived_20220908Value { date_unix: number; date_of_insertion_unix: number; } -export interface GmBoosterCoverage { - values: GmBoosterCoverageValue[]; +export interface GmBoosterCoverageArchived_20220904 { + values: GmBoosterCoverageArchived_20220904Value[]; } -export interface GmBoosterCoverageValue { - age_group?: "12+" | "18+"; +export interface GmBoosterCoverageArchived_20220904Value { + age_group?: '12+' | '18+'; percentage: number; percentage_label: string | null; date_unix: number; date_of_insertion_unix: number; } -export type GmCollectionId = "GM_COLLECTION"; +export type GmCollectionId = 'GM_COLLECTION'; export interface GmCollection { last_generated: string; @@ -196,22 +199,25 @@ export interface GmCollectionSewer { average: number; total_installation_count: number; date_of_insertion_unix: number; + data_is_outdated: boolean; } export interface GmCollectionVaccineCoveragePerAgeGroup { gmcode: string; - age_group_range: "12+" | "18+" | "60+"; - autumn_2022_vaccinated_percentage: number | null; - fully_vaccinated_percentage: number | null; - booster_shot_percentage: number | null; - birthyear_range: string; - autumn_2022_vaccinated_percentage_label: string | null; - fully_vaccinated_percentage_label: string | null; - booster_shot_percentage_label: string | null; + vaccination_type: string; + birthyear_range_12_plus: string; + birthyear_range_18_plus: string; + birthyear_range_60_plus: string | null; + vaccinated_percentage_12_plus: number | null; + vaccinated_percentage_12_plus_label: string | null; + vaccinated_percentage_18_plus: number | null; + vaccinated_percentage_18_plus_label: string | null; + vaccinated_percentage_60_plus: number | null; + vaccinated_percentage_60_plus_label: string | null; date_unix: number; date_of_insertion_unix: number; } -export type NlId = "NL"; +export type NlId = 'NL'; export interface Nl { last_generated: string; @@ -220,9 +226,9 @@ export interface Nl { code: NlId; difference: NlDifference; named_difference: NlNamedDifference; - booster_shot_administered: NlBoosterShotAdministered; + booster_shot_administered_archived_20220904: NlBoosterShotAdministeredArchived_20220904; repeating_shot_administered: NlRepeatingShotAdministered; - booster_coverage: NlBoosterCoverage; + booster_coverage_archived_20220904: NlBoosterCoverageArchived_20220904; doctor: NlDoctor; g_number: NlGNumber; infectious_people: NlInfectiousPeople; @@ -315,39 +321,39 @@ export interface NlNamedDifference { } export interface NamedDifferenceDecimal { variant_code: - | "B_1_1_529" - | "BA_1" - | "BA_2" - | "BA_4" - | "BA_4_6" - | "BA_5" - | "BA_2+S:L452X" - | "BA_2_12_1" - | "BA_3" - | "B_1_617_2" - | "B_1_351" - | "P_1" - | "B_1_1_7" - | "B_1_621" - | "C_37" - | "BA_2_75" - | "BA_2_75_2" - | "BF_7" - | "BQ_1" - | "BQ_1_1" - | "XBB" - | "other_table" - | "other_graph"; + | 'B_1_1_529' + | 'BA_1' + | 'BA_2' + | 'BA_4' + | 'BA_4_6' + | 'BA_5' + | 'BA_2+S:L452X' + | 'BA_2_12_1' + | 'BA_3' + | 'B_1_617_2' + | 'B_1_351' + | 'P_1' + | 'B_1_1_7' + | 'B_1_621' + | 'C_37' + | 'BA_2_75' + | 'BA_2_75_2' + | 'BF_7' + | 'BQ_1' + | 'BQ_1_1' + | 'XBB' + | 'other_table' + | 'other_graph'; old_value: number; difference: number; old_date_unix: number; new_date_unix: number; } -export interface NlBoosterShotAdministered { - values: NlBoosterShotAdministeredValue[]; - last_value: NlBoosterShotAdministeredValue; +export interface NlBoosterShotAdministeredArchived_20220904 { + values: NlBoosterShotAdministeredArchived_20220904Value[]; + last_value: NlBoosterShotAdministeredArchived_20220904Value; } -export interface NlBoosterShotAdministeredValue { +export interface NlBoosterShotAdministeredArchived_20220904Value { administered_total: number; ggd_administered_total: number; others_administered_total: number; @@ -363,11 +369,11 @@ export interface NlRepeatingShotAdministeredValue { date_unix: number; date_of_insertion_unix: number; } -export interface NlBoosterCoverage { - values: NlBoosterCoverageValue[]; +export interface NlBoosterCoverageArchived_20220904 { + values: NlBoosterCoverageArchived_20220904Value[]; } -export interface NlBoosterCoverageValue { - age_group?: "12+" | "18+"; +export interface NlBoosterCoverageArchived_20220904Value { + age_group?: '12+' | '18+'; percentage: number; date_unix: number; date_of_insertion_unix: number; @@ -599,61 +605,61 @@ export interface NlBehavior { export interface NlBehaviorValue { number_of_participants: number; curfew_compliance?: number | null; - curfew_compliance_trend: ("up" | "down" | "equal") | null; + curfew_compliance_trend: ('up' | 'down' | 'equal') | null; wash_hands_compliance?: number | null; - wash_hands_compliance_trend: ("up" | "down" | "equal") | null; + wash_hands_compliance_trend: ('up' | 'down' | 'equal') | null; keep_distance_compliance?: number | null; - keep_distance_compliance_trend: ("up" | "down" | "equal") | null; + keep_distance_compliance_trend: ('up' | 'down' | 'equal') | null; work_from_home_compliance?: number | null; - work_from_home_compliance_trend: ("up" | "down" | "equal") | null; + work_from_home_compliance_trend: ('up' | 'down' | 'equal') | null; avoid_crowds_compliance?: number | null; - avoid_crowds_compliance_trend: ("up" | "down" | "equal") | null; + avoid_crowds_compliance_trend: ('up' | 'down' | 'equal') | null; symptoms_stay_home_if_mandatory_compliance?: number | null; - symptoms_stay_home_if_mandatory_compliance_trend?: ("up" | "down" | "equal") | null; + symptoms_stay_home_if_mandatory_compliance_trend?: ('up' | 'down' | 'equal') | null; symptoms_get_tested_compliance?: number | null; - symptoms_get_tested_compliance_trend?: ("up" | "down" | "equal") | null; + symptoms_get_tested_compliance_trend?: ('up' | 'down' | 'equal') | null; wear_mask_public_indoors_compliance?: number | null; - wear_mask_public_indoors_compliance_trend: ("up" | "down" | "equal") | null; + wear_mask_public_indoors_compliance_trend: ('up' | 'down' | 'equal') | null; wear_mask_public_transport_compliance?: number | null; - wear_mask_public_transport_compliance_trend?: ("up" | "down" | "equal") | null; + wear_mask_public_transport_compliance_trend?: ('up' | 'down' | 'equal') | null; sneeze_cough_elbow_compliance?: number | null; - sneeze_cough_elbow_compliance_trend: ("up" | "down" | "equal") | null; + sneeze_cough_elbow_compliance_trend: ('up' | 'down' | 'equal') | null; max_visitors_compliance?: number | null; - max_visitors_compliance_trend: ("up" | "down" | "equal") | null; + max_visitors_compliance_trend: ('up' | 'down' | 'equal') | null; ventilate_home_compliance?: number | null; - ventilate_home_compliance_trend: ("up" | "down" | "equal") | null; + ventilate_home_compliance_trend: ('up' | 'down' | 'equal') | null; selftest_visit_compliance?: number | null; - selftest_visit_compliance_trend: ("up" | "down" | "equal") | null; + selftest_visit_compliance_trend: ('up' | 'down' | 'equal') | null; posttest_isolation_compliance?: number | null; - posttest_isolation_compliance_trend: ("up" | "down" | "equal") | null; + posttest_isolation_compliance_trend: ('up' | 'down' | 'equal') | null; curfew_support?: number | null; - curfew_support_trend: ("up" | "down" | "equal") | null; + curfew_support_trend: ('up' | 'down' | 'equal') | null; wash_hands_support?: number | null; - wash_hands_support_trend: ("up" | "down" | "equal") | null; + wash_hands_support_trend: ('up' | 'down' | 'equal') | null; keep_distance_support?: number | null; - keep_distance_support_trend: ("up" | "down" | "equal") | null; + keep_distance_support_trend: ('up' | 'down' | 'equal') | null; work_from_home_support?: number | null; - work_from_home_support_trend: ("up" | "down" | "equal") | null; + work_from_home_support_trend: ('up' | 'down' | 'equal') | null; avoid_crowds_support?: number | null; - avoid_crowds_support_trend: ("up" | "down" | "equal") | null; + avoid_crowds_support_trend: ('up' | 'down' | 'equal') | null; symptoms_stay_home_if_mandatory_support?: number | null; - symptoms_stay_home_if_mandatory_support_trend?: ("up" | "down" | "equal") | null; + symptoms_stay_home_if_mandatory_support_trend?: ('up' | 'down' | 'equal') | null; symptoms_get_tested_support?: number | null; - symptoms_get_tested_support_trend?: ("up" | "down" | "equal") | null; + symptoms_get_tested_support_trend?: ('up' | 'down' | 'equal') | null; wear_mask_public_indoors_support?: number | null; - wear_mask_public_indoors_support_trend: ("up" | "down" | "equal") | null; + wear_mask_public_indoors_support_trend: ('up' | 'down' | 'equal') | null; wear_mask_public_transport_support?: number | null; - wear_mask_public_transport_support_trend?: ("up" | "down" | "equal") | null; + wear_mask_public_transport_support_trend?: ('up' | 'down' | 'equal') | null; sneeze_cough_elbow_support?: number | null; - sneeze_cough_elbow_support_trend: ("up" | "down" | "equal") | null; + sneeze_cough_elbow_support_trend: ('up' | 'down' | 'equal') | null; max_visitors_support?: number | null; - max_visitors_support_trend: ("up" | "down" | "equal") | null; + max_visitors_support_trend: ('up' | 'down' | 'equal') | null; ventilate_home_support?: number | null; - ventilate_home_support_trend: ("up" | "down" | "equal") | null; + ventilate_home_support_trend: ('up' | 'down' | 'equal') | null; selftest_visit_support?: number | null; - selftest_visit_support_trend: ("up" | "down" | "equal") | null; + selftest_visit_support_trend: ('up' | 'down' | 'equal') | null; posttest_isolation_support?: number | null; - posttest_isolation_support_trend: ("up" | "down" | "equal") | null; + posttest_isolation_support_trend: ('up' | 'down' | 'equal') | null; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; @@ -678,11 +684,11 @@ export interface NlBehaviorPerAgeGroup { date_end_unix: number; } export interface NlBehaviorPerAgeGroupValue { - "16_24": number | null; - "25_39": number | null; - "40_54": number | null; - "55_69": number | null; - "70_plus": number | null; + '16_24': number | null; + '25_39': number | null; + '40_54': number | null; + '55_69': number | null; + '70_plus': number | null; } export interface NlBehaviorGetTestedSupportPerAgeGroup { values: NlBehaviorGetTestedSupportPerAgeGroupValue[]; @@ -704,20 +710,20 @@ export interface NlBehaviorAnnotations { } export interface NlBehaviorAnnotations1 { behavior_indicator: - | "wash_hands" - | "curfew" - | "keep_distance" - | "work_from_home" - | "avoid_crowds" - | "symptoms_stay_home_if_mandatory" - | "symptoms_get_tested" - | "wear_mask_public_indoors" - | "wear_mask_public_transport" - | "sneeze_cough_elbow" - | "max_visitors" - | "ventilate_home" - | "selftest_visit" - | "posttest_isolation"; + | 'wash_hands' + | 'curfew' + | 'keep_distance' + | 'work_from_home' + | 'avoid_crowds' + | 'symptoms_stay_home_if_mandatory' + | 'symptoms_get_tested' + | 'wear_mask_public_indoors' + | 'wear_mask_public_transport' + | 'sneeze_cough_elbow' + | 'max_visitors' + | 'ventilate_home' + | 'selftest_visit' + | 'posttest_isolation'; message_title_nl: string; message_title_en: string; message_desc_nl: string; @@ -979,15 +985,13 @@ export interface NlVaccineCoveragePerAgeGroup { values: NlVaccineCoveragePerAgeGroupValue[]; } export interface NlVaccineCoveragePerAgeGroupValue { - age_group_range: "5-11" | "12-17" | "18-29" | "30-39" | "40-49" | "50-59" | "60-69" | "70-79" | "80+"; + age_group_range: '5-11' | '12-17' | '18-29' | '30-39' | '40-49' | '50-59' | '60-69' | '70-79' | '80+'; age_group_percentage: number; age_group_total: number; autumn_2022_vaccinated: number | null; fully_vaccinated: number; - booster_shot: number | null; autumn_2022_vaccinated_percentage: number | null; fully_vaccinated_percentage: number; - booster_shot_percentage: number | null; date_unix: number; date_of_insertion_unix: number; date_of_report_unix: number; @@ -997,7 +1001,7 @@ export interface NlVaccineCoveragePerAgeGroupArchived { values: NlVaccineCoveragePerAgeGroupArchivedValue[]; } export interface NlVaccineCoveragePerAgeGroupArchivedValue { - age_group_range: "5-11" | "12-17" | "18-30" | "31-40" | "41-50" | "51-60" | "61-70" | "71-80" | "81+"; + age_group_range: '5-11' | '12-17' | '18-30' | '31-40' | '41-50' | '51-60' | '61-70' | '71-80' | '81+'; age_group_percentage: number; age_group_total: number; fully_vaccinated: number; @@ -1013,7 +1017,7 @@ export interface NlVaccineCoveragePerAgeGroupArchived_20220908 { values: NlVaccineCoveragePerAgeGroupArchived_20220908Value[]; } export interface NlVaccineCoveragePerAgeGroupArchived_20220908Value { - age_group_range: "5-11" | "12-17" | "18-29" | "30-39" | "40-49" | "50-59" | "60-69" | "70-79" | "80+"; + age_group_range: '5-11' | '12-17' | '18-29' | '30-39' | '40-49' | '50-59' | '60-69' | '70-79' | '80+'; age_group_percentage: number; age_group_total: number; fully_vaccinated: number; @@ -1092,29 +1096,29 @@ export interface NlVariants { } export interface NlVariantsVariant { variant_code: - | "B_1_1_529" - | "BA_1" - | "BA_2" - | "BA_4" - | "BA_4_6" - | "BA_5" - | "BA_2+S:L452X" - | "BA_2_12_1" - | "BA_3" - | "B_1_617_2" - | "B_1_351" - | "P_1" - | "B_1_1_7" - | "B_1_621" - | "C_37" - | "BA_2_75" - | "BA_2_75_2" - | "BF_7" - | "BQ_1" - | "BQ_1_1" - | "XBB" - | "other_table" - | "other_graph"; + | 'B_1_1_529' + | 'BA_1' + | 'BA_2' + | 'BA_4' + | 'BA_4_6' + | 'BA_5' + | 'BA_2+S:L452X' + | 'BA_2_12_1' + | 'BA_3' + | 'B_1_617_2' + | 'B_1_351' + | 'P_1' + | 'B_1_1_7' + | 'B_1_621' + | 'C_37' + | 'BA_2_75' + | 'BA_2_75_2' + | 'BF_7' + | 'BQ_1' + | 'BQ_1_1' + | 'XBB' + | 'other_table' + | 'other_graph'; values: NlVariantsVariantValue[]; last_value: NlVariantsVariantValue; } @@ -1132,136 +1136,136 @@ export interface NlVariantsVariantValue { } export type TopicalIcon = - | "AfstandSporten" - | "AlcoholVerkoop" - | "Archive" - | "Arrow" - | "Arts" - | "Avondklok" - | "BarChart" - | "BasisregelsAfstand" - | "BasisregelsDrukte" - | "BasisregelsElleboog" - | "BasisregelsGeenBezoek" - | "BasisregelsHandenwassen" - | "BasisregelsMondkapje" - | "BasisregelsTesten" - | "Bevolking" - | "Bezoek" - | "Bibliotheek" - | "BinnenMetZitplaats" - | "BinnenZonderZitplaats" - | "Binnensporten" - | "Binnensportlocaties" - | "Boosterprik" - | "Calendar" - | "Check" - | "Checked" - | "ChevronDown" - | "ChevronRight" - | "Clock" - | "Close" - | "CloseThick" - | "ContactBeroepen" - | "Coronathermometer" - | "Coronavirus" - | "Cross" - | "Database" - | "DoorstroomEvenementen" - | "Dot" - | "Down" - | "Download" - | "EenPersoonDoorgestreept" - | "Elderly" - | "Expand" - | "Experimenteel" - | "External" - | "Eye" - | "FrisseLucht" - | "GedeeltelijkOpenRugzak" - | "GeenEntertainment" - | "GeenMaxAantalBezoekers" - | "GeenWedstrijden" - | "Gehandicaptenzorg" - | "GeorganiseerdeKunstEnCultuurbeoefening" - | "GgdTesten" - | "Groepen" - | "HealthCare" - | "HomeAndVisits" - | "HorecaEnEvenementenBestellen" - | "HorecaEnEvenementenEtendrinken" - | "HorecaEnEvenementenEvenementen" - | "HorecaEvenementen" - | "Hospitality" - | "Information" - | "IntensiveCareOpnames" - | "Klachten" - | "Klok210001" - | "KunstCultuur" - | "KunstcultuurMusea" - | "Line" - | "Locaties" - | "Location" - | "Lopend" - | "Maatregelen" - | "MaxAantalBezoekers" - | "MaxVisitors" - | "MedischeScreening" - | "MeerInformatie" - | "MeerdaagseEvenementen" - | "Menu" - | "Mondkapje" - | "Nederland" - | "Notification" - | "OnderwijsEnKinderopvangNoodopvang" - | "OnderwijsEnKinderopvangOpAfstand" - | "OntmoetingenBezoek" - | "OpenbaarVervoer" - | "Openingstijden" - | "Other" - | "Overige" - | "Phone" - | "Recreatie" - | "Reizen" - | "ReproductieGraf" - | "Reproductiegetal" - | "Rioolvirus" - | "SearchIcon" - | "SearchIconBold" - | "SportBuiten" - | "SportMetZweetband" - | "SportWedstrijden" - | "Stap1HorecaMax" - | "Stap1HorecaPertafel" - | "Stap1HorecaVerplaatsen" - | "Stap1OnderwijsBibliotheek" - | "Stap1OnderwijsOpen" - | "Stap1Theorie" - | "Stap1Thuisbezoek" - | "Stap1Uitvaarten" - | "Stap1WinkelsAlleen" - | "Stap1WinkelsMarkten" - | "Stap1WinkelsOpen" - | "Stopwatch" - | "Taxi" - | "Testbewijs" - | "Toegangsbewijzen" - | "Travel" - | "Unchecked" - | "Up" - | "Vaccinaties" - | "Varianten" - | "Verpleeghuis" - | "VervoerEnReizenBuitenland" - | "VervoerEnReizenOv" - | "Vliegen" - | "Warn" - | "Warning" - | "WinkelenEnBoodschappenAlcohol" - | "WinkelenEnBoodschappenOpen" - | "Work" - | "Ziekenhuis" - | "Ziektegolf"; + | 'AfstandSporten' + | 'AlcoholVerkoop' + | 'Archive' + | 'Arrow' + | 'Arts' + | 'Avondklok' + | 'BarChart' + | 'BasisregelsAfstand' + | 'BasisregelsDrukte' + | 'BasisregelsElleboog' + | 'BasisregelsGeenBezoek' + | 'BasisregelsHandenwassen' + | 'BasisregelsMondkapje' + | 'BasisregelsTesten' + | 'Bevolking' + | 'Bezoek' + | 'Bibliotheek' + | 'BinnenMetZitplaats' + | 'BinnenZonderZitplaats' + | 'Binnensporten' + | 'Binnensportlocaties' + | 'Boosterprik' + | 'Calendar' + | 'Check' + | 'Checked' + | 'ChevronDown' + | 'ChevronRight' + | 'Clock' + | 'Close' + | 'CloseThick' + | 'ContactBeroepen' + | 'Coronathermometer' + | 'Coronavirus' + | 'Cross' + | 'Database' + | 'DoorstroomEvenementen' + | 'Dot' + | 'Down' + | 'Download' + | 'EenPersoonDoorgestreept' + | 'Elderly' + | 'Expand' + | 'Experimenteel' + | 'External' + | 'Eye' + | 'FrisseLucht' + | 'GedeeltelijkOpenRugzak' + | 'GeenEntertainment' + | 'GeenMaxAantalBezoekers' + | 'GeenWedstrijden' + | 'Gehandicaptenzorg' + | 'GeorganiseerdeKunstEnCultuurbeoefening' + | 'GgdTesten' + | 'Groepen' + | 'HealthCare' + | 'HomeAndVisits' + | 'HorecaEnEvenementenBestellen' + | 'HorecaEnEvenementenEtendrinken' + | 'HorecaEnEvenementenEvenementen' + | 'HorecaEvenementen' + | 'Hospitality' + | 'Information' + | 'IntensiveCareOpnames' + | 'Klachten' + | 'Klok210001' + | 'KunstCultuur' + | 'KunstcultuurMusea' + | 'Line' + | 'Locaties' + | 'Location' + | 'Lopend' + | 'Maatregelen' + | 'MaxAantalBezoekers' + | 'MaxVisitors' + | 'MedischeScreening' + | 'MeerInformatie' + | 'MeerdaagseEvenementen' + | 'Menu' + | 'Mondkapje' + | 'Nederland' + | 'Notification' + | 'OnderwijsEnKinderopvangNoodopvang' + | 'OnderwijsEnKinderopvangOpAfstand' + | 'OntmoetingenBezoek' + | 'OpenbaarVervoer' + | 'Openingstijden' + | 'Other' + | 'Overige' + | 'Phone' + | 'Recreatie' + | 'Reizen' + | 'ReproductieGraf' + | 'Reproductiegetal' + | 'Rioolvirus' + | 'SearchIcon' + | 'SearchIconBold' + | 'SportBuiten' + | 'SportMetZweetband' + | 'SportWedstrijden' + | 'Stap1HorecaMax' + | 'Stap1HorecaPertafel' + | 'Stap1HorecaVerplaatsen' + | 'Stap1OnderwijsBibliotheek' + | 'Stap1OnderwijsOpen' + | 'Stap1Theorie' + | 'Stap1Thuisbezoek' + | 'Stap1Uitvaarten' + | 'Stap1WinkelsAlleen' + | 'Stap1WinkelsMarkten' + | 'Stap1WinkelsOpen' + | 'Stopwatch' + | 'Taxi' + | 'Testbewijs' + | 'Toegangsbewijzen' + | 'Travel' + | 'Unchecked' + | 'Up' + | 'Vaccinaties' + | 'Varianten' + | 'Verpleeghuis' + | 'VervoerEnReizenBuitenland' + | 'VervoerEnReizenOv' + | 'Vliegen' + | 'Warn' + | 'Warning' + | 'WinkelenEnBoodschappenAlcohol' + | 'WinkelenEnBoodschappenOpen' + | 'Work' + | 'Ziekenhuis' + | 'Ziektegolf'; export interface Topical { version: string; @@ -1298,8 +1302,8 @@ export interface TopicalThemeTile { title: MultilanguageString; dynamicDescription: MultilanguageString; trendIcon: { - direction: "UP" | "DOWN"; - color: "GREEN" | "RED"; + direction: 'UP' | 'DOWN'; + color: 'GREEN' | 'RED'; } | null; tileIcon: TopicalIcon; cta: { @@ -1352,7 +1356,7 @@ export interface Vr { vaccine_coverage_per_age_group: VrVaccineCoveragePerAgeGroup; vaccine_coverage_per_age_group_archived: VrVaccineCoveragePerAgeGroupArchived; vaccine_coverage_per_age_group_archived_20220908: VrVaccineCoveragePerAgeGroupArchived_20220908; - booster_coverage: VrBoosterCoverage; + booster_coverage_archived_20220904: VrBoosterCoverageArchived_20220904; } export interface VrStaticValues { population_count: number; @@ -1401,6 +1405,7 @@ export interface VrSewerValue { date_unix: number; average: number | null; date_of_insertion_unix: number; + data_is_outdated: boolean; } export interface VrSewerPerInstallation { values: VrSewerPerInstallationInstallation[]; @@ -1505,45 +1510,45 @@ export interface VrBehaviorArchived_20221019 { export interface VrBehaviorArchived_20221019Value { number_of_participants: number; curfew_compliance?: number | null; - curfew_compliance_trend: ("up" | "down" | "equal") | null; + curfew_compliance_trend: ('up' | 'down' | 'equal') | null; wash_hands_compliance?: number | null; - wash_hands_compliance_trend: ("up" | "down" | "equal") | null; + wash_hands_compliance_trend: ('up' | 'down' | 'equal') | null; keep_distance_compliance?: number | null; - keep_distance_compliance_trend: ("up" | "down" | "equal") | null; + keep_distance_compliance_trend: ('up' | 'down' | 'equal') | null; work_from_home_compliance?: number | null; - work_from_home_compliance_trend: ("up" | "down" | "equal") | null; + work_from_home_compliance_trend: ('up' | 'down' | 'equal') | null; avoid_crowds_compliance?: number | null; - avoid_crowds_compliance_trend: ("up" | "down" | "equal") | null; + avoid_crowds_compliance_trend: ('up' | 'down' | 'equal') | null; wear_mask_public_indoors_compliance?: number | null; - wear_mask_public_indoors_compliance_trend: ("up" | "down" | "equal") | null; + wear_mask_public_indoors_compliance_trend: ('up' | 'down' | 'equal') | null; sneeze_cough_elbow_compliance?: number | null; - sneeze_cough_elbow_compliance_trend: ("up" | "down" | "equal") | null; + sneeze_cough_elbow_compliance_trend: ('up' | 'down' | 'equal') | null; max_visitors_compliance?: number | null; - max_visitors_compliance_trend: ("up" | "down" | "equal") | null; + max_visitors_compliance_trend: ('up' | 'down' | 'equal') | null; ventilate_home_compliance?: number | null; - ventilate_home_compliance_trend: ("up" | "down" | "equal") | null; + ventilate_home_compliance_trend: ('up' | 'down' | 'equal') | null; selftest_visit_compliance?: number | null; - selftest_visit_compliance_trend: ("up" | "down" | "equal") | null; + selftest_visit_compliance_trend: ('up' | 'down' | 'equal') | null; curfew_support?: number | null; - curfew_support_trend: ("up" | "down" | "equal") | null; + curfew_support_trend: ('up' | 'down' | 'equal') | null; wash_hands_support?: number | null; - wash_hands_support_trend: ("up" | "down" | "equal") | null; + wash_hands_support_trend: ('up' | 'down' | 'equal') | null; keep_distance_support?: number | null; - keep_distance_support_trend: ("up" | "down" | "equal") | null; + keep_distance_support_trend: ('up' | 'down' | 'equal') | null; work_from_home_support?: number | null; - work_from_home_support_trend: ("up" | "down" | "equal") | null; + work_from_home_support_trend: ('up' | 'down' | 'equal') | null; avoid_crowds_support?: number | null; - avoid_crowds_support_trend: ("up" | "down" | "equal") | null; + avoid_crowds_support_trend: ('up' | 'down' | 'equal') | null; wear_mask_public_indoors_support?: number | null; - wear_mask_public_indoors_support_trend: ("up" | "down" | "equal") | null; + wear_mask_public_indoors_support_trend: ('up' | 'down' | 'equal') | null; sneeze_cough_elbow_support?: number | null; - sneeze_cough_elbow_support_trend: ("up" | "down" | "equal") | null; + sneeze_cough_elbow_support_trend: ('up' | 'down' | 'equal') | null; max_visitors_support?: number | null; - max_visitors_support_trend: ("up" | "down" | "equal") | null; + max_visitors_support_trend: ('up' | 'down' | 'equal') | null; ventilate_home_support?: number | null; - ventilate_home_support_trend: ("up" | "down" | "equal") | null; + ventilate_home_support_trend: ('up' | 'down' | 'equal') | null; selftest_visit_support?: number | null; - selftest_visit_support_trend: ("up" | "down" | "equal") | null; + selftest_visit_support_trend: ('up' | 'down' | 'equal') | null; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; @@ -1634,14 +1639,16 @@ export interface VrVaccineCoveragePerAgeGroup { values: VrVaccineCoveragePerAgeGroupValue[]; } export interface VrVaccineCoveragePerAgeGroupValue { - age_group_range: "12+" | "18+" | "60+"; - autumn_2022_vaccinated_percentage: number | null; - fully_vaccinated_percentage: number | null; - booster_shot_percentage: number | null; - birthyear_range: string; - autumn_2022_vaccinated_percentage_label: string | null; - fully_vaccinated_percentage_label: string | null; - booster_shot_percentage_label: string | null; + vaccination_type: string; + birthyear_range_12_plus: string; + birthyear_range_18_plus: string; + birthyear_range_60_plus: string | null; + vaccinated_percentage_12_plus: number | null; + vaccinated_percentage_12_plus_label: string | null; + vaccinated_percentage_18_plus: number | null; + vaccinated_percentage_18_plus_label: string | null; + vaccinated_percentage_60_plus: number | null; + vaccinated_percentage_60_plus_label: string | null; date_unix: number; date_of_insertion_unix: number; } @@ -1649,7 +1656,7 @@ export interface VrVaccineCoveragePerAgeGroupArchived { values: VrVaccineCoveragePerAgeGroupArchivedValue[]; } export interface VrVaccineCoveragePerAgeGroupArchivedValue { - age_group_range: "12+" | "18+"; + age_group_range: '12+' | '18+'; fully_vaccinated_percentage: number | null; has_one_shot_percentage: number | null; birthyear_range: string; @@ -1662,7 +1669,7 @@ export interface VrVaccineCoveragePerAgeGroupArchived_20220908 { values: VrVaccineCoveragePerAgeGroupArchived_20220908Value[]; } export interface VrVaccineCoveragePerAgeGroupArchived_20220908Value { - age_group_range: "12+" | "18+"; + age_group_range: '12+' | '18+'; fully_vaccinated_percentage: number | null; booster_shot_percentage: number | null; has_one_shot_percentage: number | null; @@ -1673,18 +1680,18 @@ export interface VrVaccineCoveragePerAgeGroupArchived_20220908Value { date_unix: number; date_of_insertion_unix: number; } -export interface VrBoosterCoverage { - values: VrBoosterCoverageValue[]; +export interface VrBoosterCoverageArchived_20220904 { + values: VrBoosterCoverageArchived_20220904Value[]; } -export interface VrBoosterCoverageValue { - age_group?: "12+" | "18+"; +export interface VrBoosterCoverageArchived_20220904Value { + age_group?: '12+' | '18+'; percentage: number; percentage_label: string | null; date_unix: number; date_of_insertion_unix: number; } -export type VrCollectionId = "VR_COLLECTION"; +export type VrCollectionId = 'VR_COLLECTION'; export interface VrCollection { last_generated: string; @@ -1732,46 +1739,47 @@ export interface VrCollectionSewer { vrcode: string; average: number | null; date_of_insertion_unix: number; + data_is_outdated: boolean; } export interface VrCollectionBehaviorArchived_20221019 { vrcode: string; number_of_participants: number; curfew_compliance?: number | null; - curfew_compliance_trend: ("up" | "down" | "equal") | null; + curfew_compliance_trend: ('up' | 'down' | 'equal') | null; wash_hands_compliance?: number | null; - wash_hands_compliance_trend: ("up" | "down" | "equal") | null; + wash_hands_compliance_trend: ('up' | 'down' | 'equal') | null; keep_distance_compliance?: number | null; - keep_distance_compliance_trend: ("up" | "down" | "equal") | null; + keep_distance_compliance_trend: ('up' | 'down' | 'equal') | null; work_from_home_compliance?: number | null; - work_from_home_compliance_trend: ("up" | "down" | "equal") | null; + work_from_home_compliance_trend: ('up' | 'down' | 'equal') | null; avoid_crowds_compliance?: number | null; - avoid_crowds_compliance_trend: ("up" | "down" | "equal") | null; + avoid_crowds_compliance_trend: ('up' | 'down' | 'equal') | null; wear_mask_public_indoors_compliance?: number | null; - wear_mask_public_indoors_compliance_trend: ("up" | "down" | "equal") | null; + wear_mask_public_indoors_compliance_trend: ('up' | 'down' | 'equal') | null; sneeze_cough_elbow_compliance?: number | null; - sneeze_cough_elbow_compliance_trend: ("up" | "down" | "equal") | null; + sneeze_cough_elbow_compliance_trend: ('up' | 'down' | 'equal') | null; max_visitors_compliance?: number | null; - max_visitors_compliance_trend: ("up" | "down" | "equal") | null; + max_visitors_compliance_trend: ('up' | 'down' | 'equal') | null; ventilate_home_compliance?: number | null; - ventilate_home_compliance_trend: ("up" | "down" | "equal") | null; + ventilate_home_compliance_trend: ('up' | 'down' | 'equal') | null; curfew_support?: number | null; - curfew_support_trend: ("up" | "down" | "equal") | null; + curfew_support_trend: ('up' | 'down' | 'equal') | null; wash_hands_support?: number | null; - wash_hands_support_trend: ("up" | "down" | "equal") | null; + wash_hands_support_trend: ('up' | 'down' | 'equal') | null; keep_distance_support?: number | null; - keep_distance_support_trend: ("up" | "down" | "equal") | null; + keep_distance_support_trend: ('up' | 'down' | 'equal') | null; work_from_home_support?: number | null; - work_from_home_support_trend: ("up" | "down" | "equal") | null; + work_from_home_support_trend: ('up' | 'down' | 'equal') | null; avoid_crowds_support?: number | null; - avoid_crowds_support_trend: ("up" | "down" | "equal") | null; + avoid_crowds_support_trend: ('up' | 'down' | 'equal') | null; wear_mask_public_indoors_support?: number | null; - wear_mask_public_indoors_support_trend: ("up" | "down" | "equal") | null; + wear_mask_public_indoors_support_trend: ('up' | 'down' | 'equal') | null; sneeze_cough_elbow_support?: number | null; - sneeze_cough_elbow_support_trend: ("up" | "down" | "equal") | null; + sneeze_cough_elbow_support_trend: ('up' | 'down' | 'equal') | null; max_visitors_support?: number | null; - max_visitors_support_trend: ("up" | "down" | "equal") | null; + max_visitors_support_trend: ('up' | 'down' | 'equal') | null; ventilate_home_support?: number | null; - ventilate_home_support_trend: ("up" | "down" | "equal") | null; + ventilate_home_support_trend: ('up' | 'down' | 'equal') | null; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; @@ -1811,14 +1819,16 @@ export interface VrCollectionSituations { } export interface VrCollectionVaccineCoveragePerAgeGroup { vrcode: string; - age_group_range: "12+" | "18+" | "60+"; - autumn_2022_vaccinated_percentage: number | null; - fully_vaccinated_percentage: number | null; - booster_shot_percentage: number | null; - birthyear_range: string; - autumn_2022_vaccinated_percentage_label: string | null; - fully_vaccinated_percentage_label: string | null; - booster_shot_percentage_label: string | null; + vaccination_type: string; + birthyear_range_12_plus: string; + birthyear_range_18_plus: string; + birthyear_range_60_plus: string | null; + vaccinated_percentage_12_plus: number | null; + vaccinated_percentage_12_plus_label: string | null; + vaccinated_percentage_18_plus: number | null; + vaccinated_percentage_18_plus_label: string | null; + vaccinated_percentage_60_plus: number | null; + vaccinated_percentage_60_plus_label: string | null; date_unix: number; date_of_insertion_unix: number; }