Add mapping file to map hosp.prescriptions.ndc to various drug classes - #1753
Add mapping file to map hosp.prescriptions.ndc to various drug classes#1753mlbernauer wants to merge 4 commits into
hosp.prescriptions.ndc to various drug classes#1753Conversation
|
In total there appear to be 5732 distinct non-null NDCs in the
|
|
As an example, one can use the ATC classification to query all NDCs for Antiinfectives for Systemic Use which has a top-level ATC classification code of which should return 2109 results (785 distinct NDCs) across both the ATC and ATCPROD vocabularies. One limitation of this mapping file is that it only contains mappings between drugs and their immediate parent class. In other words, if a drug maps to class |
|
ndc→drug class map is nice. how do you handle obsolete/invalid ndc codes — drop or keep as unknown? |
Chessing234
left a comment
There was a problem hiding this comment.
i asked about invalid ndcs earlier; having pulled the file apart the format side is fine — every ndc is a quoted 11-digit string with leading zeros preserved, so it joins to hosp.prescriptions.ndc cleanly. no complaints there.
my concern is what the file actually contains versus what the title and body describe. of the 182,774 rows, the relation breakdown is:
38003 may_treat
27104 ci_with
22685 has_pe
19938 (empty)
17081 has_moa
10080 has_epc
7419 has_ingredient
...
4617 may_prevent
and by class_type, 69,193 rows — 38% of the file — are DISEASE. so the majority of this isn't drug-class membership at all; it's drug-to-disease relations, and 27k of those are contraindications. the very first data row is cycloserine ci_with "Alcoholism".
that's a real trap given how the pr is framed. your own example in the thread (where relation_source like 'ATC%') filters correctly, but the file is named drug_mappings.csv and described as mapping drugs "into different classes", so someone joining on ndc and grouping by class_name without filtering relation will silently treat contraindicated conditions as drug classes. could you either split the therapeutic-class rows from the drug-disease rows, or document the relation and class_type vocabularies in a readme alongside the csv and state plainly that filtering on relation is required?
the 19,938 rows with an empty relation also need explaining — as it stands there's no way to tell whether those are a distinct relation type, an extraction gap, or rows that should have been dropped.
two smaller things: the file is ~22 MB in a single commit, so it'd help to record how it was generated (which RxClass/RxNorm release, retrieved when, with what script) so it can be refreshed rather than becoming a frozen snapshot; and RxNorm/RxClass redistribution terms should probably be acknowledged somewhere. for what it's worth mimic-iv/mapping/ is the right place — d_labitems_to_loinc.csv and friends already live there.
This PR adds a mapping file (
drug_mappings.csv) which allows drugs inprescriptionstable to be organized into different classes (e.g. therapeutic, pharmacologic, mechanism of action, pharmacokinetic, among others).