From 05088e736172351b9fcbe72f07f41545943e8e00 Mon Sep 17 00:00:00 2001 From: Andrew Bruce Date: Sun, 5 Nov 2023 03:12:09 -0500 Subject: [PATCH] cleanup part deux --- R/globals.R | 10 +++++----- man/ndc_lookup.Rd | 16 +++++++++++++++- man/open_payments.Rd | 2 +- man/opt_out.Rd | 2 +- vignettes/articles/partb-stats.Rmd | 16 +++++++++++++++- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/R/globals.R b/R/globals.R index 85e5ad96..786fbe0f 100644 --- a/R/globals.R +++ b/R/globals.R @@ -7,6 +7,11 @@ utils::globalVariables(c( "y", # "y", # "rbcs_major_ind", # + "hcpcs", # + "category", # + "subcategory", # + "family", # + "procedure", # "copy", # ":=", # "lg", # @@ -197,11 +202,6 @@ utils::globalVariables(c( "address", # "specialty", # "place_of_srvc", # - "hcpcs", # - "category", # - "subcategory", # - "family", # - "procedure", # "title", # "modified", # "distribution", # diff --git a/man/ndc_lookup.Rd b/man/ndc_lookup.Rd index 57af7ac7..ed1cfdf2 100644 --- a/man/ndc_lookup.Rd +++ b/man/ndc_lookup.Rd @@ -10,7 +10,21 @@ ndc_lookup(ndc) \item{ndc}{< \emph{character} > // \strong{required} 10- to 11-digit National Drug Code} } \value{ -A \link[tibble:tibble-package]{tibble} with the columns: +A \link[tibble:tibble-package]{tibble} with the columns:\tabular{ll}{ + \strong{Field} \tab \strong{Description} \cr + \code{ndc} \tab National Drug Code \cr + \code{rxcui} \tab RxNorm Identifier \cr + \code{atc} \tab ATC Identifier \cr + \code{status} \tab Status (NDC) \cr + \code{brand_name} \tab Brand Name (RxCUI) \cr + \code{drug_name} \tab Drug Name (RxCUI) \cr + \code{atc_first} \tab ATC I: Anatomical, Pharmacological \cr + \code{atc_first} \tab ATC II: Pharmacological, Therapeutic \cr + \code{atc_first} \tab ATC III: Chemical, Pharmacological, Therapeutic \cr + \code{atc_first} \tab ATC IV: Chemical, Pharmacological, Therapeutic \cr + \code{subject} \tab Medline Plus: Subject \cr + \code{summary} \tab Medline Plus: Summary \cr +} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} diff --git a/man/open_payments.Rd b/man/open_payments.Rd index 925e92dc..de43344b 100644 --- a/man/open_payments.Rd +++ b/man/open_payments.Rd @@ -203,7 +203,7 @@ open_payments(year = 2021, pay_form = "Stock option") open_payments(year = 2021, payer = "Adaptive Biotechnologies Corporation") open_payments(year = 2021, teaching_hospital = "Nyu Langone Hospitals") -# Use the years helper function to retrieve results for all avaliable years: +# Use the years helper function to retrieve results for all available years: open_years() |> map(\(x) open_payments(year = x, npi = 1043477615)) |> list_rbind() diff --git a/man/opt_out.Rd b/man/opt_out.Rd index 79dbd555..1f545621 100644 --- a/man/opt_out.Rd +++ b/man/opt_out.Rd @@ -103,9 +103,9 @@ fee-for-service (Part B). } \examples{ +\dontshow{if ( interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} opt_out(npi = 1043522824) -\dontshow{if ( interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # For opt-out providers eligible # to order and refer, use [order_refer()] # to look up their eligibility status: diff --git a/vignettes/articles/partb-stats.Rmd b/vignettes/articles/partb-stats.Rmd index 647cb76e..73bcf5bb 100644 --- a/vignettes/articles/partb-stats.Rmd +++ b/vignettes/articles/partb-stats.Rmd @@ -26,6 +26,7 @@ library(tidyr) library(dplyr) library(purrr) library(furrr) +library(ggplot2) library(gt) library(gtExtras) ``` @@ -53,12 +54,25 @@ plan(sequential) ## Overall Performance ```{r} -ind |> +performance <- ind |> unnest(performance) |> + mutate(year = as.integer(year)) |> select(year, tot_hcpcs:.pymt_per_srvc) +performance ``` +```{r} +lm.performance <- lm(tot_payment ~ .srvcs_per_bene + tot_benes + .pymt_per_srvc, data = performance) +summary(lm.performance) +``` + + +```{r} +ggplot(performance, aes(x = tot_payment, y = .srvcs_per_bene, fill = year, group = year)) + + geom_point(shape = 21, size = 4, alpha = 0.75) + + theme_minimal() +``` ```{r}