Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit 6ccb0c9

Browse files
committed
Support upstream changes
Issue: #35
1 parent a104275 commit 6ccb0c9

File tree

1 file changed

+59
-137
lines changed

1 file changed

+59
-137
lines changed

process-xlsx.js

+59-137
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ const processRecords = (records) => {
8989

9090
// “Bund (Einsatzkräfte Bundeswehr, Bundespolizei)” is not a real
9191
// state, and lacks a total population count.
92-
const BUNDESWEHR = 'Impfzentren Bund';
92+
const BUNDESWEHR = 'Bundesressorts';
9393

9494
const readMainData = async () => {
9595
const records = await readXlsxFile(PATH_TO_SPREADSHEET, { sheet: 3 });
96-
const headerRow = records[3];
96+
const headerRow = records[2];
9797
for (let i = 0; i < headerRow.length; i++) {
9898
if (headerRow[i] === null) {
99-
// If D4 is empty, fall back to the contents of C3, B3, A3.
100-
headerRow[i] = records[2][i] || records[1][i] || records[0][i];
99+
// If C3 is empty, fall back to the contents of B3, A3.
100+
headerRow[i] = records[1][i] || records[0][i];
101101
}
102102
// Ensure every header cell’s content is unique. Remove spaces to
103103
// avoid having to deal with typos and typofixes.
@@ -110,97 +110,50 @@ const readMainData = async () => {
110110
type: String,
111111
},
112112

113-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → begonnene Impfserie → Impfungen kumulativ → Gesamt
113+
// mindestens einmal geimpft → Impfungen kumulativ → Gesamt
114114
'Gesamt_2': {
115-
prop: 'initialDosesCumulativeAtCentersHospitalsMobileTeams',
115+
prop: 'initialDosesCumulative',
116116
type: Number,
117117
},
118-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → begonnene Impfserie → Impfungen kumulativ → BioNTech
118+
// mindestens einmal geimpft → Impfungen kumulativ → BioNTech
119119
'BioNTech_3': {
120-
prop: 'initialDosesCumulativeBioNTechAtCentersHospitalsMobileTeams',
120+
prop: 'initialDosesCumulativeBioNTech',
121121
type: Number,
122122
},
123-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → begonnene Impfserie → Impfungen kumulativ → Moderna
123+
// mindestens einmal geimpft → Impfungen kumulativ → Moderna
124124
'Moderna_4': {
125-
prop: 'initialDosesCumulativeModernaAtCentersHospitalsMobileTeams',
125+
prop: 'initialDosesCumulativeModerna',
126126
type: Number,
127127
},
128-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → begonnene Impfserie → Impfungen kumulativ → AstraZeneca
128+
// mindestens einmal geimpft → Impfungen kumulativ → AstraZeneca
129129
'AstraZeneca_5': {
130-
prop: 'initialDosesCumulativeAstraZenecaAtCentersHospitalsMobileTeams',
131-
type: Number,
132-
},
133-
134-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → vollständig geimpft → Impfungen kumulativ → Gesamt
135-
'Gesamt_7': {
136-
prop: 'finalDosesCumulativeAtCentersHospitalsMobileTeams',
137-
type: Number,
138-
},
139-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → vollständig geimpft → Impfungen kumulativ → BioNTech
140-
'BioNTech_8': {
141-
prop: 'finalDosesCumulativeBioNTechAtCentersHospitalsMobileTeams',
142-
type: Number,
143-
},
144-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → vollständig geimpft → Impfungen kumulativ → Moderna
145-
'Moderna_9': {
146-
prop: 'finalDosesCumulativeModernaAtCentersHospitalsMobileTeams',
147-
type: Number,
148-
},
149-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → vollständig geimpft → Impfungen kumulativ → AstraZeneca
150-
'AstraZeneca_10': {
151-
prop: 'finalDosesCumulativeAstraZenecaAtCentersHospitalsMobileTeams',
152-
type: Number,
153-
},
154-
// Impfungen in Impfzentren, Mobilen Teams, Krankenhäusern → vollständig geimpft → Impfungen kumulativ → Janssen
155-
'Janssen_11': {
156-
prop: 'finalDosesCumulativeJohnsonAndJohnsonAtCentersHospitalsMobileTeams',
157-
type: Number,
158-
},
159-
160-
// Impfungen der niedergelassenen Ärzten → begonnene Impfserie → Impfungen kumulativ → Gesamt
161-
'Gesamt_13': {
162-
prop: 'initialDosesCumulativeAtDoctors',
163-
type: Number,
164-
},
165-
// Impfungen der niedergelassenen Ärzten → begonnene Impfserie → Impfungen kumulativ → BioNTech
166-
'BioNTech_14': {
167-
prop: 'initialDosesCumulativeBioNTechAtDoctors',
168-
type: Number,
169-
},
170-
// Impfungen der niedergelassenen Ärzten → begonnene Impfserie → Impfungen kumulativ → Moderna
171-
'Moderna_15': {
172-
prop: 'initialDosesCumulativeModernaAtDoctors',
173-
type: Number,
174-
},
175-
// Impfungen der niedergelassenen Ärzten → begonnene Impfserie → Impfungen kumulativ → AstraZeneca
176-
'AstraZeneca_16': {
177-
prop: 'initialDosesCumulativeAstraZenecaAtDoctors',
130+
prop: 'initialDosesCumulativeAstraZeneca',
178131
type: Number,
179132
},
180133

181-
// Impfungen der niedergelassenen Ärzten → vollständig geimpft → Impfungen kumulativ → Gesamt
182-
'Gesamt_18': {
183-
prop: 'finalDosesCumulativeAtDoctors',
134+
// vollständig geimpft → Impfungen kumulativ → Gesamt
135+
'Gesamt_8': {
136+
prop: 'finalDosesCumulative',
184137
type: Number,
185138
},
186-
// Impfungen der niedergelassenen Ärzten → vollständig geimpft → Impfungen kumulativ → BioNTech
187-
'BioNTech_19': {
188-
prop: 'finalDosesCumulativeBioNTechAtDoctors',
139+
// vollständig geimpft → Impfungen kumulativ → BioNTech
140+
'BioNTech_9': {
141+
prop: 'finalDosesCumulativeBioNTech',
189142
type: Number,
190143
},
191-
// Impfungen der niedergelassenen Ärzten → vollständig geimpft → Impfungen kumulativ → Moderna
192-
'Moderna_20': {
193-
prop: 'finalDosesCumulativeModernaAtDoctors',
144+
// vollständig geimpft → Impfungen kumulativ → Moderna
145+
'Moderna_10': {
146+
prop: 'finalDosesCumulativeModerna',
194147
type: Number,
195148
},
196-
// Impfungen der niedergelassenen Ärzten → vollständig geimpft → Impfungen kumulativ → AstraZeneca
197-
'AstraZeneca_21': {
198-
prop: 'finalDosesCumulativeAstraZenecaAtDoctors',
149+
// vollständig geimpft → Impfungen kumulativ → AstraZeneca
150+
'AstraZeneca_11': {
151+
prop: 'finalDosesCumulativeAstraZeneca',
199152
type: Number,
200153
},
201-
// Impfungen der niedergelassenen Ärzten → vollständig geimpft → Impfungen kumulativ → Janssen
202-
'Janssen_22': {
203-
prop: 'finalDosesCumulativeJohnsonAndJohnsonAtDoctors',
154+
// vollständig geimpft → Impfungen kumulativ → Janssen
155+
'Janssen**_12': {
156+
prop: 'finalDosesCumulativeJohnsonAndJohnson',
204157
type: Number,
205158
},
206159
};
@@ -211,11 +164,11 @@ const readMainData = async () => {
211164

212165
const readPercentData = async () => {
213166
const records = await readXlsxFile(PATH_TO_SPREADSHEET, { sheet: 2 });
214-
const headerRow = records[3];
167+
const headerRow = records[2];
215168
for (let i = 0; i < headerRow.length; i++) {
216169
if (headerRow[i] === null) {
217-
// If D3 is empty, fall back to the contents of C3, B3, A3.
218-
headerRow[i] = records[2][i] || records[1][i] || records[0][i];
170+
// If C3 is empty, fall back to the contents of B3, A3.
171+
headerRow[i] = records[1][i] || records[0][i];
219172
}
220173
// Ensure every header cell’s content is unique. Remove spaces to
221174
// avoid having to deal with typos and typofixes.
@@ -231,95 +184,64 @@ const readPercentData = async () => {
231184
type: String,
232185
},
233186

234-
// Insgesamt über alle Impfstellen → Gesamtzahl bisher verabreichter Impfungen
187+
// Gesamtzahl bisher verabreichter Impfungen
235188
'GesamtzahlbisherverabreichterImpfungen_2': {
236189
prop: 'totalDosesCumulative',
237190
type: Number,
238191
},
239-
// Insgesamt über alle Impfstellen → Gesamtzahl begonnener Impfserien
240-
'GesamtzahlbegonnenerImpfserien**_3': {
241-
prop: 'initialDosesCumulative',
192+
// Gesamtzahl mindestens einmal geimpft
193+
'Gesamtzahlmindestenseinmalgeimpft_3': {
194+
prop: 'atLeastPartiallyVaccinatedCumulative',
242195
type: Number,
243196
},
244-
// Insgesamt über alle Impfstellen → Gesamtzahl vollständig geimpft
245-
'Gesamtzahlvollständiggeimpft**_4': {
197+
// Gesamtzahl vollständig geimpft
198+
'Gesamtzahlvollständiggeimpft_4': {
246199
prop: 'finalDosesCumulative',
247200
type: Number,
248201
},
249202

250-
// Insgesamt über alle Impfstellen → Impfquote mit begonnener Impfserie → Gesamt
203+
// Impfquote mindestens einmal geimpft → Gesamt
251204
'Gesamt_5': {
252-
prop: 'initialDosesPercent',
253-
type: Number,
254-
},
255-
// Insgesamt über alle Impfstellen → Impfquote mit begonnener Impfserie → <60 Jahre
256-
'<60Jahre_6': {
257-
prop: 'initialDosesPercentOfPeopleBelow60',
258-
type: Number,
259-
},
260-
// Insgesamt über alle Impfstellen → Impfquote mit begonnener Impfserie → 60+ Jahre
261-
'60+Jahre_7': {
262-
prop: 'initialDosesPercentOfPeopleAbove60',
205+
prop: 'atLeastPartiallyVaccinatedPercent',
263206
type: Number,
264207
},
265-
266-
// Insgesamt über alle Impfstellen → Impfquote vollständig geimpft → Gesamt
267-
'Gesamt_8': {
268-
prop: 'finalDosesPercent',
208+
// Impfquote mindestens einmal geimpft → <18 Jahre
209+
'<18Jahre_6': {
210+
prop: 'atLeastPartiallyVaccinatedPercentOfPeopleAged0To17',
269211
type: Number,
270212
},
271-
// Insgesamt über alle Impfstellen → Impfquote vollständig geimpft → <60 Jahre
272-
'<60Jahre_9': {
273-
prop: 'finalDosesPercentOfPeopleBelow60',
213+
// Impfquote mindestens einmal geimpft → 18-59 Jahre
214+
'18-59Jahre_7': {
215+
prop: 'atLeastPartiallyVaccinatedPercentOfPeopleAged18To59',
274216
type: Number,
275217
},
276-
// Insgesamt über alle Impfstellen → Impfquote vollständig geimpft → 60+ Jahre
277-
'60+Jahre_10': {
278-
prop: 'finalDosesPercentOfPeopleAbove60',
218+
// Impfquote mindestens einmal geimpft → 60+ Jahre
219+
'60+Jahre_8': {
220+
prop: 'atLeastPartiallyVaccinatedPercentOfPeopleAged60AndUp',
279221
type: Number,
280222
},
281223

282-
// Impfungen in Impfzentren, Mobilen Teams und Krankenhäusern → begonnene Impfserie → <60 Jahre
283-
'<60Jahre_11': {
284-
prop: 'initialDosesCumulativeAtCentersHospitalsMobileTeamsForPeopleBelow60',
224+
// Impfquote vollständig geimpft → Gesamt
225+
'Gesamt_9': {
226+
prop: 'fullyVaccinatedPercent',
285227
type: Number,
286228
},
287-
// Impfungen in Impfzentren, Mobilen Teams und Krankenhäusern → begonnene Impfserie → 60+ Jahre
288-
'60+Jahre_12': {
289-
prop: 'initialDosesCumulativeAtCentersHospitalsMobileTeamsForPeopleAbove60',
229+
// Impfquote vollständig geimpft → <18 Jahre
230+
'<18Jahre_10': {
231+
prop: 'fullyVaccinatedPercentOfPeopleAged0To17',
290232
type: Number,
291233
},
292-
// Impfungen in Impfzentren, Mobilen Teams und Krankenhäusern → vollständig geimpft → <60 Jahre
293-
'<60Jahre_13': {
294-
prop: 'finalDosesCumulativeAtCentersHospitalsMobileTeamsForPeopleBelow60',
234+
// Impfquote vollständig geimpft → 18-59 Jahre
235+
'18-59Jahre_11': {
236+
prop: 'fullyVaccinatedPercentOfPeopleAged18To59',
295237
type: Number,
296238
},
297-
// Impfungen in Impfzentren, Mobilen Teams und Krankenhäusern → vollständig geimpft → 60+ Jahre
298-
'60+Jahre_14': {
299-
prop: 'finalDosesCumulativeAtCentersHospitalsMobileTeamsForPeopleAbove60',
239+
// Impfquote vollständig geimpft → 60+ Jahre
240+
'60+Jahre_12': {
241+
prop: 'fullyVaccinatedPercentOfPeopleAged60AndUp',
300242
type: Number,
301243
},
302244

303-
// Impfungen der niedergelassenen Ärzteschaft → begonnene Impfserie → <60 Jahre
304-
'<60Jahre_15': {
305-
prop: 'initialDosesCumulativeAtDoctorsForPeopleBelow60',
306-
type: Number,
307-
},
308-
// Impfungen der niedergelassenen Ärzteschaft → begonnene Impfserie → 60+ Jahre
309-
'60+Jahre_16': {
310-
prop: 'initialDosesCumulativeAtDoctorsForPeopleAbove60',
311-
type: Number,
312-
},
313-
// Impfungen der niedergelassenen Ärzteschaft → vollständig geimpft → <60 Jahre
314-
'<60Jahre_17': {
315-
prop: 'finalDosesCumulativeAtDoctorsForPeopleBelow60',
316-
type: Number,
317-
},
318-
// Impfungen der niedergelassenen Ärzteschaft → vollständig geimpft → 60+ Jahre
319-
'60+Jahre_18': {
320-
prop: 'finalDosesCumulativeAtDoctorsForPeopleAbove60',
321-
type: Number,
322-
},
323245
};
324246
const actualRecords = convertToObject(recordsWithData, schema);
325247
const data = processRecords(actualRecords);

0 commit comments

Comments
 (0)