pdcscore


Namepdcscore JSON
Version 1.1.9 PyPI version JSON
download
home_pagehttps://github.com/famutimine/pdcscore
SummaryA package to facilitate efficient and accurate calculation of the medication adherence metric "Proportion of Days Covered" or "PDC".
upload_time2023-10-10 19:36:08
maintainer
docs_urlNone
authorDaniel Famutimi MD, MPH
requires_python
licenseMIT
keywords pdc calculator medication adherence
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## README.md

The objective of this package is to offer a Python-based solution for computing the Proportion of Days Covered (PDC), a widely used metric in the healthcare industry to evaluate medication adherence. As the healthcare analytics sector shifts away from SAS, there is a growing need to recreate key metrics in alternative platforms. This package aims to simplify the process and reduce the workload for business analysts in the healthcare ecosystem by providing a readily available PDC calculation tool, thereby eliminating the need to build it from scratch.


Please use as described below:

**INPUT PARAMETERS:**

**dataframe** - *A pandas dataframe containing the required columns described below.*

**patient_id_col** - *A unique patient identifier. Format = STRING or INTEGER*

**drugname_col** - *The name of the drug being filled or drug class or Generic name, per usual PDC requirements. Format = STRING*

**filldate_col** - *The date of the fill being dispensed. Format = DATE*

**supply_days_col** - *Days of supply being dispensed at fill. Format = INTEGER*

**msr_start_dt_col** - *start date of measurement period for the patient or a reference START DATE. Format = DATE*

**msr_end_dt_col** - *end date of measurement period for the patient or a reference END DATE. Format = DATE*

**overlap_adjustment** - *Set to True to accommodate early refills, otherwise set to False*



**OUTPUT DATAFRAME** - *A Pandas dataframe containing the following columns*

**patient_id_col** - *This will return a column name representing a unique patient identifier as provided in original input dataframe. FORMAT = STRING*

**drugname_col** - *The name of the drug being filled or drug class or Generic name, as provided in original input dataframe.*

**dayscovered**- *The number of unique days of drug coverage. FORMAT = INTEGER*

**totaldays** - *The total number of days in patient analysis window. Set to 0 if days of coverage is 0. FORMAT = INTEGER*

**pdc_score** - *The patient's PDC score, calculated as dayscovered / totaldays. Set to 0 if days of coverage is 0. FORMAT = FLOAT*



## USAGE EXAMPLE
```python

#  Import required libraries
import pandas as pd
import numpy as np
from datetime import datetime
from pdcscore import pdcCalc

# Create a sample dataframe
df = pd.DataFrame({
    'patient_id': ['A001', 'A001', 'A001', 'B001', 'B001', 'B001', 'C001', 'C001', 'C001','C001', 'C001', 'C001'],
    'drugname': ['DRUG_X', 'DRUG_X', 'DRUG_X', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y',
                    'DRUG_Z', 'DRUG_Z', 'DRUG_Z'],
    'filldate': pd.to_datetime(['2021-10-21', '2022-01-21', '2022-03-20',
                                '2022-01-01', '2022-02-01', '2022-03-01',
                                   '2022-02-18', '2022-03-01', '2022-03-22',
                                   '2021-06-18', '2022-02-11', '2022-03-05']),
    'supply_days': [90, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
    'msr_start_dt': pd.to_datetime(['2022-01-01', '2022-01-01', '2022-01-01',
                                         '2022-01-01', '2022-01-01', '2022-01-01',
                                       '2022-01-01', '2022-01-01', '2022-01-01',
                                       '2022-01-01', '2022-01-01', '2022-01-01']),
    'msr_end_dt': pd.to_datetime(['2022-03-31', '2022-03-31', '2022-03-31',
                                       '2022-03-31', '2022-03-31', '2022-03-31',
                                     '2022-03-31', '2022-03-31', '2022-03-31',
                                     '2022-03-31', '2022-03-31', '2022-03-31'])
})

# Inspect sample data
df.head(n=len(df))

# calculate PDC scores on the input DataFrame
calcfunc = pdcCalc(dataframe=df,patient_id_col='patient_id', drugname_col='drugname', filldate_col='filldate'
                   , supply_days_col='supply_days', msr_start_dt_col='msr_start_dt', msr_end_dt_col='msr_end_dt',overlap_adjustment=True) # Set to True to adjust for early refills
pdc_scores_df = calcfunc.calculate_pdc()

# Inspect output
pdc_scores_df.head()



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/famutimine/pdcscore",
    "name": "pdcscore",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pdc calculator medication adherence",
    "author": "Daniel Famutimi MD, MPH",
    "author_email": "danielfamutimi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2b/e8/483e76e7d2b802f24be4ed3db4837e4fc47e2f7efa15ca324f6015680fc4/pdcscore-1.1.9.tar.gz",
    "platform": null,
    "description": "## README.md\n\nThe objective of this package is to offer a Python-based solution for computing the Proportion of Days Covered (PDC), a widely used metric in the healthcare industry to evaluate medication adherence. As the healthcare analytics sector shifts away from SAS, there is a growing need to recreate key metrics in alternative platforms. This package aims to simplify the process and reduce the workload for business analysts in the healthcare ecosystem by providing a readily available PDC calculation tool, thereby eliminating the need to build it from scratch.\n\n\nPlease use as described below:\n\n**INPUT PARAMETERS:**\n\n**dataframe** - *A pandas dataframe containing the required columns described below.*\n\n**patient_id_col** - *A unique patient identifier. Format = STRING or INTEGER*\n\n**drugname_col** - *The name of the drug being filled or drug class or Generic name, per usual PDC requirements. Format = STRING*\n\n**filldate_col** - *The date of the fill being dispensed. Format = DATE*\n\n**supply_days_col** - *Days of supply being dispensed at fill. Format = INTEGER*\n\n**msr_start_dt_col** - *start date of measurement period for the patient or a reference START DATE. Format = DATE*\n\n**msr_end_dt_col** - *end date of measurement period for the patient or a reference END DATE. Format = DATE*\n\n**overlap_adjustment** - *Set to True to accommodate early refills, otherwise set to False*\n\n\n\n**OUTPUT DATAFRAME** - *A Pandas dataframe containing the following columns*\n\n**patient_id_col** - *This will return a column name representing a unique patient identifier as provided in original input dataframe. FORMAT = STRING*\n\n**drugname_col** - *The name of the drug being filled or drug class or Generic name, as provided in original input dataframe.*\n\n**dayscovered**- *The number of unique days of drug coverage. FORMAT = INTEGER*\n\n**totaldays** - *The total number of days in patient analysis window. Set to 0 if days of coverage is 0. FORMAT = INTEGER*\n\n**pdc_score** - *The patient's PDC score, calculated as dayscovered / totaldays. Set to 0 if days of coverage is 0. FORMAT = FLOAT*\n\n\n\n## USAGE EXAMPLE\n```python\n\n#  Import required libraries\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime\nfrom pdcscore import pdcCalc\n\n# Create a sample dataframe\ndf = pd.DataFrame({\n    'patient_id': ['A001', 'A001', 'A001', 'B001', 'B001', 'B001', 'C001', 'C001', 'C001','C001', 'C001', 'C001'],\n    'drugname': ['DRUG_X', 'DRUG_X', 'DRUG_X', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y', 'DRUG_Y',\n                    'DRUG_Z', 'DRUG_Z', 'DRUG_Z'],\n    'filldate': pd.to_datetime(['2021-10-21', '2022-01-21', '2022-03-20',\n                                '2022-01-01', '2022-02-01', '2022-03-01',\n                                   '2022-02-18', '2022-03-01', '2022-03-22',\n                                   '2021-06-18', '2022-02-11', '2022-03-05']),\n    'supply_days': [90, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n    'msr_start_dt': pd.to_datetime(['2022-01-01', '2022-01-01', '2022-01-01',\n                                         '2022-01-01', '2022-01-01', '2022-01-01',\n                                       '2022-01-01', '2022-01-01', '2022-01-01',\n                                       '2022-01-01', '2022-01-01', '2022-01-01']),\n    'msr_end_dt': pd.to_datetime(['2022-03-31', '2022-03-31', '2022-03-31',\n                                       '2022-03-31', '2022-03-31', '2022-03-31',\n                                     '2022-03-31', '2022-03-31', '2022-03-31',\n                                     '2022-03-31', '2022-03-31', '2022-03-31'])\n})\n\n# Inspect sample data\ndf.head(n=len(df))\n\n# calculate PDC scores on the input DataFrame\ncalcfunc = pdcCalc(dataframe=df,patient_id_col='patient_id', drugname_col='drugname', filldate_col='filldate'\n                   , supply_days_col='supply_days', msr_start_dt_col='msr_start_dt', msr_end_dt_col='msr_end_dt',overlap_adjustment=True) # Set to True to adjust for early refills\npdc_scores_df = calcfunc.calculate_pdc()\n\n# Inspect output\npdc_scores_df.head()\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package to facilitate efficient and accurate calculation of the medication adherence metric \"Proportion of Days Covered\" or \"PDC\".",
    "version": "1.1.9",
    "project_urls": {
        "Homepage": "https://github.com/famutimine/pdcscore"
    },
    "split_keywords": [
        "pdc",
        "calculator",
        "medication",
        "adherence"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b1e10fa83834398ee2cde22d035dd405641e4e03dd958089647e7654f5319e1",
                "md5": "8f1d2bb9b0b0bfab88e5d115a0b5c5a0",
                "sha256": "3ab354b26678a19f4b954701718f9c0efa7f756f81e7191717973bfe389731be"
            },
            "downloads": -1,
            "filename": "pdcscore-1.1.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f1d2bb9b0b0bfab88e5d115a0b5c5a0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4843,
            "upload_time": "2023-10-10T19:36:06",
            "upload_time_iso_8601": "2023-10-10T19:36:06.987925Z",
            "url": "https://files.pythonhosted.org/packages/7b/1e/10fa83834398ee2cde22d035dd405641e4e03dd958089647e7654f5319e1/pdcscore-1.1.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2be8483e76e7d2b802f24be4ed3db4837e4fc47e2f7efa15ca324f6015680fc4",
                "md5": "08af8af0b890eb7bac213da7bc2ad9ae",
                "sha256": "d86c19521892df41fc6d8a3ea681c8e8b47e29024c512de8e6907cc4ad32a3b6"
            },
            "downloads": -1,
            "filename": "pdcscore-1.1.9.tar.gz",
            "has_sig": false,
            "md5_digest": "08af8af0b890eb7bac213da7bc2ad9ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4587,
            "upload_time": "2023-10-10T19:36:08",
            "upload_time_iso_8601": "2023-10-10T19:36:08.747902Z",
            "url": "https://files.pythonhosted.org/packages/2b/e8/483e76e7d2b802f24be4ed3db4837e4fc47e2f7efa15ca324f6015680fc4/pdcscore-1.1.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-10 19:36:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "famutimine",
    "github_project": "pdcscore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pdcscore"
}
        
Elapsed time: 0.12511s