Skip to content

andrewallenbruce/provider

Repository files navigation

provider provider website

Tidy Healthcare Provider API Interface

Ask DeepWiki zread Codecov test coverage CodeFactor code size

You can install provider from GitHub with:

# install.packages("pak")
pak::pak("andrewallenbruce/provider")

Overview

The provider package is a high-level interface designed to streamline access to publicly available healthcare provider data from the Centers for Medicare and Medicaid Services (CMS) and other federal sources. It provides a unified, tidy framework for querying complex datasets that are essential for medical coding, billing, and healthcare revenue cycle management.

The provider package is a technical interface for accessing publicly available healthcare provider data from the Centers for Medicare and Medicaid Services (CMS) and the Health Resources and Services Administration (HRSA). It provides a unified, tidy API for querying complex datasets such as the NPPES NPI Registry, PECOS enrollment data, and hospital transparency records.

Purpose & Scope

Navigating the healthcare data ecosystem often involves disparate APIs with inconsistent field names and data structures. provider abstracts these complexities into a consistent set of R functions that return “tidy” data frames.

The package targets several key data domains:

  • Individual Providers: Clinician demographics, enrollments, and opt-out affidavits
  • Organizational Providers: Hospital data, CLIA labs, and Rural Health Clinics (RHC)
  • Compliance & Sanctions: Medicare revocations and hospital price transparency enforcement
  • General Registry: NPPES NPI registry and reassignment of benefits

🚀 Basic Usage Patterns

Most functions in provider follow a similar pattern: they accept identifiers (like an npi) or search criteria (like an org_name) and return a tibble.

Query Modifiers

provider supports query modifiers for more precise filtering. These are implemented as Modifier S7 classes

library(provider)

🏢 Facility Affiliations

affiliations(facility_ccn = 110122)
✔ affiliations returned 397 results.
# A tibble: 397 × 9
   first  last  middle suffix    npi pac   facility_type facility_ccn parent_ccn
 * <chr>  <chr> <chr>  <chr>   <int> <chr> <chr>         <chr>        <chr>     
 1 JEREMY COLYSTEPH<NA>   1.00e9 1254Hospital      110122       <NA>      
 2 COLE   BURG<NA>   <NA>   1.00e9 1850Hospital      110122       <NA>      
 3 VIVEK  YADAV <NA>   <NA>   1.00e9 2365Hospital      110122       <NA>      
 4 FELIX  VALDG      <NA>   1.02e9 2860Hospital      110122       <NA>      
 5 STEPHFOX   G      <NA>   1.02e9 5698Hospital      110122       <NA>      
 6 ERIC   STIECHRIS<NA>   1.02e9 5799Hospital      110122       <NA>      
 7 ROBERT BENND      <NA>   1.02e9 1759Hospital      110122       <NA>      
 8 NATHAN ROBEKELLY  <NA>   1.02e9 6507Hospital      110122       <NA>      
 9 WILLIMULLTHOMAS JR.    1.02e9 8527Hospital      110122       <NA>      
10 RACHEL ARMSKATHL<NA>   1.03e9 7113Hospital      110122       <NA>      
# ℹ 387 more rows

🤝 Reassignment of Benefits

reassignments(
  org_name = starts("SGMC"),
  state = "GA")
✔ reassignments returned 210 results.
# A tibble: 210 × 14
   first   last  state specialty employers    npi pac   enid  org_name employees
 * <chr>   <chr> <chr> <chr>         <int>  <int> <chr> <chr> <chr>        <int>
 1 Carter  Adams GA    Nurse Pr2 1.50e9 8628I202Sgmc Af49
 2 Jessica AlfeGA    Nurse Pr9 1.24e9 7416I201Sgmc Af49
 3 Ginger  AmbrGA    Nurse Pr2 1.88e9 3779I202Sgmc Af49
 4 Grant   BarkGA    Emergenc2 1.48e9 4082I202Sgmc Af49
 5 Stacy   Beck  GA    Nurse Pr3 1.73e9 4385I201Sgmc Af49
 6 Lila    BennGA    Nurse Pr3 1.93e9 5991I201Sgmc Af49
 7 MargarCartGA    Nurse Pr8 1.24e9 6507I201Sgmc Af49
 8 Clayton CharGA    Hospital4 1.08e9 6204I201Sgmc Af49
 9 MichelCharGA    Nurse Pr3 1.44e9 4183I201Sgmc Af49
10 Hunter  ClanGA    Nurse Pr4 1.45e9 9032I202Sgmc Af49
# ℹ 200 more rows
# ℹ 4 more variables: org_pac <chr>, org_enid <chr>, org_state <chr>,
#   rec_type <chr>

👎 Revoked Medicare Providers

revocations(state = "GA")
✔ revocations returned 213 results.
# A tibble: 213 × 12
   org_name first    middle last       enid     npi multi state prov_desc reason
 * <chr>    <chr>    <chr>  <chr>      <chr>  <int> <int> <chr> <chr>     <chr> 
 1 <NA>     WALLACE  S      ANDERSON   I2001.88e9     0 GA    PRACTITI424.52 <NA>     LEO      G      FRANGIPANE I2001.07e9     0 GA    PRACTITI424.53 <NA>     ANTHONY  D      MILLS      I2001.27e9     0 GA    PRACTITI424.54 <NA>     JEFFREY  M.     GALLUPS    I2001.85e9     0 GA    PRACTITI424.55 <NA>     CURTIS   <NA>   CHEEKS     I2001.53e9     0 GA    PRACTITI424.56 <NA>     ZAVIER   C      ASH        I2001.77e9     0 GA    PRACTITI424.57 <NA>     SHAWN    E      TYWON      I2001.68e9     0 GA    PRACTITI424.58 <NA>     ANAND    P      LALAJI     I2001.65e9     0 GA    PRACTITI424.59 <NA>     TIFFANNI D      FORBES     I2001.21e9     0 GA    PRACTITI424.510 <NA>     STEPHEN  T      BASHUK     I2001.95e9     0 GA    PRACTITI424.5# ℹ 203 more rows
# ℹ 2 more variables: start_date <date>, end_date <date>

🪪 Clinician Demographics

clinicians(
  org_name = starts("SGMC"),
  org_state = "GA")
✔ clinicians returned 167 results.
# A tibble: 167 × 21
   first    middle last    suffix gender cred  school grad_year specialty    npi
 * <chr>    <chr>  <chr>   <chr>  <chr>  <chr> <chr>      <int> <chr>      <int>
 1 MANDY    <NA>   LUCAS   <NA>   F      <NA>  MEHAR2011 FAMILY P1.35e9
 2 BHUMIBEN KUSHAL PATEL   <NA>   F      NP    OTHER       2018 NURSE PR1.47e9
 3 WILLIAM  <NA>   NASH    <NA>   M      MD    MEDIC1992 FAMILY P1.24e9
 4 VERA     C      GARCIA  <NA>   M      MD    OTHER       1991 FAMILY P1.15e9
 5 ALBERTO  E      GARCIA  <NA>   M      MD    OTHER       1996 FAMILY P1.52e9
 6 JULENE   D      SMITH   <NA>   F      NP    OTHER       2015 NURSE PR1.08e9
 7 KASSI    LAITEN COPELA<NA>   F      <NA>  OTHER       2025 NURSE PR1.16e9
 8 JYNGER   MORRIS HULING  <NA>   F      <NA>  OTHER       2003 MENTAL H1.35e9
 9 WENDY    <NA>   VANDEM<NA>   F      MD    NORTH2000 PSYCHIAT1.39e9
10 MYRA     <NA>   JORDAN  <NA>   F      <NA>  OTHER       2004 MARRIAGE1.46e9
# ℹ 157 more rows
# ℹ 11 more variables: pac <chr>, enid <chr>, org_name <chr>, org_pac <chr>,
#   org_mem <int>, org_city <chr>, org_state <chr>, org_zip <chr>,
#   org_phone <chr>, org_add <chr>, specialty <chr>
📤 Opt-Out Affidavits
opt_out(
  first = starts("B"),
  specialty = starts("Oral"))
✔ opt_out returned 214 results.
# A tibble: 214 × 12
          npi first last  specialty start_date end_date   updated    city  state
 *      <int> <chr> <chr> <chr>     <date>     <date>     <date>     <chr> <chr>
 1 1689981722 Byron Capps Oral And2025-10-27 2027-10-27 2026-01-15 GREENC   
 2 1295740603 Brian PickOral Sur2012-03-23 2028-03-23 2026-04-16 COLOCO   
 3 1164493581 Brian WilkOral Sur2012-05-10 2026-05-10 2024-06-15 LAWRKS   
 4 1114910668 BernKrupp Oral Sur2012-07-01 2026-07-01 2024-08-15 TOWSMD   
 5 1376656900 Brian ReigOral Sur2006-07-07 2026-07-07 2024-08-15 SPRIPA   
 6 1255308789 Brian Camp  Oral Sur2012-05-29 2026-05-29 2024-06-15 RALENC   
 7 1780603688 Byron Henry Oral Sur2012-07-09 2026-07-09 2024-08-15 WORTOH   
 8 1760438410 Barry CoopOral Sur2012-07-22 2026-07-22 2024-08-15 HEWLNY   
 9 1730114950 Bob   OneiOral Sur2012-08-16 2026-08-16 2024-09-15 CHESVA   
10 1932137825 BradTrotOral Sur2017-02-09 2027-02-09 2025-03-17 HAMPVA   
# ℹ 204 more rows
# ℹ 3 more variables: zip <chr>, order_refer <int>, address <chr>
🧾 Order & Referral Eligibility
order_refer(
  first = contains("LESS"),
  ptb = TRUE,
  hospice = FALSE,
  hha = FALSE)
✔ order_refer returned 38 results.
# A tibble: 38 × 8
   first       last                  npi   ptb   dme   hha   pmd hospice
 * <chr>       <chr>               <int> <int> <int> <int> <int>   <int>
 1 ALESSANDRA  ALTOVINO       1518559350     1     1     0     0       0
 2 VELESSAUNIA BRIDGES-WILSON 1649501503     1     1     0     0       0
 3 ALESSANDRA  CALHOUN        1730412420     1     1     0     0       0
 4 ALESSANDRA  CARUSO         1790206852     1     1     0     0       0
 5 ALESSANDRA  CARVALHO       1851178206     1     1     0     0       0
 6 BLESSY      CHACKO         1659024842     1     1     0     0       0
 7 BLESSING    CHINEDUOBI     1205255106     1     1     0     0       0
 8 ALESSANDRA  CITRO          1639875172     1     1     0     0       0
 9 MELESSA     DILLINGHAM     1992341721     1     1     0     0       0
10 ARLESS      DODSON         1346520582     1     1     0     0       0
# ℹ 28 more rows
🧑‍⚕️ Medicare Enrollments
providers(
  org_name = starts("SGMC"),
  state = "GA")
✔ providers returned 2 results.
# A tibble: 2 × 11
  org_name first middle last  state prov_type prov_desc    npi multi pac   enid 
* <chr>    <chr> <chr>  <chr> <chr> <chr>     <chr>      <int> <int> <chr> <chr>
1 SGMC PH<NA>  <NA>   <NA>  GA    12-70     PART B S1.42e9     0 4082O2022 SGMC AF<NA>  <NA>   <NA>  GA    12-70     PART B S1.11e9     0 5496O202
📆 Pending Enrollments
pending(
  first = contains("A"),
  last = ends("E"))
✔ pending returned 551 results.Physician     : 176Non-Physician : 375
# A tibble: 551 × 4
   prov_type first     last                npi
 * <chr>     <chr>     <chr>             <int>
 1 Physician BABATUNDE ADESEYE      1558204693
 2 Physician MELISSA   ALDRIDGE     1073132429
 3 Physician MIA       ALDRIDGE     1437890761
 4 Physician ETHAN     ANGLE        1821939810
 5 Physician SOCHIMA   ANIKE        1265019822
 6 Physician HARLEY    ARRAUT-WHITE 1548906621
 7 Physician JUAN      ARROYAVE     1104766104
 8 Physician MARIAM    ATOBILOYE    1992405476
 9 Physician ADESEYE   AWE          1942796479
10 Physician KALENE    BADREE       1578405635
# ℹ 541 more rows
🏥 Medicare Hospitals
hospitals(ccn = "110122")
✔ hospitals returned 1 result.
🧪 CLIA Laboratories
clia(
  facility_name = starts("SGMC"),
  state = "GA")
✔ clia returned 32 results.
# A tibble: 32 × 61
   facility_ccn parent_ccn xref_ccn shared_ccn mac   chown chow_date poc_ind
 * <chr>        <chr>      <chr>    <chr>      <chr> <chr> <date>      <int>
 1 11D0022233   110122     <NA>     <NA>       <NA>  0     NA              0
 2 11D0022241   110037     <NA>     <NA>       <NA>  0     NA              0
 3 11D0265511   <NA>       <NA>     <NA>       <NA>  0     NA              0
 4 11D0265607   258589220A <NA>     <NA>       <NA>  0     NA              0
 5 11D0265646   110097     <NA>     <NA>       <NA>  0     NA              0
 6 11D0265664   11-0112    <NA>     <NA>       <NA>  0     NA              0
 7 11D0699064   256864445D <NA>     <NA>       <NA>  0     NA              0
 8 11D0915865   <NA>       <NA>     <NA>       <NA>  0     NA              0
 9 11D0933615   <NA>       <NA>     <NA>       <NA>  0     NA              0
10 11D0948594   <NA>       <NA>     <NA>       <NA>  0     NA              0
# ℹ 22 more rows
# ℹ 53 more variables: compliant <chr>, city <chr>, state <chr>, zip <chr>,
#   elig_ind <int>, term_pgm <chr>, term_clia <chr>, app_type <chr>,
#   cert_type <chr>, fac_type <chr>, own_type <chr>, act_type <chr>,
#   orig_date <date>, app_date <date>, cert_date <date>, eff_date <date>,
#   mail_date <date>, term_date <date>, a2la_date <date>, a2la_ind <int>,
#   aabb_date <date>, aabb_ind <int>, aoa_date <date>, aoa_ind <int>, …
🔎 Hospital Transparency Enforcement
transparency(
  action = "closure", 
  state = "WA")
✔ transparency returned 39 results.
# A tibble: 39 × 7
    case name                             address city  state action action_date
 * <int> <chr>                            <chr>   <chr> <chr> <chr>  <date>     
 1  1291 Arbor Health Morton Hospital     521 AdMortWA    Closu2023-04-13 
 2  2248 Arbor Health Morton Hospital     521 AdMortWA    Closu2024-05-30 
 3  2849 Astria Toppenish Hospital        502 WToppWA    Closu2024-12-30 
 4  6638 Cascade Medical Center           817 CoLeavWA    Closu2025-12-18 
 5  4578 CHI Franciscan Rehabilitation H815 STacoWA    Closu2025-08-25 
 6  6707 Columbia Basin Hospital          200 NaEphrWA    Closu2026-01-12 
 7  6717 Coulee Medical Center            411 FoGranWA    Closu2025-12-30 
 8  6731 Dayton General Hospital          1012 SDaytWA    Closu2025-12-01 
 9   866 East Adams Rural Healthcare      903 SRitzWA    Closu2024-02-29 
10  6191 EvergreenHealth Kirkland         12040KirkWA    Closu2025-12-19 
# ℹ 29 more rows

⚖️ Code of Conduct

Please note that the provider project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

🏛️ Governance

This project is primarily maintained by Andrew Bruce. Other authors may occasionally assist with some of these duties.

About

Public Healthcare Provider APIs 🩺

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors