Home

Awesome

MedCodeMap: Medication Code Mapping Tool

We have renamed the package into "MedCodeMap".

There are many medication/drug taxonomy systems, such as RXCUI, NDC, ATC. I feel it time-consuming and very confusing to map codes between two different systems during working on this drug recommendation project https://github.com/ycq091044/SafeDrug. Sometimes, the code mapping resources cannot be accessible as well. To help others onboarding, here we go!

This python package provides an easy-to-use medication code mapping tool. Within the supported drug coding systems, it provides easy functions to map from one coding system to another coding system. Currently, we support the following drug coding systems

For any given combination of coding systems, we will provide the mapping functions. For example


1. Package Installation

# get from PyPI
$ pip install MedCodeMap
# local installation
$ cd ~/MedCodeMap
$ pip3 install dist/MedCodeMap-[VERSION-ID]-py3-none-any.whl

To look up for help, directly type "MedCodeMap" in the cmd and the help message will pop up.

$ MedCodeMap

2. Quick Usage

Load all mappings during initialization

from MedCodeMap import CodeMapping
# initialize with a list of supported coding systems
tool = CodeMapping('NDC10', 'RXCUI', 'Name', 'SMILES')
tool.load()

# we are good to go, e.g.,
tool.RXCUI_to_SMILES['312055']
tool.NDC_to_Name['76413-153-06']
...

Want to add more coding systems later?

# add additional coding system
tool.add_new_code("NDC11")

# we are good to go, e.g.,
tool.NDC_to_NDC11['76413-153-06']

3. Current Data Resources

The current data resources are loaded from Google Drive. We basically borrow the data from