Skip to content

Commit

Permalink
updated pins, fun: reference
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce committed Mar 1, 2024
1 parent a496421 commit 46a4667
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 95 deletions.
6 changes: 3 additions & 3 deletions R/calculations.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ calc_nonpar_amount <- function(participating_amount) {

stopifnot("`participating_amount` must be numeric" = is.numeric(participating_amount))

participating_amount * 1.0925
participating_amount * 0.95
}

#' Calculate Physician Fee Schedule Payment Amounts
Expand Down Expand Up @@ -63,7 +63,7 @@ calc_amounts <- function(wrvu,
glue::glue("Participating Amount: {gt::vec_fmt_currency(x$par)}\n",
"Non-Particpating Amount: {gt::vec_fmt_currency(x$nonpar)}\n",
"Limiting Charge: {gt::vec_fmt_currency(x$limit)}",
par = x$par,
par = x$par,
nonpar = x$nonpar,
limit = x$limit)
limit = x$limit)
}
16 changes: 16 additions & 0 deletions R/reference.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#' @noRd
global <- dplyr::tibble(
glob_days = c("000", "010", "090", "MMM", "XXX", "YYY", "ZZZ"),
description = c(
"Endoscopic or minor procedure with related preoperative and postoperative relative values on the day of the procedure only included in the fee schedule payment amount. Evaluation and Management services on the day of the procedure generally not payable.",
"Minor procedure with preoperative relative values on the day of the procedure and postoperative relative values during a 10-day postoperative period included in the fee schedule amount. Evaluation and Management services on the day of the procedure and during the 10-day postoperative period generally not payable.",
"Major surgery with a 1-day preoperative period and 90-day postoperative period included in the fee schedule amount.",
"Maternity codes; usual global period does not apply.",
"Global concept does not apply.",
"Carrier determines whether the global concept applies and establishes postoperative period, if appropriate, at time of pricing.",
"Code is related to another service and is always included in the global period of the other service."
)
) |>
dplyr::mutate(
glob_days = forcats::fct_relevel(glob_days, "000", "010", "090", "MMM", "XXX", "YYY", "ZZZ")
)
20 changes: 10 additions & 10 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ library(dplyr)
```


```{r}
```{r eval=FALSE}
rvu() |>
filter(status == "A",
work.rvu == max(work.rvu, na.rm = TRUE)) |>
wrvu == max(wrvu, na.rm = TRUE)) |>
select(hcpcs,
description,
work.rvu,
pe.rvu_nonfac,
pe.rvu_fac,
mp.rvu,
wrvu,
prvu_nf,
prvu_f,
mrvu,
cf) |>
glimpse()
```
Expand All @@ -68,15 +68,15 @@ calc_amounts(wrvu = 108.91,
cf = 32.7442)
```

```{r}
```{r eval=FALSE}
payment() |>
filter(hcpcs == "39503",
carrier_no == "10212",
locality == "01") |>
select(hcpcs,
mac = carrier_no,
mac,
locality,
fee_nonfac,
fee_fac) |>
fee_nf,
fee_f) |>
glimpse()
```
36 changes: 9 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,17 @@ library(dplyr)
``` r
rvu() |>
filter(status == "A",
work.rvu == max(work.rvu, na.rm = TRUE)) |>
wrvu == max(wrvu, na.rm = TRUE)) |>
select(hcpcs,
description,
work.rvu,
pe.rvu_nonfac,
pe.rvu_fac,
mp.rvu,
wrvu,
prvu_nf,
prvu_f,
mrvu,
cf) |>
glimpse()
```

> Rows: 1
> Columns: 7
> $ hcpcs <chr> "39503"
> $ description <chr> "Repair of diaphragm hernia"
> $ work.rvu <dbl> 108.91
> $ pe.rvu_nonfac <dbl> 35.14
> $ pe.rvu_fac <dbl> 35.14
> $ mp.rvu <dbl> 26.95
> $ cf <dbl> 32.7442

``` r
gpci() |>
filter(state == "GA",
Expand Down Expand Up @@ -77,7 +67,7 @@ calc_amounts(wrvu = 108.91,
```

> Participating Amount: $5,708.76
> Non-Particpating Amount: $6,236.82
> Non-Particpating Amount: $5,423.32
> Limiting Charge: $6,236.82

``` r
Expand All @@ -86,17 +76,9 @@ payment() |>
carrier_no == "10212",
locality == "01") |>
select(hcpcs,
mac = carrier_no,
mac,
locality,
fee_nonfac,
fee_fac) |>
fee_nf,
fee_f) |>
glimpse()
```

> Rows: 1
> Columns: 5
> $ hcpcs <chr> "39503"
> $ mac <chr> "10212"
> $ locality <chr> "01"
> $ fee_nonfac <dbl> 5708.76
> $ fee_fac <dbl> 5708.76
89 changes: 46 additions & 43 deletions data-raw/pfs.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ library(tidyverse)
library(janitor)

root <- c("C:/Users/Andrew/Desktop/payer_guidelines/data/")

# NATIONAL PHYSICIAN FEE SCHEDULE RELATIVE VALUE FILE CALENDAR YEAR 2024
# rvu_xl <- here::here("data/RVU24A-010323/PPRRVU24_JAN.xlsx")

rvu_xl <- glue::glue("{root}RVU24A-010323/PPRRVU24_JAN.xlsx")
pfs_pay_xl <- glue::glue("{root}PFREV24A_0/PFALL24.csv")
gpci_xl <- glue::glue("{root}RVU24A-010323/GPCI2024.xlsx")

# NATIONAL PHYSICIAN FEE SCHEDULE RELATIVE VALUE FILE CALENDAR YEAR 2024
# rvu_xl <- here::here("data/RVU24A-010323/PPRRVU24_JAN.xlsx")

rvu <- read_excel(rvu_xl, col_types = "text") |>
row_to_names(row_number = 9) |>
Expand All @@ -27,67 +25,69 @@ rvu <- read_excel(rvu_xl, col_types = "text") |>
post_op,
non_facility_pe_used_for_opps_payment_amount,
facility_pe_used_for_opps_payment_amount,
mp_used_for_opps_payment_amount
),
readr::parse_number)) |>
mp_used_for_opps_payment_amount), readr::parse_number)) |>
rename(
status = status_code,
unused = not_used_for_medicare_payment,
work.rvu = work_rvu,
pe.rvu_nonfac = non_fac_pe_rvu,
nonfac_ind_na = non_fac_na_indicator,
pe.rvu_fac = facility_pe_rvu,
fac_ind_na = facility_na_indicator,
mp.rvu = mp_rvu,
total_nonfac = non_facility_total,
total_fac = facility_total,
pctc = pctc_ind,
endo = endo_base,
cf = conv_factor,
phys_sup_diag_proc = physician_supervision_of_diagnostic_procedures,
calc_flag = calculation_flag,
diag_img_fm_ind = diagnostic_imaging_family_indicator,
pe.rvu_nonfac_opps = non_facility_pe_used_for_opps_payment_amount,
pe.rvu_fac_opps = facility_pe_used_for_opps_payment_amount,
mp.rvu_opps = mp_used_for_opps_payment_amount
)
status = status_code,
notused = not_used_for_medicare_payment,
wrvu = work_rvu,
prvu_nf = non_fac_pe_rvu,
prvu_f = facility_pe_rvu,
nf_ind_na = non_fac_na_indicator,
f_ind_na = facility_na_indicator,
mrvu = mp_rvu,
total_nf = non_facility_total,
total_f = facility_total,
pctc = pctc_ind,
endo = endo_base,
cf = conv_factor,
phys_dxpx = physician_supervision_of_diagnostic_procedures,
calc = calculation_flag,
dximgfm_ind = diagnostic_imaging_family_indicator,
prvu_nf_opps = non_facility_pe_used_for_opps_payment_amount,
prvu_f_opps = facility_pe_used_for_opps_payment_amount,
mrvu_opps = mp_used_for_opps_payment_amount)

# [18,500 x 31]

rvu |>
filter(hcpcs == "A0021")

# ANNUAL PHYSICIAN FEE SCHEDULE PAYMENT AMOUNT FILE
# pfs_pay_xl <- here::here("data/PFREV24A_0/PFALL24.csv")

pfs_pay <- readr::read_csv(pfs_pay_xl, col_types = strrep("c", 16)) |>
pfs_pay <- readr::read_csv(pfs_pay_xl,
col_types = strrep("c", 16)) |>
slice(-c(990483:990487))

names(pfs_pay) <- c(
"year",
"carrier_no",
"mac",
"locality",
"hcpcs",
"mod",
"fee_nonfac", # "non_fac_fee_sched_amount"
"fee_fac", # "facility_fee_sched_amount"
"fee_nf", # "non_fac_fee_sched_amount"
"fee_f", # "facility_fee_sched_amount"
"pctc",
"status",
"mult_surg",
"ther_red_nonfac", # "therapy_reduction_nonfac"
"flat_visit", # flat_visit_fee
"ther_red_fac", # "therapy_reduction_fac"
"therapy_nf", # "therapy_reduction_nonfac"
"flatfee_visit", # flat_visit_fee
"therapy_f", # "therapy_reduction_fac"
"opps", # "opps_indicator"
"opps_nonfac",
"opps_fac"
"opps_nf",
"opps_f"
)

pfs_pay <- pfs_pay |>
mutate(across(c(
year,
contains("fac"),
flat_visit
contains("fee"),
contains("therapy"),
contains("opps_"),
), readr::parse_number)) |>
select(-pctc)

# [990,482 x 15]
pfs_pay |>
filter(hcpcs == "A0021")

Expand All @@ -100,14 +100,17 @@ gpci <- read_excel(gpci_xl, col_types = "text") |>
filter(!is.na(state)) |>
rename(mac = medicare_administrative_contractor_mac,
locality = locality_number,
gpci.pw_floor = x2024_pw_gpci_with_1_0_floor,
gpci.pe = x2024_pe_gpci,
gpci.mp = x2024_mp_gpci
wgpci = x2024_pw_gpci_with_1_0_floor,
pgpci = x2024_pe_gpci,
mgpci = x2024_mp_gpci
) |>
mutate(across(contains("gpci"), readr::parse_number)) |>
mutate(locality_name = str_remove_all(locality_name, fixed("*")),
state = fct(state))
mutate(ftnote = str_extract_all(locality_name, fixed("*")),
locality_name = str_remove_all(locality_name, fixed("*")),
state = fct(state)) |>
unnest(ftnote, keep_empty = TRUE)

# [114 x 8]
gpci


Expand Down
6 changes: 3 additions & 3 deletions pins/_pins.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gpci:
- gpci/20240229T141339Z-56bda/
- gpci/20240301T191529Z-046ae/
pymt:
- pymt/20240229T141334Z-f3472/
- pymt/20240301T191527Z-8e4f8/
rvu:
- rvu/20240229T141242Z-b9bfe/
- rvu/20240301T191525Z-74e8b/
Binary file removed pins/gpci/20240229T141339Z-56bda/gpci.qs
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
file: gpci.qs
file_size: 3789
pin_hash: 56bda82317bd4f61
file_size: 3884
pin_hash: 046ae03771b63f61
type: qs
title: GPCIs 2024
description: Geographic Practice Cost Indices (GPCIs) by State and Medicare Locality
2024
tags: ~
urls: ~
created: 20240229T141339Z
created: 20240301T191529Z
api_version: 1
Binary file added pins/gpci/20240301T191529Z-046ae/gpci.qs
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
file: pymt.qs
file_size: 8590506
pin_hash: f347237b879b8c9a
file_size: 8590491
pin_hash: 8e4f837562588fdf
type: qs
title: PFS Payment Amount 2024
description: Annual Physician Fee Schedule Payment Amount File 2024
tags: ~
urls: ~
created: 20240229T141334Z
created: 20240301T191527Z
api_version: 1
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
file: rvu.qs
file_size: 487417
pin_hash: b9bfe6b2b6fbc381
file_size: 487390
pin_hash: 74e8b40657e5df8d
type: qs
title: PFS RVU 2024
description: National Physician Fee Schedule Relative Value File January 2024 Release
tags: ~
urls: ~
created: 20240229T141242Z
created: 20240301T191525Z
api_version: 1
Binary file not shown.

0 comments on commit 46a4667

Please sign in to comment.