Link Drugs on Market to RxNorm
#31
Closed
opened 3 years ago by youainti
·
24 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Take two files, rxnorm mapping and Comprehensive NDC_SPL data elements file to link together.
Get rxnorm mappings from https://dailymed-data.nlm.nih.gov/public-release-files/rxnorm_mappings.zip and unzip to get the file
rxnorm_mappings.txtrxnorm mappings use rxnorm term types rxtty https://www.nlm.nih.gov/research/umls/rxnorm/docs/appendix5.html
the comprehensive NDC_SPL data elements can be found at the bottom of https://open.fda.gov/data/downloads/
The links I used were
https://download.open.fda.gov/other/nsde/other-nsde-0001-of-0003.json.zip
https://download.open.fda.gov/other/nsde/other-nsde-0002-of-0003.json.zip
https://download.open.fda.gov/other/nsde/other-nsde-0003-of-0003.json.zip
266c1c9has a working download and inserter.Bug exists where start and end dates seem backwards.
those json files are also available as a single csv at
https://www.fda.gov/industry/structured-product-labeling-resources/nsde
https://lhncbc.nlm.nih.gov/RxNav/applications/RxNav-in-a-Box.html
Docker container to run rxnorm and rxclass locally
I setup RXnavinabox and it is stored on
[/media/will/2397706f-a8f8-4763-ac3f-8a9c07e6101f/Data/rxnav-in-a-box-20230103
]
I feel like I need to integrate it into setup.
insstead of using teh RxNorm Mappings, I am going to use the RxNavInABox api to link drugs (as listed as mesh-terms in ctgov.browse_interventions) to RxCUI's.
General process
List of steps
I have got some basic api requests working as of
4cc4c5c99f.Here are some approaches I am considering
Note that by storing the original datasource the analysis becomes repeatable.
Using APIs
Pro
ctgov.browse_interventions's mesh terms is automatic and reasonably justifiable.Cons
Importing
Pro
Con
Mixed
I could just use the API to get the rxcui and then interact with the db as necessary
So the following has information on primary keys in the database and information on how to query it https://www.nlm.nih.gov/research/umls/rxnorm/docs/techdoc.html#s14_0
Consider the three following queries against the api for different RxCUIs related to levothyroxine.
get rxcui that might apply
http://will-office:4000/REST/rxcui.json?name=gemcitabine&search=1&srclist=rxnorm
Scanning rxnav, those are IN and PIN respectively.
To find the tty throught the api, I should search
http://will-office:4000/REST/rxcui/12574/property.json?propName=TTY
http://will-office:4000/REST/rxcui/236234/property.json?propName=TTY
A similar query that provides other identifiers
http://will-office:4000/REST/rxcui/12574/allProperties?prop=attributes+codes
I can now search for associated brand names
http://will-office:4000/REST/rxcui/12574/related.json?tty=BN
http://will-office:4000/REST/rxcui/236234/related.json?tty=BN
Note how the IN has brands but the PIN doesn't.
These can ?probably? be matched aganst the marketing info. If not, i believe there is an NDC or something similar that can be used.
Need to make sure these queries limit to human prescription drugs. For example, toggling human and prescription on http://will-office:4000/RxNav/search?searchBy=RXCUI&searchTerm=10582 changes from 10 to 8 brands.
So I can link on this table.
It appears that the best option is to import the appropriate data into postgres. the primary reason is that linking will probably go better.
I think I am going to do this manually the first time using mysql workbench to export the tables and then manually upload them to postgres.
IN
97af862I created a tool to migrate tables from the mariadb backing RxNavInABox to postgres. I also created a view that links trials to drugs as measured by rxcui's.At this point I can match trials to available brands. Now I need to link brands to marketing dates.
I am wondering if I can grab (instead of brand names
BN) the ndcs or package ndcs associated with the brands. If so then I can do a direct match of some sort.Figured out what to do.
If I grab every brand, then every branded drug or pack associated with that drug and then attach that to the nsde data I would get the marketing dates required.
I need to bring the correct tables into postgres but the date columns need ignored or converted.
Link trials to ingredients, brands, and packs
Sounds like I am running into some issues with the database. I think I need to restart everything from scratch with the docker containers storing things on my 4tb drive.
Turns out the error is related to the size of shared memory in the container. I upped it from 64mib to 1gib.
I have figured out that some of these are just going to take a long time to run.
I am trying to break them down into simpler tables/temp tables.
The current plan is just to get the earliest date that any brand containing all the ingredients was sold.
Linked trials to marketing start dates with the views created in Associating NCTs to NDCs and marketing dates
Note that I only linked to start dates, not the number of currently active brands.