Skip to content

Feature request: trade-name synonyms for existing codes (Korean list ready) + Unicode-safe name generalisation #307

Description

@tori0513

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:

  1. generalise_antibiotic_name() replaces every character outside [A-Z0-9 -)(] with /, so any Hangul (or CJK/Cyrillic) alias collapses to slashes before matching.
  2. 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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions