Skip to main content

The pharmacy module is a set of utilities for use with hospital and retail pharmacy data.

Project description

pharmacy

Package Status PyPI Latest Release License Downloads

A hospital and retail pharmacy-focused Python package by Danny Limoges, PharmD.

This project is in the alpha/planning stage.

Installation

Available on PyPI as an installable package: https://pypi.org/project/pharmacy/

  pip install pharmacy

What is it?

This is a collection of modular utilities that aid in processing pharmacy data. Users must perform their own data validation to ensure that results generated by pharmacy are accurate and that the correct data was inputted.

What is it not?

pharmacy is not a pharmacy management system and does not replace Epic, Meditech, Pioneer or any other pharmacy software.

Syntax

find_best_matches

Get a fuzzy match between two DataFrames and combine them where matched. All rows from df_orig are kept and their corresponding matches are tacked onto the end if they meet the match threshold.

find_best_matches(df_orig       # Original pandas DataFrame 
                  , df2         # DataFrame to match against
                  , match_col   # Which column to examine in original DataFrame
                  , match_col_comparator = None   # The column name to compare
                  , threshold=80    # Only accept matches above this fuzzy match threshold.
                  , scorer=fuzz.token_set_ratio # Which type of fuzzy match? 
                                                # options: ratio, partial_ratio, token_sort_ratio, token_set_ratio
                  )

For more information on fuzzy match types, check out this article:

Understanding Fuzzy String Matching: Exploring Fuzz Ratio, Fuzz Partial Ratio, Token Set Ratio, and Token Sort Ratio: Machine Learning Concept 78, by Chandra Prakash Bathula

Example

>>> import pandas as pd
>>> import pharmacy as rx
>>> df = pd.DataFrame(
...     [('10000-1000-10','Acetaminophen 325mg',),
...     ('20000-2000-30','Lisinopril 10mg','7'),
...     ('30000-3000-30','Tylenol #3','c5'),
...      ], columns = ['ndc','description','schedule'])

Potential Future Goals

Tools to work on data from...

  • Drug data
    • Use fuzzy and exact-matching to align different drug data files.
    • Pricing
    • Generic Equivalents
    • Usage
    • Shortages and availability
  • Patient profiles
    • Demographics
    • Geolocation
  • Prescription data
    • Fills
    • Claims
      • Loss analysis
      • Opportunity analysis
  • Modeling
    • Integrate pharmacy data with TensorFlow
    • Generate large-scale insights
    • Predict the outcomes of new clinical services based on current data
  • Integration
    • Incorporate data from ordering sites, etc.

Project details


Download files

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

Source Distribution

pharmacy-0.4.7.tar.gz (20.0 kB view hashes)

Uploaded Source

Built Distribution

pharmacy-0.4.7-py3-none-any.whl (19.6 kB view hashes)

Uploaded Python 3

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