1
0
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:
2020-01-26 20:20:00 +01:00
parent 19172b1d48
commit 449d9bde35
35 changed files with 92866 additions and 295 deletions

13
R/ab.R
View File

@ -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,