Kela corona indicators and a web app on reimbursed medicine consumption

open data

Markus Kainu


December 13, 2020

The virus has troubled the world the whole year and does not seem to cease soon. There were plenty of Corona related dashboards and visualizations around in April/May, but it seems that the buzz has calmed down a bit. I bloggerd (in Finnish) about corona data api of Finnish Institute for Health and Welfare in March published a daily updating dashboard SARS-Cov-2 Timeline Trajectories: Health Districts in Finland based on their reliable api.

Corona has also affected what I do at work and we have created together with colleagues two separate resources for tracking the effect of corona on Kela benefits. (corona indicators) provides data and analysis on several Kela benefits at daily, weekly and monthly resolutions in terms of number of applications, number of recipients and on the performance of Kela customer service. Site is refreshed every weekday at 10am.

Purchased prescription medicines in Finland- web app provides a dynamic access to information on reimbursable prescription medicines in terms of costs, number of purchases and number of patients on a weekly basis in 2019 and 2020 at the national level as well as health district level.

Both application provide open data in addition to their simplistic analysis. Data on corona indicators is documented on the website (in Finnish only) and can be doanloaded from Github. Data from medicine app can be accessed also at Github.

There are examples on how to get started with the data both about corona indicators and medicine data. The easiest way to get started is to create an account in, copy the code snippets and begin to wonder! Below is one more example!

  etuus = col_character(),
  vuosi = col_integer(),
  aikatyyppi = col_character(),
  kuukausi = col_integer(),
  viikko = col_integer(),
  paiva = col_date(),
  viikonpaiva = col_character(),
  alue = col_character(),
  ikaluokka = col_character(),
  sukupuoli = col_character(),
  saapuneet_hakemukset = col_double(),
  updated = col_datetime()
) -> data_cols

dat <- readr::read_csv("", 
                       col_types = data_cols) %>% 
  # releveloidaan ikäluokka
  mutate(ikaluokka = factor(ikaluokka),
         ikaluokka = fct_relevel(ikaluokka, c("kaikki","alle 25"))) %>% 
  # Etuuksien järjestys
  mutate(etuus = factor(etuus, levels = c("Työttömyysturva",
                                          "Yrittäjien työmarkkinatuki",
                                          "Yleinen asumistuki", 
         vuosi = factor(vuosi)) %>% 
# A tibble: 6 × 19
  etuus    vuosi aikat…¹ kuuka…² viikko paiva      viiko…³ alue  ikalu…⁴ sukup…⁵
  <fct>    <fct> <chr>     <int>  <int> <date>     <chr>   <chr> <fct>   <chr>  
1 Työttöm… 2020  paiva         1      1 2020-01-01 keskiv… Koko… kaikki  kaikki 
2 Työttöm… 2020  paiva         1      1 2020-01-02 torstai Koko… kaikki  kaikki 
3 Työttöm… 2020  paiva         1      1 2020-01-03 perjan… Koko… kaikki  kaikki 
4 Työttöm… 2020  paiva         1      1 2020-01-04 lauant… Koko… kaikki  kaikki 
5 Työttöm… 2020  paiva         1      1 2020-01-05 sunnun… Koko… kaikki  kaikki 
6 Työttöm… 2021  paiva         1      1 2021-01-04 maanan… Koko… kaikki  kaikki 
# … with 9 more variables: saapuneet_hakemukset <dbl>, data <chr>,
#   saajat_kaikki <dbl>, saajat_uudet <dbl>, saajakotitaloudet_kaikki <dbl>,
#   saajakotitaloudet_uudet <dbl>, saajaruokakunnat_kaikki <dbl>,
#   saajaruokakunnat_uudet <dbl>, updated <dttm>, and abbreviated variable
#   names ¹​aikatyyppi, ²​kuukausi, ³​viikonpaiva, ⁴​ikaluokka, ⁵​sukupuoli
levels(dat$etuus)[levels(dat$etuus) == "Työttömyysturva"] <- "Unemployment benefit"
levels(dat$etuus)[levels(dat$etuus) == "Yrittäjien työmarkkinatuki"] <- "Unemployment benefit for self-employed"
levels(dat$etuus)[levels(dat$etuus) == "Yleinen asumistuki"] <- "Housing benefit"
levels(dat$etuus)[levels(dat$etuus) == "Perustoimeentulotuki"] <- "Social assistance"
levels(dat$etuus)[levels(dat$etuus) == "Sairauspäiväraha"] <- "Sickness allowance"
levels(dat$etuus)[levels(dat$etuus) == "Tartuntatautipäiväraha"] <- "Infectious disease allowance"
levels(dat$etuus)[levels(dat$etuus) == "Epidemiatuki"] <- "Temporary compensation due to an epidemic outbreak for basic social assistance clients"

datplot <- dat %>% 
  dplyr::filter(aikatyyppi == "viikko",
         ikaluokka == "kaikki",
         sukupuoli == "kaikki",
         alue == "Koko Suomi") %>% 
  mutate(viikko = as.integer(viikko))

       aes(x = viikko, 
           y = saapuneet_hakemukset, 
           color = vuosi, 
           fill = vuosi)) +
  geom_line() +
  geom_point(shape = 21, color = "white", size = 1.6,  show.legend = FALSE) +
  facet_wrap(~etuus, ncol = 1, scales = "free_y") +
  scale_x_continuous(breaks = 1:max(datplot$viikko)) +
        labs(fill = NULL, 
             color = NULL, 
             y = NULL,
             title = "Applications per week",
             subtitle = "number of applications received at Kela per week",
             x = "Viikko") +
  theme_light() +
        theme(legend.position = "right", 
              legend.direction = "vertical",
              panel.grid.minor = element_blank()) +
        scale_y_continuous(labels = function(x) format(x, big.mark = " ",
                                                       scientific = FALSE),
                           limits = c(0,NA))


CC BY 4.0


BibTeX citation:
  author = {Markus Kainu},
  editor = {},
  title = {Kela Corona Indicators and a Web App on Reimbursed Medicine
  date = {2020-12-13},
  url = {},
  langid = {en}
For attribution, please cite this work as:
Markus Kainu. 2020. “Kela Corona Indicators and a Web App on Reimbursed Medicine Consumption.” December 13, 2020.