Skip to main content

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.

Output: pandas DataFrame. All rows from df_orig are kept and their corresponding matches are tacked onto the end if they meet the match threshold.

import pharmacy as rx
import pandas as pd

df_out = rx.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.

Metadata

Release files for pharmacy 0.4.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pharmacy 0.4.9
File Size Uploaded Provenance
pharmacy-0.4.9.tar.gz 20.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pharmacy 0.4.9
File Interpreter ABI Platform
pharmacy-0.4.9-py3-none-any.whl Python 3 none any Details

Total release size: 39.7 kB

Release files / pharmacy-0.4.9.tar.gz

Download URL pharmacy-0.4.9.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5c47723cafb11f706ed598c10daecb86bddc0dcaf2f535b074484052ed360e32
BLAKE2b-256 checksum
How to use checksums
8467a19554bfe73121832a70cb66ccba4a98c6a09c99b17fd7d961d14bdf1b49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.8.5 Windows/10

Release files / pharmacy-0.4.9-py3-none-any.whl

Download URL pharmacy-0.4.9-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ca0c86499404617d66623abd660652ccfdb398ada0978c317f88b7eb7875b4e
BLAKE2b-256 checksum
How to use checksums
fbf07ca47737e59bbdcf84cecf1afc5956844434f407e853fff11afc7fee73de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.8.5 Windows/10

Security for pharmacy 0.4.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page