Skip to content
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

Build a list of antibiotics code in RxNorm #63

Open
razekmh opened this issue Feb 3, 2025 · 1 comment
Open

Build a list of antibiotics code in RxNorm #63

razekmh opened this issue Feb 3, 2025 · 1 comment
Assignees
Labels
spike Self contained exploratory work

Comments

@razekmh
Copy link

razekmh commented Feb 3, 2025

The watch lists of antibiotics are all in ATC which is not really useful when searching the drug_exposure table. At the moment I would take an ATC code and search in the athena database or use the drug_lookup_table neither is an effective method. I should find a way to pull the codes without having to search one by one like this.

@razekmh razekmh self-assigned this Feb 3, 2025
@razekmh
Copy link
Author

razekmh commented Feb 3, 2025

A bit of a background. I have a list of the antibiotics on the UK watchlist. The list is of the names of the drugs and ATC codes. I believe the list comes from a paper on the subject.

I want to search the drug_exposure table to find any instances of the antibiotics in the data we have access to. However, it is not possible to search directly using the ATC codes. I have to find the RxNorm codes for each of these drugs. I have two obvious ways to do this.

use the omop_drug_lookup_create

I can filter the table using the ATC codes to find equivalent RxNorm codes. I then used the extracted RxNorm codes to filter the drug_exposure table. Alas, No matches!

> drugclasses <- omopcept::omop_drug_lookup_create()
> lookup_uk_watchlist <- filter(drugclasses, ATC_code %in% UK_ATC_watchlist$`ATC code`)
> filter(drug_exposure_df, drug_exposure_df$drug_concept_id %in% lookup_uk_watchlist$drug_concept_id)
# A tibble: 0 × 25

use athena

This offers more codes to look for. For example looking at J01CA04 for amoxicillin

  • omop_drug_lookup_create gets me one match
> filter(drugclasses, ATC_code == "J01CA04")
# A tibble: 1 × 7
  drug_concept_name drug_concept_id
  <chr>                       <int>
1 amoxicillin               1713332
# ℹ 5 more variables: drug_concept_class_id <chr>,
#   ATC_level <chr>, ATC_concept_name <chr>,
#   ATC_code <chr>, ATC_concept_id <int>

Which naturally returns null

> filter(drug_exposure_df, drug_exposure_df$drug_concept_id == "1713332")
# A tibble: 0 × 25
# ℹ 25 variables: drug_exposure_id <int>,
#   person_id <int>, drug_concept_id <int>,
#   drug_exposure_start_date <date>,
#   drug_exposure_start_datetime <dttm>,
#   drug_exposure_end_date <date>,
#   drug_exposure_end_datetime <dttm>,
#   verbatim_end_date <date>, …

however checking in athena I can get a list of around 441 matches most of these are commercial names for drugs with amoxicillin in them for example Amoxicillin / Clarithromycin / Omeprazole Oral Tablet, Amoxicillin / Clavulanate Intravenous Solution, Amoxicillin / Clavulanate Powder for Oral Suspension .. I copied all to a temp table and still found nothing

> filter(drug_exposure_df, drug_exposure_df$drug_concept_id %in% tmp_amx_data$Concept.id)
# A tibble: 0 × 25
# ℹ 25 variables: drug_exposure_id <int>,
#   person_id <int>, drug_concept_id <int>,
#   drug_exposure_start_date <date>,
#   drug_exposure_start_datetime <dttm>,
#   drug_exposure_end_date <date>,
#   drug_exposure_end_datetime <dttm>,
#   verbatim_end_date <date>, …

It is not very practical to go one by one on this and I suspect that I might not be able to do it without automating the process. This is a considerable amount of work and it would make sense to check that I am on the correct track before spending time on this.


One worry that this experience showed is that if given a concept ID to check and if the concept ID is an RxNorm attached to a commercial name of a drug. Then the DDD calculated would be only for this exact drug and not for all the commercial names attached to the equivalent ATC code.

@razekmh razekmh added the spike Self contained exploratory work label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spike Self contained exploratory work
Projects
None yet
Development

No branches or pull requests

1 participant