Skip to main content

A package for medical code mapping

Project description

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

  • NDC10: the National Drug Codes system on 10-digit level
  • NDC11: the National Drug Codes system on 11-digit level
  • RXCUI: RxNorm concept unique identifier
  • ATC4: Anatomical Therapeutic Chemical code level-4
  • Name: drug string-based name, e.g., Lorazepam
  • SMILES: drug smiles string

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

  • User Input: NDC10, RXCUI, ATC4
  • Output Python Dictionary Object
    • NDC10_to_RXCUI, NDC10_to_ATC4, RXCUI_to_NDC10, RXCUI_to_ATC4, ATC4_to_NDC10, ATC4_to_RXCUI

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']
  • check test/Example.ipynb for examples.
  • Implementation Features --- Minimal Computation. The tool will require minimum computation cost for generating all necessary combinations within the listed coding systems, and other mapping functions will not be generated. For example, in this demo, NDC11_to_RXCUI will not be accessible since NDC11 is not listed in the user input (before). Our minimal cost computation relies on that we maintain a graph structure of the listed coding systems and use shortest path method to find the missing mapping.

3. Current Data Resources

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

Project details


Release history Release notifications | RSS feed

This version

1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MedCodeMap-1.4.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

MedCodeMap-1.4-py2.py3-none-any.whl (6.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file MedCodeMap-1.4.tar.gz.

File metadata

  • Download URL: MedCodeMap-1.4.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for MedCodeMap-1.4.tar.gz
Algorithm Hash digest
SHA256 7e97e037c99b2dade502c6590604d8f9a1a108a56838a0b8cb103baa4009215e
MD5 8f1b3bda366e62f6b3dc7e980da2eddf
BLAKE2b-256 5531c8a4fd183db6a5d1b770723df0127f37241c8c800644a68ba88234195f1e

See more details on using hashes here.

File details

Details for the file MedCodeMap-1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: MedCodeMap-1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for MedCodeMap-1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d2ddbf9799a8fd8c798eebf12fcb3b60b1d1410afc4cbd157f95991f21280084
MD5 a8a95d4240848f44ba503f6265ddada1
BLAKE2b-256 e71b8a3eb0c9b8514d22e0223a60435d7716ed48629757cad9e64478204fc122

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page