powered by
Convert ATC Code for each patients to the corresponding DFS number of the ATC tree
ATCtoNumeric(patientATC, tree)
a matrix of the same size as patientATC but containing integer that are the index of the corresponding ATC code.
: patients observations, for each patient we got a string containing taken medications (ATC code)
: ATC tree (we assume that there is a column 'ATCCode' )
ATC_code <- c('A01AA30 A01AB03', 'A10AC30') ATCtoNumeric(ATC_code, ATC_Tree_UpperBound_2024)
Run the code above in your browser using DataLab