marlon360 / rki-covid-api

🦠🇩🇪📈 An API for the spread of covid-19 in Germany. Data from Robert-Koch-Institut.
https://api.corona-zahlen.org/
Creative Commons Attribution 4.0 International
250 stars 49 forks source link

Vaccinations not working #233

Closed marcusraitner closed 3 years ago

marcusraitner commented 3 years ago

Error returned: {"error":{"message":"An error occurred.","details":"Cannot read property 'state' of undefined","stack":"TypeError: Cannot read property 'state' of undefined\n at Object.<anonymous> (/usr/src/app/src/data-requests/vaccination.ts:253:15)\n at Generator.next (<anonymous>)\n at fulfilled (/usr/src/app/dist/data-requests/vaccination.js:5:58)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)"}}

marcusraitner commented 3 years ago

This was the call: https://api.corona-zahlen.org/vaccinations

Rubber1Duck commented 3 years ago

The RKI switched the structure of the xlsx file massivly :-( unfortnatly i have no time yet to patch this!

marcusraitner commented 3 years ago

This whole excel thing is so strange … why can't the RKI just provide an API … good luck for the update. Hope that's it's not too complicated.

laurenzfg commented 3 years ago

I was about to say that I am starting to work on a PR @Rubber1Duck , but then I saw you already pushed some code. I reviewed your first commit and I believe you got one aspect wrong. In the new data format they count a vaccination with J&J in both Differenz[en] zum Vortrag

See the comment in the Excel sheet:

Die Impfungen mit Janssen sind daher sowohl in der Gruppe "mindestens einmal geimpft" als auch in der Gruppe "vollständig geimpft" enthalten. Sie werden für die Gesamtzahl der verabreichten Impfungen jedoch nur einmal gezählt.

So for the delta of first vacs, you need to substract the J&J vacs from the delta in the Excel sheets. This way, the API stays consistent with previous versions with regards to J&J.

To further illustrate my issue: If you add both deltas from today, you get: 74,507 + 212,867 = 287,374, but impfdashboard.de reports 273,355. So you need to subtract the daily J&J vacs . But they are nowhere reported in the Excel sheet :angry: I don't really see how the get correct number of vaccinations today from that data.

Rubber1Duck commented 3 years ago

@laurenzfg puhhhh, you are right and on the other hand you are wrong! I think the intention of RKI to add the J&J vaccinations to first vaccination is the folloing: if you dont count J&J to first Vaccination you are not able to reach total residents value! and so you dont be able to reach 100%! (theoretical). In my opinion it is totaly right to count a J&J vaccination to first AND second vaccination to calculate the quote!

In the past this API is always publishing what the RKI published! This API make never any interpretations, that should be the "job" of the App Programmers! (i hope i understand @marlon360 right!)

Rubber1Duck commented 3 years ago

Patch is now tested and ready to review and merge....

Toni-99 commented 3 years ago

You can use my API with the same design pattern if you want. Pls only request via Postman because i didnt setup a ssl certificate yet ^^

http://bot.twagner.dev:8070/vaccinations

marcusraitner commented 3 years ago

@marlon360 When will this be deployed?

marlon360 commented 3 years ago

@marcusraitner Sorry for the delay, it is online now!

marcusraitner commented 3 years ago

@marcusraitner Sorry for the delay, it is online now!

And working! At least in my widget. Thanks a lot!

marlon360 commented 3 years ago

Thanks to @Rubber1Duck for his awesome work!

marcusraitner commented 3 years ago

Yes! Thanks a lot to @Rubber1Duck!!

ABrolund commented 3 years ago

I just saw https://api.corona-zahlen.org/vaccinations

Is working again ...

{"data":{"administeredVaccinations":55546616,"vaccinated":38245152,"vaccination":{"biontech":25553053,"moderna":3068627,"astraZeneca":8737750,"janssen":885722},"delta":240963,"quote":0.46,"secondVaccination":{"vaccinated":18187186,"vaccination":{"biontech":14980831,"moderna":1379787,"astraZeneca":940846,"janssen":885722},"delta":390552,"quote":0.21899999999999997},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}},"states":{"BW":{"name":"Baden-Württemberg","administeredVaccinations":7244128,"vaccinated":4997213,"vaccination":{"biontech":3333534,"moderna":433934,"astraZeneca":1121193,"janssen":108552},"delta":27979,"quote":0.45,"secondVaccination":{"vaccinated":2355467,"vaccination":{"biontech":1904538,"moderna":190896,"astraZeneca":151481,"janssen":108552},"delta":53005,"quote":0.212},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"BY":{"name":"Bayern","administeredVaccinations":8614374,"vaccinated":5847401,"vaccination":{"biontech":4057997,"moderna":401651,"astraZeneca":1279409,"janssen":108344},"delta":25348,"quote":0.446,"secondVaccination":{"vaccinated":2875317,"vaccination":{"biontech":2361991,"moderna":232757,"astraZeneca":172225,"janssen":108344},"delta":67533,"quote":0.21899999999999997},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"BE":{"name":"Berlin","administeredVaccinations":2423862,"vaccinated":1683539,"vaccination":{"biontech":1127540,"moderna":176502,"astraZeneca":344344,"janssen":35153},"delta":16143,"quote":0.45899999999999996,"secondVaccination":{"vaccinated":775476,"vaccination":{"biontech":645239,"moderna":67422,"astraZeneca":27662,"janssen":35153},"delta":13942,"quote":0.21100000000000002},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"BB":{"name":"Brandenburg","administeredVaccinations":1593979,"vaccinated":1079407,"vaccination":{"biontech":719059,"moderna":89293,"astraZeneca":240688,"janssen":30367},"delta":14018,"quote":0.428,"secondVaccination":{"vaccinated":544939,"vaccination":{"biontech":432096,"moderna":50282,"astraZeneca":32194,"janssen":30367},"delta":8249,"quote":0.21600000000000003},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"HB":{"name":"Bremen","administeredVaccinations":497248,"vaccinated":340019,"vaccination":{"biontech":212785,"moderna":20574,"astraZeneca":93817,"janssen":12843},"delta":2603,"quote":0.499,"secondVaccination":{"vaccinated":170072,"vaccination":{"biontech":136541,"moderna":12589,"astraZeneca":8099,"janssen":12843},"delta":2886,"quote":0.25},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"HH":{"name":"Hamburg","administeredVaccinations":1176614,"vaccinated":802087,"vaccination":{"biontech":527980,"moderna":80488,"astraZeneca":173672,"janssen":19947},"delta":4094,"quote":0.434,"secondVaccination":{"vaccinated":394474,"vaccination":{"biontech":324009,"moderna":41228,"astraZeneca":9290,"janssen":19947},"delta":8108,"quote":0.214},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"HE":{"name":"Hessen","administeredVaccinations":4037867,"vaccinated":2874955,"vaccination":{"biontech":1916321,"moderna":227758,"astraZeneca":681862,"janssen":49014},"delta":17343,"quote":0.457,"secondVaccination":{"vaccinated":1211926,"vaccination":{"biontech":984970,"moderna":76850,"astraZeneca":101092,"janssen":49014},"delta":29927,"quote":0.193},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"MV":{"name":"Mecklenburg-Vorpommern","administeredVaccinations":1116418,"vaccinated":761021,"vaccination":{"biontech":542134,"moderna":62074,"astraZeneca":141115,"janssen":15698},"delta":4926,"quote":0.473,"secondVaccination":{"vaccinated":371095,"vaccination":{"biontech":313409,"moderna":26929,"astraZeneca":15059,"janssen":15698},"delta":10730,"quote":0.231},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"NI":{"name":"Niedersachsen","administeredVaccinations":5242447,"vaccinated":3734362,"vaccination":{"biontech":2329744,"moderna":224701,"astraZeneca":1047067,"janssen":132850},"delta":24195,"quote":0.467,"secondVaccination":{"vaccinated":1640935,"vaccination":{"biontech":1295416,"moderna":142971,"astraZeneca":69698,"janssen":132850},"delta":43919,"quote":0.205},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"NW":{"name":"Nordrhein-Westfalen","administeredVaccinations":12511030,"vaccinated":8722892,"vaccination":{"biontech":5748870,"moderna":645573,"astraZeneca":2117478,"janssen":210971},"delta":44444,"quote":0.486,"secondVaccination":{"vaccinated":3999109,"vaccination":{"biontech":3397641,"moderna":225427,"astraZeneca":165070,"janssen":210971},"delta":92217,"quote":0.223},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"RP":{"name":"Rheinland-Pfalz","administeredVaccinations":2695222,"vaccinated":1823409,"vaccination":{"biontech":1231680,"moderna":151381,"astraZeneca":404904,"janssen":35444},"delta":20198,"quote":0.445,"secondVaccination":{"vaccinated":907257,"vaccination":{"biontech":773086,"moderna":49523,"astraZeneca":49204,"janssen":35444},"delta":13941,"quote":0.222},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"SL":{"name":"Saarland","administeredVaccinations":730971,"vaccinated":484355,"vaccination":{"biontech":362745,"moderna":35642,"astraZeneca":77567,"janssen":8401},"delta":2883,"quote":0.491,"secondVaccination":{"vaccinated":255017,"vaccination":{"biontech":221603,"moderna":15087,"astraZeneca":9926,"janssen":8401},"delta":6669,"quote":0.258},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"SN":{"name":"Sachsen","administeredVaccinations":2625027,"vaccinated":1669185,"vaccination":{"biontech":1142199,"moderna":159538,"astraZeneca":332178,"janssen":35270},"delta":13293,"quote":0.41,"secondVaccination":{"vaccinated":991112,"vaccination":{"biontech":848410,"moderna":73881,"astraZeneca":33551,"janssen":35270},"delta":10797,"quote":0.243},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"ST":{"name":"Sachsen-Anhalt","administeredVaccinations":1421960,"vaccinated":977023,"vaccination":{"biontech":676946,"moderna":80960,"astraZeneca":190033,"janssen":29084},"delta":9443,"quote":0.445,"secondVaccination":{"vaccinated":474021,"vaccination":{"biontech":377632,"moderna":44798,"astraZeneca":22507,"janssen":29084},"delta":13837,"quote":0.21600000000000003},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"SH":{"name":"Schleswig-Holstein","administeredVaccinations":2027532,"vaccinated":1382212,"vaccination":{"biontech":939127,"moderna":95962,"astraZeneca":314005,"janssen":33118},"delta":5573,"quote":0.47600000000000003,"secondVaccination":{"vaccinated":678438,"vaccination":{"biontech":550798,"moderna":54421,"astraZeneca":40101,"janssen":33118},"delta":6271,"quote":0.23399999999999999},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"TH":{"name":"Thüringen","administeredVaccinations":1415808,"vaccinated":945003,"vaccination":{"biontech":656989,"moderna":110860,"astraZeneca":160124,"janssen":17030},"delta":6894,"quote":0.44299999999999995,"secondVaccination":{"vaccinated":487835,"vaccination":{"biontech":411851,"moderna":31030,"astraZeneca":27924,"janssen":17030},"delta":6540,"quote":0.22899999999999998},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}},"Bund":{"name":"Bundesressorts","administeredVaccinations":172129,"vaccinated":121069,"vaccination":{"biontech":27403,"moderna":71736,"astraZeneca":18294,"janssen":3636},"delta":1586,"quote":null,"secondVaccination":{"vaccinated":54696,"vaccination":{"biontech":1601,"moderna":43696,"astraZeneca":5763,"janssen":3636},"delta":1981,"quote":null},"indication":{"age":null,"job":null,"medical":null,"nursingHome":null,"secondVaccination":{"age":null,"job":null,"medical":null,"nursingHome":null}}}}},"meta":{"source":"Robert Koch-Institut","contact":"Marlon Lueckert (m.lueckert@me.com)","info":"https://github.com/marlon360/rki-covid-api","lastUpdate":"2021-06-08T08:11:25.000Z","lastCheckedForUpdate":"2021-06-08T13:25:53.991Z"}}

gregorsarnow commented 3 years ago

Hey there! The endpoint https://api.corona-zahlen.org/vaccinations/history is still not working => only '0's But the data is available in the 'Impfquotenmonitoring.xlsx'. Is it a mistake that this data is not used for the api?

Could you maybe include it again, @Rubber1Duck @marlon360?

Thanks in advance!

marlon360 commented 3 years ago

Hey @Gregorie! The RKI changes the structure of the Excel sheet again. This 518e8153f4b967426a79d3ca5c02bd65edc0a9c8 should fix it. Will be deployed in a few minutes.

laurenzfg commented 3 years ago

Once again, RKI broke vaccinations. See #237

marcusraitner commented 3 years ago

Thanks @laurenzfg … this is so bizarre