Issue with getDrugIngredientCodes when drug name [ ¹⁸ F]AlF-NOTA-FAPI-04 is in concepts

Abierto
#247 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
r
Área
data

Línea de trabajo

Comienza en getDrugIngredientCodes y sigue filterIngredientConcepts hasta tidyWords, reproduciendo el fallo con OMOP concept_id 1253507 en los datos de concepts. Confirma la corrección volviendo a ejecutar la llamada indicada con aspirin y diclofenac y verificando que devuelve una codelist sin el error invalid UTF-8.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the bug
The function getDrugIngredientCodes fails when the drug [ ¹⁸ F]AlF-NOTA-FAPI-04 (concept_id =1253507) is within the concepts part of the cdm, since the function tidyWords within filterIngredientConcepts throws an error because it contains the trimws base function, which requires the format of the string to be in UTF-8. This is regardless if options(encoding ="latin1") was used before executing the function

To Reproduce
Steps to reproduce the behavior:

  1. Create a CDM Object, add the particular concept_id and concept_name
  2. Run
getDrugIngredientCodes(
                         cdm = cdm, 
                         name = c("aspirin", "diclofenac"),
                         nameStyle = "{concept_name}"
                         )
  1. See error, it will fail even if it's not a code you're looking for.

Expected behavior
Expected the function to return a codelist.

Screenshots
No screenshots, but here is the rlang::last_trace

<error/rlang_error>
Error in `dplyr::filter()`:
ℹ In argument: `tidyWords(.data$concept_name) %in% tidyWords(.env$name)`.
Caused by error in `sub()`:
! input string 29815 is invalid UTF-8
---
Backtrace:
     ▆
  1. ├─CodelistGenerator::getDrugIngredientCodes(...)
  2. │ └─CodelistGenerator:::filterIngredientConcepts(...)
  3. │   ├─dplyr::filter(...)
  4. │   └─dplyr:::filter.data.frame(ingredientConcepts, tidyWords(.data$concept_name) %in% tidyWords(.env$name))
  5. │     └─dplyr:::filter_rows(.data, dots, by)
  6. │       └─dplyr:::filter_eval(...)
  7. │         ├─base::withCallingHandlers(...)
  8. │         └─mask$eval_all_filter(dots, env_filter)
  9. │           └─dplyr (local) eval()
 10. ├─tidyWords(.data$concept_name) %in% tidyWords(.env$name)
 11. ├─CodelistGenerator:::tidyWords(.data$concept_name)
 12. │ └─base::trimws(words)
 13. │   ├─base (local) mysub(...)
 14. │   │ └─base::sub(re, "", x, perl = TRUE)
 15. │   │   └─base::is.factor(x)
 16. │   └─base (local) mysub(paste0("^", whitespace, "+"), x)
 17. │     └─base::sub(re, "", x, perl = TRUE)
 18. └─base::.handleSimpleError(...)
 19.   └─dplyr (local) h(simpleError(msg, call))
 20.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)

Desktop:

  • OS: Ubuntu 22
  • Browser: Chrome

Additional context
Here's the Athena link, both the code and the drug name are supposedly standard. I'm guessing if there's one of these now, there'll probably be more.

Lenguaje dominante
R
Estrellas
18
Forks
9
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de darwin-eu/CodelistGenerator

Todos los issues de darwin-eu/CodelistGenerator

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.