-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ab_ddd() returns NA for several ATCs #46
Comments
Many thanks for this input! Didn’t know of that list, that could be a great addition. Though it won’t be easy to incorporate all the differences and duplicates in it, e.g. J01CR50 is 8 times in that list… I’ll update the dataset where I can and also add a test that units should never be missing. |
While working on this issue, one thing needs clarification:
This is intended. From the documentation: # defined daily doses (DDD)
ab_ddd("AMX", "oral") # 1
ab_ddd("AMX", "oral", units = TRUE) # "g"
ab_ddd("AMX", "iv") # 1
ab_ddd("AMX", "iv", units = TRUE) # "g" We chose to return the value (numeric) so it can be used for other data processing easier. With Do you think this needs more convenience? If we give it an additional class in R, we could have the units printed, while the actual returned values are numeric. Didn’t seem a great idea in 2018 when we came up with these |
By the way, that is AWESOME!!! 🤩 |
Sorry for not being clear in my issue description. I've read the documentation (which btw is really well made) regarding the return type of ab_ddd() function. The problem I face is the following:
The return is NA, but it should have been
I personally do not mind this. I've written my R scripts using ab_ddd() with the units argument TRUE and FALSE, depending on my needs. In other programming languages (Java, C++) it it not possible to have different return types for a function/method, but I do not know if in R this is a bad practice (although it is confusing for people that code in a different language). Another approach is to return an R list with both the number and the unit, if you want to avoid creating a new class or leave it as it is. |
The hospital I am doing the analysis for also uses some antimicrobials that are not in the ATC
Please let me know if I should open a separate issue for this. |
At this moment, ATC codes are unique identifiers for antibiotics in our data set. This should not be the case, so this requires a big change in our
Nah, not needed. |
Totally with you there, it shouldn't be confusing. So implemented this for the next release: ab_ddd("AMX", units = TRUE)
#> [1] "g"
#> Warning message:
#> Using `ab_ddd(... , units = TRUE)` is deprecated, use `ab_ddd_units()` instead. This warning will be shown once per session. I'm also reviewing other |
Sounds good 😆. This is a cleaner approach.
The |
Also found out that our reproduction script to create the ab_ddd("J01DI54", administration = "iv", units = TRUE)
#> [1] NA Updating the data set now. |
The development version nows contains the fix to this issue. You can try the latest version yourself using: install.packages("remotes") # if you haven't already
remotes::install_github("msberends/AMR") |
Hi Matthijs, |
Thank you for this great package! I use it quite heavily in my antimicrobial stewardship projects.
Issue details
ab_ddd() & atc_online_property() both return NA for:
J01EE01
(SULFAMETHOXAZOLUM + TRIMETHOPRIMUM).This happens for combination products where the DDDs deviate from the main principles.
These DDDs are included in a separate list: https://www.whocc.no/ddd/list_of_ddds_combined_products/.
P01AB01
(metronidazole oral) - not yet in the database (?)J01DI54
(CEFTOLOZANUM+TAZOBACTAM):Session info
The text was updated successfully, but these errors were encountered: