msberends / AMR

Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by using evidence-based methods, as described in https://doi.org/10.18637/jss.v104.i03.
https://msberends.github.io/AMR/
Other
83 stars 12 forks source link

Prevent unknown ATC codes from getting coerced #57

Closed msberends closed 2 years ago

msberends commented 2 years ago

ATC codes that are not in the antibiotics data set, should not be coerced, but should return this:

https://github.com/msberends/AMR/blob/70a07bad3995aa71993c56bf6634a6fafbcacc39/R/ab.R#L454-L460

For example, this should be not happening (since J01CR50 is not piptazo, see #55):

ab_info("J01CR50")
#> $ab
#> [1] "TZP"
#> 
#> $cid
#> [1] 461573
#> 
#> $name
#> [1] "Piperacilline/tazobactam"
#> 
#> $group
#> [1] "Beta-lactams/penicillines"
#> 
#> $atc
#> [1] "J01CR05"
#> 
#> $atc_group1
#> [1] "Beta-lactam antibacterials, penicillins"
#> 
#> $atc_group2
#> [1] "Combinations of penicillins, incl. beta-lactamase inhibitors"
#> 
#> $tradenames
#> [1] ""           "tazocel"    "tazocillin" "tazocin"    "zosyn"     
#> 
#> $loinc
#> character(0)
#> 
#> $ddd
#> $ddd$oral
#> $ddd$oral$amount
#> [1] NA
#> 
#> $ddd$oral$units
#> [1] NA
#> 
#> 
#> $ddd$iv
#> $ddd$iv$amount
#> [1] 14
#> 
#> $ddd$iv$units
#> [1] "g"
#> 
#> 
#> 
#> Warning messages:
#> 1: in `ab_ddd()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.Please
#> refer to the WHOCC website:
#> www.whocc.no/ddd/list_of_ddds_combined_products/ 
#> 2: in `ab_ddd_units()`: DDDs of combined products are available for different dose combinations and not (yet) part of the AMR
#> package.Please refer to the WHOCC website:
#> www.whocc.no/ddd/list_of_ddds_combined_products/ 
#> 3: in `ab_ddd_units()`: DDDs of combined products are available for different dose combinations and not (yet) part of the AMR
#> package.Please refer to the WHOCC website:
#> www.whocc.no/ddd/list_of_ddds_combined_products/