Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

COR-1128 Restructure collection schemas #4506

Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6038a67
feat(booster): remove and remame booster data from existing schemas (…
hasan-ozaynaci Nov 21, 2022
f19a5b2
Feature/COR-1170-rioolwaterpagina-verbetering-choropletenkaart-nl (#4…
APW26 Nov 22, 2022
22f05de
Merge branch 'feature/cor-1228-json-changes' of github.com:minvws/nl-…
hasan-ozaynaci Nov 23, 2022
399baba
feat: changed collection schemas
Oct 26, 2022
a31168e
feat: update schema's and space typo
Jorrik-Klijnsma-Work Nov 18, 2022
2c68bfa
feat: adjusted the choropleth to accept new structure
Jorrik-Klijnsma-Work Nov 21, 2022
e2b4a44
feat: update typing for vaccine coverage
Jorrik-Klijnsma-Work Nov 21, 2022
1aaac6a
feat: update coverage data with new structure
hasan-ozaynaci Nov 21, 2022
b4f33c1
feat: update vr and gm schemas
hasan-ozaynaci Nov 21, 2022
0f470f3
Update basisserie name added Gm and VR support for Choropleth and Cle…
Jorrik-Klijnsma-Work Nov 23, 2022
0cd8b2e
Fix threshold mismatch
Jorrik-Klijnsma-Work Nov 23, 2022
6322b1f
60 years can be null in schemas
Jorrik-Klijnsma-Work Nov 23, 2022
d4ee9e1
fix: remove redundant file with old data in it
hasan-ozaynaci Nov 23, 2022
9c69f73
fix: changes some magic numbers to indexed spaces
hasan-ozaynaci Nov 23, 2022
e39a829
feat: changed collection schemas
Oct 26, 2022
c5dd36d
feat: update schema's and space typo
Jorrik-Klijnsma-Work Nov 18, 2022
31ba5cb
feat: adjusted the choropleth to accept new structure
Jorrik-Klijnsma-Work Nov 21, 2022
486541f
feat: update typing for vaccine coverage
Jorrik-Klijnsma-Work Nov 21, 2022
7bdec11
feat: update coverage data with new structure
hasan-ozaynaci Nov 21, 2022
62a681b
feat: update vr and gm schemas
hasan-ozaynaci Nov 21, 2022
bdee7a0
Update basisserie name added Gm and VR support for Choropleth and Cle…
Jorrik-Klijnsma-Work Nov 23, 2022
488cb9f
Fix threshold mismatch
Jorrik-Klijnsma-Work Nov 23, 2022
dbfde98
60 years can be null in schemas
Jorrik-Klijnsma-Work Nov 23, 2022
ddd0286
Update the file to comply with Coding Standards
Jorrik-Klijnsma-Work Nov 23, 2022
1835d3c
replaced one to many
Jorrik-Klijnsma-Work Nov 23, 2022
b306360
Merge branch 'feature/COR-1128-restructure-collection-schemas' of git…
hasan-ozaynaci Nov 23, 2022
2718c64
Made AgeGroup types more failsafe and updated data types
Jorrik-Klijnsma-Work Nov 23, 2022
f8207cf
fix type issues
Jorrik-Klijnsma-Work Nov 23, 2022
23fb5b7
fix: remove redundant thresholds
hasan-ozaynaci Nov 23, 2022
0d43cda
fix: made some changes regarding code quality
hasan-ozaynaci Nov 23, 2022
89c0534
better filter naming
Jorrik-Klijnsma-Work Nov 23, 2022
1b89635
Added PR feedback by extruding coverage data out of JSX.
Jorrik-Klijnsma-Work Nov 24, 2022
7232ecb
Removed extra nested if
Jorrik-Klijnsma-Work Nov 24, 2022
8fa0f9e
Singel quotes
Jorrik-Klijnsma-Work Nov 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 32 additions & 21 deletions packages/app/schema/gm/vaccine_coverage_per_age_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,53 @@
"additionalProperties": false,
"type": "object",
"required": [
"age_group_range",
"autumn_2022_vaccinated_percentage",
"fully_vaccinated_percentage",
"autumn_2022_vaccinated_percentage_label",
"fully_vaccinated_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})$"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/app/schema/gm_collection/__index.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
},
"vaccine_coverage_per_age_group": {
"type": "array",
"minItems": 1032,
"maxItems": 1032,
"minItems": 688,
"maxItems": 688,
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
"items": {
"$ref": "vaccine_coverage_per_age_group.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +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",
"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"
],
Expand All @@ -19,25 +23,39 @@
"type": "string",
"pattern": "^GM[0-9]+$"
},
"age_group_range": {
"type": "string",
"enum": ["12+", "18+", "60+"]
},
"autumn_2022_vaccinated_percentage": {
"type": ["integer", "null"]
"vaccination_type": {
"type": "string"
},
"fully_vaccinated_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})$"
},
"vaccinated_percentage_18_plus": {
"type": ["number", "null"]
},
"vaccinated_percentage_18_plus_label": {
"type": ["string", "null"],
"pattern": "^([><][=][0-9]{1,2})$"
},
"fully_vaccinated_percentage_label": {
"vaccinated_percentage_60_plus": {
"type": ["number", "null"]
},
"vaccinated_percentage_60_plus_label": {
"type": ["string", "null"],
"pattern": "^([><][=][0-9]{1,2})$"
},
Expand Down
53 changes: 32 additions & 21 deletions packages/app/schema/vr/vaccine_coverage_per_age_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,53 @@
"additionalProperties": false,
"type": "object",
"required": [
"age_group_range",
"autumn_2022_vaccinated_percentage",
"fully_vaccinated_percentage",
"autumn_2022_vaccinated_percentage_label",
"fully_vaccinated_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})$"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/app/schema/vr_collection/__index.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
},
"vaccine_coverage_per_age_group": {
"type": "array",
"minItems": 75,
"maxItems": 75,
"minItems": 50,
"maxItems": 50,
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
"items": {
"$ref": "vaccine_coverage_per_age_group.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +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",
"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"
],
Expand All @@ -19,25 +23,39 @@
"type": "string",
"pattern": "^VR[0-9]+$"
},
"age_group_range": {
"type": "string",
"enum": ["12+", "18+", "60+"]
},
"autumn_2022_vaccinated_percentage": {
"type": ["integer", "null"]
"vaccination_type": {
"type": "string"
},
"fully_vaccinated_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})$"
},
"vaccinated_percentage_18_plus": {
"type": ["number", "null"]
},
"vaccinated_percentage_18_plus_label": {
"type": ["string", "null"],
"pattern": "^([><][=][0-9]{1,2})$"
},
"fully_vaccinated_percentage_label": {
"vaccinated_percentage_60_plus": {
"type": ["number", "null"]
},
"vaccinated_percentage_60_plus_label": {
"type": ["string", "null"],
"pattern": "^([><][=][0-9]{1,2})$"
},
Expand Down
40 changes: 16 additions & 24 deletions packages/app/src/components/choropleth/logic/thresholds.ts
Original file line number Diff line number Diff line change
@@ -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[] = [
{
Expand Down Expand Up @@ -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,
Expand All @@ -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[]
>),
Expand Down
Loading