ropensci / coder

Classification of Cases into Deterministic Categories
https://docs.ropensci.org/coder/
22 stars 4 forks source link

New structure of NPR data from NBHW #37

Closed eribul closed 6 years ago

eribul commented 6 years ago

Previous lpnr is now called lopnr. Previous bdia1, bdia2, ... are now all stored in space separeted DIAGNOS together with hdia.

fix_possible_pardatatherefore doesn't recognise the data as NPR data, whish it should!

eribul commented 6 years ago

Temporary solution that could be incorporated in the function:


setnames(par_ov, "LopNr", "lpnr")
par_ov <- 
  as.data.table(par_ov)[
    , HDIA := NULL][
    , c("hdia", paste0("bdia", 1:19)) := tstrsplit(DIAGNOS, " ")
  ]

setnames(par_sv, "LopNr", "lpnr")
par_sv <- 
  as.data.table(par_sv)[
    , HDIA := NULL][
    , c("hdia", paste0("bdia", 1:29)) := tstrsplit(DIAGNOS, " ")
    ]

par <- 
  coder::as.codedata(
    par_ov, par_sv, 
    from = "2000-01-01", to = "2016-12-31", 
    .copy = FALSE
  )