diff --git a/NAMESPACE b/NAMESPACE index abf16d9..8a2bf76 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,6 +5,7 @@ export(assign_adjustments) export(calculate_amounts) export(carc_add_dash) export(data_dict) +export(get_example) export(get_pin) export(gt_theme_northstar) export(is_category_I) @@ -26,6 +27,7 @@ export(search_modifiers) export(search_mues) export(search_opps) export(search_payment) +export(search_plas) export(search_pos) export(search_ptps) export(search_rbcs) diff --git a/R/standards.R b/R/standards.R index 1bb480d..4a0b6bb 100644 --- a/R/standards.R +++ b/R/standards.R @@ -145,6 +145,33 @@ search_hcpcs <- function(hcpcs_code = NULL, ...) { } + +#' Proprietary Laboratory Analyses (PLA) Codes +#' (U codes) +#' https://www.ama-assn.org/practice-management/cpt/cpt-pla-codes +# +#' @template args-hcpcs +#' +#' @template args-dots +#' +#' @template returns +#' +#' @examples +#' search_plas(hcpcs_code = c("C9039", "J1835")) +#' +#' @autoglobal +#' +#' @family HIPAA Standards +#' +#' @export +search_plas <- function(hcpcs_code = NULL, ...) { + + pla <- get_pin("cpt_pla") + pla <- fuimus::search_in_if(pla, pla$hcpcs_code, hcpcs_code) + return(.add_class(pla)) + +} + #' Place of Service (POS) Codes #' #' Place of Service Codes are two-digit codes placed on health care professional diff --git a/R/utils.R b/R/utils.R index e4717a4..86f072b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -13,15 +13,8 @@ mount_board <- function(source = c("local", "remote")) { switch( source, - local = pins::board_folder( - fs::path_package( - "extdata/pins", - package = "northstar") - ), - remote = pins::board_url( - "https://raw.githubusercontent.com/andrewallenbruce/northstar/master/inst/extdata/pins/" - ) - ) + local = pins::board_folder(fs::path_package("extdata/pins", package = "northstar")), + remote = pins::board_url("https://raw.githubusercontent.com/andrewallenbruce/northstar/master/inst/extdata/pins/")) } #' Get a pinned dataset from a [pins][pins::pins-package] board @@ -64,6 +57,25 @@ list_pins <- function(...) { } +#' Load Example Datasets +#' +#' @param name name of example +#' +#' @returns `` +#' +#' @autoglobal +#' +#' @keywords internal +#' +#' @export +get_example <- function(name = c("report", "practicum")) { + + name <- match.arg(name) + + get_pin("examples")[[name]] |> .add_class() + +} + #' Apply {gt} Theme #' #' @param gt_object `` A [gt][gt::gt-package] table object diff --git a/data-raw/denials.R b/data-raw/denials.R index eefa8dd..ca4c68d 100644 --- a/data-raw/denials.R +++ b/data-raw/denials.R @@ -114,11 +114,7 @@ scrape_urls <- function(url) { pg |> rvest::html_elements(".table") |> rvest::html_table() |> - purrr::pluck(1) # |> - # janitor::clean_names() |> - # dplyr::select( - # adj_code = carc_rarc, - # adj_description = description) + purrr::pluck(1) ), info = fuimus::null_if_empty( pg |> diff --git a/data-raw/practicum.R b/data-raw/examples.R similarity index 95% rename from data-raw/practicum.R rename to data-raw/examples.R index 20860ad..b737893 100644 --- a/data-raw/practicum.R +++ b/data-raw/examples.R @@ -1,13 +1,17 @@ source(here::here("data-raw", "source_setup", "setup.R")) -# gs_id <- "1MVaKH6T6GZ39iKvrNRoiOBb47RQtMYJ4g0nvunmzsBg" + +# Report Example ---------------- +report <- qs::qread(here::here("data-raw", "rpt_clean")) + + +# Practicum Example ---------------- wkbk <- "1KUPLYD2dksyD4Gcc8pHL5Chw20Sjcck0HYM9VA_JZJ4" sh1 <- read_sheet(wkbk, sheet = 1, col_types = "iicccccicccc") sh2 <- read_sheet(wkbk, sheet = 2, col_types = "iicccccicccc") sh3 <- read_sheet(wkbk, sheet = 3, col_types = "iicccccicccc") # What year were these cases from? - practicum_raw <- vctrs::vec_rbind( sh1, sh2, @@ -62,12 +66,17 @@ practicum <- practicum_raw |> .before = 1 ) +examples <- list( + report = report, + practicum = practicum +) + # Update pin ------------------- pin_update( - practicum, - name = "practicum", - title = "AAPC CPC Practicum Case Data", - description = "AAPC CPC Practicum Case Data" + examples, + name = "examples", + title = "Northstar Example Data", + description = "Northstar Example Data" ) # Example usage ---------------- diff --git a/inst/extdata/pins/_pins.yaml b/inst/extdata/pins/_pins.yaml index 3137d06..c7aba33 100644 --- a/inst/extdata/pins/_pins.yaml +++ b/inst/extdata/pins/_pins.yaml @@ -6,6 +6,8 @@ denials_extract: - denials_extract/20240618T141211Z-dd08c/ denials_site: - denials_site/20240618T140439Z-58f21/ +examples: +- examples/20240628T010539Z-7eb2f/ hcpcs_descriptions: - hcpcs_descriptions/20240627T025507Z-9bffb/ hcpcs_desc_raw: diff --git a/inst/extdata/pins/examples/20240628T010539Z-7eb2f/data.txt b/inst/extdata/pins/examples/20240628T010539Z-7eb2f/data.txt new file mode 100644 index 0000000..d4745db --- /dev/null +++ b/inst/extdata/pins/examples/20240628T010539Z-7eb2f/data.txt @@ -0,0 +1,10 @@ +file: examples.qs +file_size: 933969 +pin_hash: 7eb2fa6e8fbe41d7 +type: qs +title: Northstar Example Data +description: Northstar Example Data +tags: ~ +urls: ~ +created: 20240628T010539Z +api_version: 1 diff --git a/inst/extdata/pins/examples/20240628T010539Z-7eb2f/examples.qs b/inst/extdata/pins/examples/20240628T010539Z-7eb2f/examples.qs new file mode 100644 index 0000000..52d55a6 Binary files /dev/null and b/inst/extdata/pins/examples/20240628T010539Z-7eb2f/examples.qs differ diff --git a/inst/extdata/pins/practicum/20240627T083139Z-d296e/data.txt b/inst/extdata/pins/practicum/20240627T083139Z-d296e/data.txt deleted file mode 100644 index 947e03f..0000000 --- a/inst/extdata/pins/practicum/20240627T083139Z-d296e/data.txt +++ /dev/null @@ -1,10 +0,0 @@ -file: practicum.qs -file_size: 38291 -pin_hash: d296ef4c10d5c5fb -type: qs -title: AAPC CPC Practicum Case Data -description: AAPC CPC Practicum Case Data -tags: ~ -urls: ~ -created: 20240627T083139Z -api_version: 1 diff --git a/inst/extdata/pins/practicum/20240627T083139Z-d296e/practicum.qs b/inst/extdata/pins/practicum/20240627T083139Z-d296e/practicum.qs deleted file mode 100644 index 8848425..0000000 Binary files a/inst/extdata/pins/practicum/20240627T083139Z-d296e/practicum.qs and /dev/null differ diff --git a/man/get_example.Rd b/man/get_example.Rd new file mode 100644 index 0000000..b5d828c --- /dev/null +++ b/man/get_example.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{get_example} +\alias{get_example} +\title{Load Example Datasets} +\usage{ +get_example(name = c("report", "practicum")) +} +\arguments{ +\item{name}{name of example} +} +\value{ +\verb{} +} +\description{ +Load Example Datasets +} +\keyword{internal} diff --git a/man/search_descriptions.Rd b/man/search_descriptions.Rd index 477dc75..328d042 100644 --- a/man/search_descriptions.Rd +++ b/man/search_descriptions.Rd @@ -44,6 +44,7 @@ dplyr::tibble(code = c("A0021", "V5362", "J9264", "G8916")) |> Other HIPAA Standards: \code{\link{search_hcpcs}()}, \code{\link{search_modifiers}()}, +\code{\link{search_plas}()}, \code{\link{search_pos}()}, \code{\link{search_rbcs}()} } diff --git a/man/search_hcpcs.Rd b/man/search_hcpcs.Rd index 5a3db15..4880a69 100644 --- a/man/search_hcpcs.Rd +++ b/man/search_hcpcs.Rd @@ -47,6 +47,7 @@ search_hcpcs(hcpcs_code = c("C9039", "J1835")) Other HIPAA Standards: \code{\link{search_descriptions}()}, \code{\link{search_modifiers}()}, +\code{\link{search_plas}()}, \code{\link{search_pos}()}, \code{\link{search_rbcs}()} } diff --git a/man/search_modifiers.Rd b/man/search_modifiers.Rd index 8ee4e19..067985e 100644 --- a/man/search_modifiers.Rd +++ b/man/search_modifiers.Rd @@ -37,6 +37,7 @@ search_modifiers(mod_type = "CPT") Other HIPAA Standards: \code{\link{search_descriptions}()}, \code{\link{search_hcpcs}()}, +\code{\link{search_plas}()}, \code{\link{search_pos}()}, \code{\link{search_rbcs}()} } diff --git a/man/search_plas.Rd b/man/search_plas.Rd new file mode 100644 index 0000000..0314407 --- /dev/null +++ b/man/search_plas.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/standards.R +\name{search_plas} +\alias{search_plas} +\title{Proprietary Laboratory Analyses (PLA) Codes +(U codes) +https://www.ama-assn.org/practice-management/cpt/cpt-pla-codes} +\usage{ +search_plas(hcpcs_code = NULL, ...) +} +\arguments{ +\item{hcpcs_code}{\verb{} vector of 5-character HCPCS codes} + +\item{...}{These dots are for future extensions and must be empty.} +} +\value{ +a \link[tibble:tibble-package]{tibble} +} +\description{ +Proprietary Laboratory Analyses (PLA) Codes +(U codes) +https://www.ama-assn.org/practice-management/cpt/cpt-pla-codes +} +\examples{ +search_plas(hcpcs_code = c("C9039", "J1835")) + +} +\seealso{ +Other HIPAA Standards: +\code{\link{search_descriptions}()}, +\code{\link{search_hcpcs}()}, +\code{\link{search_modifiers}()}, +\code{\link{search_pos}()}, +\code{\link{search_rbcs}()} +} +\concept{HIPAA Standards} diff --git a/man/search_pos.Rd b/man/search_pos.Rd index 3526d3e..b58e51f 100644 --- a/man/search_pos.Rd +++ b/man/search_pos.Rd @@ -56,6 +56,7 @@ Other HIPAA Standards: \code{\link{search_descriptions}()}, \code{\link{search_hcpcs}()}, \code{\link{search_modifiers}()}, +\code{\link{search_plas}()}, \code{\link{search_rbcs}()} } \concept{HIPAA Standards} diff --git a/man/search_rbcs.Rd b/man/search_rbcs.Rd index 7476df0..f0e6037 100644 --- a/man/search_rbcs.Rd +++ b/man/search_rbcs.Rd @@ -107,6 +107,7 @@ Other HIPAA Standards: \code{\link{search_descriptions}()}, \code{\link{search_hcpcs}()}, \code{\link{search_modifiers}()}, +\code{\link{search_plas}()}, \code{\link{search_pos}()} } \concept{HIPAA Standards} diff --git a/vignettes/northstar.Rmd b/vignettes/northstar.Rmd index 5be2564..fbc7ec7 100644 --- a/vignettes/northstar.Rmd +++ b/vignettes/northstar.Rmd @@ -33,7 +33,6 @@ library(gt) search_descriptions(hcpcs_code = "39503") ``` - ```{r} search_adjustments() ```