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

未关闭
#247 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
r
领域
data

调研方向

从 getDrugIngredientCodes 开始,沿着 filterIngredientConcepts 进入 tidyWords,使用 concepts 数据中的 OMOP concept_id 1253507 重现该失败。使用 aspirin 和 diclofenac 重新运行报告中的调用,并验证其返回一个不带 invalid UTF-8 错误的 codelist,以确认修复有效。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
R
星标
18
派生
9
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

darwin-eu/CodelistGenerator 的其他 Issue

查看 darwin-eu/CodelistGenerator 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。