mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 13:21:50 +02:00
(v0.9.0.9012) Support for LOINC codes
This commit is contained in:
13
R/ab.R
13
R/ab.R
@ -143,6 +143,19 @@ as.ab <- function(x, ...) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact LOINC code
|
||||
loinc_found <- unlist(lapply(AMR::antibiotics$loinc,
|
||||
function(s) if (x[i] %in% s) {
|
||||
TRUE
|
||||
} else {
|
||||
FALSE
|
||||
}))
|
||||
found <- AMR::antibiotics$ab[loinc_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact synonym
|
||||
synonym_found <- unlist(lapply(AMR::antibiotics$synonyms,
|
||||
|
Reference in New Issue
Block a user