Skip to content

Commit

Permalink
* removed lifecycle as a dependency
Browse files Browse the repository at this point in the history
* quality payment rewrite
  • Loading branch information
andrewallenbruce committed Dec 9, 2024
1 parent 5e513f6 commit 72d8c20
Show file tree
Hide file tree
Showing 51 changed files with 1,091 additions and 311 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ Imports:
furrr,
httr2,
janitor,
lifecycle,
fs,
kit,
pins,
lubridate,
purrr,
rlang (>= 1.1.0),
Expand Down
12 changes: 11 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export(distros_open)
export(duration_vec)
export(gen_data)
export(geomean)
export(get_pin)
export(gt_check_xmark)
export(gt_datadict)
export(gt_entype_badge)
Expand All @@ -26,8 +27,10 @@ export(gt_qmark)
export(hospitals)
export(laboratories)
export(last_dttm)
export(list_pins)
export(make_interval)
export(medline)
export(mount_board)
export(ndc_lookup)
export(nppes)
export(open_payments)
Expand All @@ -45,30 +48,37 @@ export(providers)
export(qpp_years)
export(quality_eligibility)
export(quality_eligibility_)
export(quality_pay2)
export(quality_payment)
export(quality_payment_)
export(reassignments)
export(ror)
export(rx_years)
export(rxnorm)
export(sfcc)
export(summary_stats)
export(taxonomy_crosswalk)
export(tidyup)
export(util_years)
export(utilization)
export(utilization_)
export(years_df)
export(years_floor)
export(years_vec)
import(rlang)
importFrom(collapse,"%=%")
importFrom(collapse,"%==%")
importFrom(collapse,.c)
importFrom(collapse,fselect)
importFrom(collapse,get_elem)
importFrom(httr2,req_perform)
importFrom(httr2,req_perform_parallel)
importFrom(httr2,request)
importFrom(httr2,resp_body_json)
importFrom(httr2,resp_date)
importFrom(httr2,resp_header)
importFrom(httr2,resp_headers)
importFrom(lifecycle,deprecated)
importFrom(purrr,map)
importFrom(stats,setNames)
importFrom(stringi,"%s+%")
importFrom(zeallot,"%<-%")
38 changes: 17 additions & 21 deletions R/add_counties.R
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
#' Add county name, FIPs, and geometry to data frame with zip codes
#'
#' @param df data frame
#'
#' @param statecol bare column name column containing state abbreviations
#'
#' @param zipcol bare column name containing zip codes
#'
#' @param add_fips add county FIPS code column, default is `FALSE`
#'
#' @param add_geo add county geometry column, default is `FALSE`
#'
#' @param as_sf convert tibble to an `{sf}` object, default is `FALSE`
#'
#' @examplesIf interactive()
#' @examples
#' # Example data frame containing
#' # state abbreviation and zip code
#'
#' # Example data frame containing state abbreviation and zip code
#' ex <- dplyr::tibble(state = "GA",
#' zip = "31605")
#' ex
#' (ex <- dplyr::tibble(state = "GA", zip = "31605"))
#'
#' # Adds county name and latitude/longitude
#' # Add county and latitude/longitude
#' ex |> add_counties(state, zip)
#'
#' # Adds county FIPS
#' ex |> add_counties(state,
#' zip,
#' add_fips = TRUE)
#' # Add county FIPS
#' ex |> add_counties(state, zip, add_fips = TRUE)
#'
#' # Adds county `geometry` column,
#' # Add county `geometry` column,
#' # based on county FIPS column
#' ex |> add_counties(state,
#' zip,
#' add_fips = TRUE,
#' add_geo = TRUE)
#' ex |> add_counties(state, zip, add_fips = TRUE, add_geo = TRUE)
#'
#' # Converts data frame to an `sf` object
#' ex |> add_counties(state,
#' zip,
#' add_fips = TRUE,
#' add_geo = TRUE,
#' as_sf = TRUE)
#' # Convert to an `sf` object
#' ex |> add_counties(state, zip, add_fips = TRUE, add_geo = TRUE, as_sf = TRUE)
#'
#' @autoglobal
#' @export
Expand Down
5 changes: 1 addition & 4 deletions R/beneficiaries.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#' Beneficiary Enrollment in Medicare
#'
#' @description
#' `r lifecycle::badge("questioning")`
#'
#' [beneficiaries()] allows the user access current data on enrolled Medicare
#' beneficiaries.
#' Access current data on enrolled Medicare beneficiaries.
#'
#' @section Medicare Monthly Enrollment:
#' Current monthly information on the number of Medicare beneficiaries with
Expand Down
7 changes: 2 additions & 5 deletions R/betos.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#' Restructured BETOS Classification for HCPCS
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' [betos()] allows the user to group HCPCS codes into clinically
#' meaningful categories based on the original _Berenson-Eggers Type of Service_
#' (BETOS) classification.
#' Group HCPCS codes into clinically meaningful categories based on the
#' original _Berenson-Eggers Type of Service_ (BETOS) classification.
#'
#' @section From BETOS to RBCS:
#'
Expand Down
102 changes: 60 additions & 42 deletions R/clinicians.R
Original file line number Diff line number Diff line change
@@ -1,74 +1,92 @@
#' Clinicians Enrolled in Medicare
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' [clinicians()] allows you to access information about providers enrolled in
#' Medicare, including the medical school that they attended and the year they graduated
#' @description Access information about providers enrolled in Medicare,
#' including the medical school that they attended and the year they graduated
#'
#' *Update Frequency:* **Monthly**
#'
#' @section Links:
#' + [National Downloadable File](https://data.cms.gov/provider-data/dataset/mj5m-pzi6)
#' + [Provider Data Catalog (PDC) Data Dictionary](https://data.cms.gov/provider-data/sites/default/files/data_dictionaries/physician/DOC_Data_Dictionary.pdf)
#'
#' * [National Downloadable File](https://data.cms.gov/provider-data/dataset/mj5m-pzi6)
#' * [Provider Data Catalog (PDC) Data Dictionary](https://data.cms.gov/provider-data/sites/default/files/data_dictionaries/physician/DOC_Data_Dictionary.pdf)
#'
#' @param npi < *integer* > 10-digit Individual National Provider Identifier
#'
#' @param pac < *integer* > 10-digit Individual PECOS Associate Control ID
#'
#' @param enid < *character* > 15-digit Individual Medicare Enrollment ID
#'
#' @param first,middle,last < *character* > Individual provider's name
#' @param gender < *character* > Individual provider's gender; `"F"` (Female)
#' or `"M"` (Male)
#'
#' @param gender < *character* > Individual provider's gender; `"F"` (Female) or
#' `"M"` (Male)
#'
#' @param credential Individual provider’s credential
#'
#' @param school < *character* > Individual provider’s medical school
#'
#' @param grad_year < *integer* > Individual provider’s graduation year
#'
#' @param specialty < *character* > Individual provider’s primary medical
#' specialty reported in the selected enrollment
#' specialty reported in the selected enrollment
#'
#' @param facility_name < *character* > Name of facility associated with the
#' individual provider
#' @param pac_org < *integer* > 10-digit Organizational PECOS
#' Associate Control ID
#' individual provider
#'
#' @param pac_org < *integer* > 10-digit Organizational PECOS Associate Control
#' ID
#'
#' @param city < *character* > Provider's city
#'
#' @param state < *character* > Provider's state
#'
#' @param zip < *character* > Provider's ZIP code
#'
#' @param offset < *integer* > // __default:__ `0L` API pagination
#'
#' @param tidy < *boolean* > // __default:__ `TRUE` Tidy output
#' @param na.rm < *boolean* > // __default:__ `TRUE` Remove empty rows and columns
#'
#' @param na.rm < *boolean* > // __default:__ `TRUE` Remove empty rows and
#' columns
#'
#' @param ... Empty
#'
#' @return A [tibble][tibble::tibble-package] with the columns:
#'
#' |**Field** |**Description** |
#' |:---------------|:-----------------------------------------------------|
#' |`npi` |10-digit individual NPI |
#' |`pac` |10-digit individual PAC ID |
#' |`enid` |15-digit individual enrollment ID |
#' |`first` |Provider's first name |
#' |`middle` |Provider's middle name |
#' |`last` |Provider's last name |
#' |`suffix` |Provider's name suffix |
#' |`gender` |Provider's gender |
#' |`credential` |Provider's credential |
#' |`school` |Provider's medical school |
#' |`grad_year` |Provider's graduation year |
#' |`specialty` |Provider's primary specialty |
#' |`specialty_sec` |Provider's secondary specialty |
#' |`facility_name` |Facility associated with provider |
#' |`pac_org` |Facility's 10-digit PAC ID |
#' |`members` |Number of providers associated with facility's PAC ID |
#' |`address` |Provider's street address |
#' |`city` |Provider's city |
#' |`state` |Provider's state |
#' |`zip` |Provider's zip code |
#' |`phone` |Provider's phone number |
#' |`telehealth` |Indicates if provider offers telehealth services |
#' |`assign_ind` |Indicates if provider accepts Medicare assignment |
#' |`assign_org` |Indicates if facility accepts Medicare assignment |
#' @returns A [tibble][tibble::tibble-package] with the columns:
#'
#' |**Field** |**Description** |
#' |:---------------|:-----------------------------------------------------|
#' |`npi` |10-digit individual NPI |
#' |`pac` |10-digit individual PAC ID |
#' |`enid` |15-digit individual enrollment ID |
#' |`first` |Provider's first name |
#' |`middle` |Provider's middle name |
#' |`last` |Provider's last name |
#' |`suffix` |Provider's name suffix |
#' |`gender` |Provider's gender |
#' |`credential` |Provider's credential |
#' |`school` |Provider's medical school |
#' |`grad_year` |Provider's graduation year |
#' |`specialty` |Provider's primary specialty |
#' |`specialty_sec` |Provider's secondary specialty |
#' |`facility_name` |Facility associated with provider |
#' |`pac_org` |Facility's 10-digit PAC ID |
#' |`members` |Number of providers associated with facility's PAC ID |
#' |`address` |Provider's street address |
#' |`city` |Provider's city |
#' |`state` |Provider's state |
#' |`zip` |Provider's zip code |
#' |`phone` |Provider's phone number |
#' |`telehealth` |Indicates if provider offers telehealth services |
#' |`assign_ind` |Indicates if provider accepts Medicare assignment |
#' |`assign_org` |Indicates if facility accepts Medicare assignment |
#'
#' @examplesIf interactive()
#' clinicians(enid = "I20081002000549") # enid not working
#'
#' clinicians(school = "NEW YORK UNIVERSITY SCHOOL OF MEDICINE")
#'
#' @autoglobal
#'
#' @export
clinicians <- function(npi = NULL,
pac = NULL,
Expand Down
11 changes: 11 additions & 0 deletions R/generated-globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ utils::globalVariables(c(
# <laboratories>
"cap",
# <rbcs_util>
# <quality_pay2>
# <quality_payment>
"category",
# <open_payments>
Expand Down Expand Up @@ -174,6 +175,7 @@ utils::globalVariables(c(
"distribution_title",
# <outpatient>
# <prescribers>
# <quality_pay2>
# <quality_payment>
# <utilization>
"distro",
Expand Down Expand Up @@ -287,13 +289,15 @@ utils::globalVariables(c(
"npi_type",
# <nppes>
"on",
# <quality_pay2>
# <quality_payment>
"org_id",
# <quality_eligibility>
# <cols_qelig>
"org_name",
# <mips_2021>
"org_pac_id",
# <quality_pay2>
# <quality_payment>
"org_size",
# <quality_eligibility>
Expand All @@ -310,6 +314,7 @@ utils::globalVariables(c(
"organizations_individualScenario",
# <quality_eligibility>
"organizations_virtualGroups",
# <quality_pay2>
# <quality_payment>
"participation_type",
# <mips_2021>
Expand Down Expand Up @@ -347,6 +352,7 @@ utils::globalVariables(c(
"prvdr_ctgry_sbtyp_cd",
# <nppes>
"purpose",
# <quality_pay2>
# <quality_payment>
"qualified",
# <betos>
Expand All @@ -361,9 +367,11 @@ utils::globalVariables(c(
"rndrng_prvdr_geo_desc",
# <tidyup_geography.util>
"rndrng_prvdr_geo_lvl",
# <quality_pay2>
# <quality_payment>
"score",
# <open_ids>
# <quality_pay2>
# <quality_payment>
"set",
# <tidyup_provider.util>
Expand Down Expand Up @@ -396,6 +404,7 @@ utils::globalVariables(c(
"state_of_travel",
# <nppes>
# <order_refer>
# <quality_pay2>
# <quality_payment>
"status",
# <rbcs_util>
Expand Down Expand Up @@ -440,6 +449,7 @@ utils::globalVariables(c(
"type_1",
# <laboratories>
"type_of_action",
# <quality_pay2>
# <quality_payment>
"val",
# <open_payments>
Expand All @@ -466,6 +476,7 @@ utils::globalVariables(c(
# <prescribers>
# <providers>
# <quality_eligibility>
# <quality_pay2>
# <quality_payment>
# <reassignments>
# <taxonomy_crosswalk>
Expand Down
Loading

0 comments on commit 72d8c20

Please sign in to comment.