Thank you for the package — we use as.ab()/as.mo() in an antibiotic-stewardship tool for Korean hospitals.
Korean prescription exports carry product names, e.g. 타조신주 4.5g (Tazocin), 유한메로펜주사 0.5g (meropenem), 로세핀주 1g (Rocephin). Today as.ab() cannot resolve them, for two structural reasons:
generalise_antibiotic_name() replaces every character outside [A-Z0-9 -)(] with /, so any Hangul (or CJK/Cyrillic) alias collapses to slashes before matching.
add_custom_antimicrobials() refuses codes that already exist (stop_if(any(x$ab %in% AB_lookup$ab))), and only name is added to generalised_all — so there is no supported way to attach extra synonyms to an existing code such as TZP.
Proposal (happy to send a PR for any of these):
- (a)
add_custom_antimicrobial_synonyms(ab, synonyms) (or accept an existing ab in add_custom_antimicrobials() when only synonyms are supplied), appending to synonyms/generalised_synonyms for that code.
- (b) Make
generalise_antibiotic_name() keep letters of any script ([^\\p{L}\\p{N} -)(] with perl = TRUE) so non-Latin aliases survive; existing Latin behaviour is unchanged.
- (c) Optionally, a
AMR_custom_ab_synonyms option mirroring AMR_custom_ab, so a site can point to a CSV/RDS of trade names.
We have a ready, licence-clean table: 2,539 Korean product names/brand stems → 24 EARS-Net codes, derived from the Korean HIRA drug master (public data, KOGL-1) with a no-guessing rule (ingredient tokens or generic-name code must map exactly; collisions dropped; word-start matching so that 펜타조신/pentazocine does not hit 타조신). Repo: https://github.com/tori0513/kr-antimicrobial-tradenames. We would keep it updated quarterly with the HIRA release.
Would you accept (b) as a small PR first, and how would you prefer (a) to look?
Thank you for the package — we use
as.ab()/as.mo()in an antibiotic-stewardship tool for Korean hospitals.Korean prescription exports carry product names, e.g.
타조신주 4.5g(Tazocin),유한메로펜주사 0.5g(meropenem),로세핀주 1g(Rocephin). Todayas.ab()cannot resolve them, for two structural reasons:generalise_antibiotic_name()replaces every character outside[A-Z0-9 -)(]with/, so any Hangul (or CJK/Cyrillic) alias collapses to slashes before matching.add_custom_antimicrobials()refuses codes that already exist (stop_if(any(x$ab %in% AB_lookup$ab))), and onlynameis added togeneralised_all— so there is no supported way to attach extra synonyms to an existing code such asTZP.Proposal (happy to send a PR for any of these):
add_custom_antimicrobial_synonyms(ab, synonyms)(or accept an existingabinadd_custom_antimicrobials()when onlysynonymsare supplied), appending tosynonyms/generalised_synonymsfor that code.generalise_antibiotic_name()keep letters of any script ([^\\p{L}\\p{N} -)(]withperl = TRUE) so non-Latin aliases survive; existing Latin behaviour is unchanged.AMR_custom_ab_synonymsoption mirroringAMR_custom_ab, so a site can point to a CSV/RDS of trade names.We have a ready, licence-clean table: 2,539 Korean product names/brand stems → 24 EARS-Net codes, derived from the Korean HIRA drug master (public data, KOGL-1) with a no-guessing rule (ingredient tokens or generic-name code must map exactly; collisions dropped; word-start matching so that 펜타조신/pentazocine does not hit 타조신). Repo: https://github.com/tori0513/kr-antimicrobial-tradenames. We would keep it updated quarterly with the HIRA release.
Would you accept (b) as a small PR first, and how would you prefer (a) to look?