Skip to content

Commit

Permalink
pins: rvu, pfs, gpci
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce committed Feb 29, 2024
1 parent ed9030b commit 4a7da1c
Show file tree
Hide file tree
Showing 17 changed files with 266 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
^\.Rproj\.user$
^README\.Rmd$
^LICENSE\.md$
^data-raw$
^_pkgdown\.yml$
^docs$
^pkgdown$
^\.github$
^pins$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.Rproj.user
.Rhistory
docs
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ License: Apache License (>= 2)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
URL: https://andrewallenbruce.github.io/northstar/
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by roxygen2: do not edit by hand

export(github_raw)
export(limiting_charge)
12 changes: 12 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@
github_raw <- function(x) {
paste0("https://raw.githubusercontent.com/", x)
}

#' Calculate limiting charge
#' @param x numeric
#' @return description
#' @examples
#' limiting_charge(26.35)
#' @export
limiting_charge <- function(x) {
stopifnot("x must be numeric" = is.numeric(x))
x * 1.0925 # PAR FEE
# x * 1.150115 # NON-PAR FEE
}
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: https://andrewallenbruce.github.io/northstar/
template:
bootstrap: 5

135 changes: 135 additions & 0 deletions data-raw/pfs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
library(readxl)
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")


rvu <- read_excel(rvu_xl, col_types = "text") |>
row_to_names(row_number = 9) |>
clean_names() |>
mutate(across(c(work_rvu,
non_fac_pe_rvu,
facility_pe_rvu,
non_facility_total,
facility_total,
mp_rvu,
conv_factor,
pre_op,
intra_op,
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)) |>
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
)

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)) |>
slice(-c(990483:990487))

names(pfs_pay) <- c(
"year",
"carrier_no",
"locality",
"hcpcs",
"mod",
"fee_nonfac", # "non_fac_fee_sched_amount"
"fee_fac", # "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"
"opps", # "opps_indicator"
"opps_nonfac",
"opps_fac"
)

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

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

# ADDENDUM E. FINAL CY 2024 GEOGRAPHIC PRACTICE COST INDICES (GPCIs) BY STATE AND MEDICARE LOCALITY
# gpci_xl <- here::here("data/RVU24A-010323/GPCI2024.xlsx")

gpci <- read_excel(gpci_xl, col_types = "text") |>
row_to_names(row_number = 2) |>
clean_names() |>
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
) |>
mutate(across(contains("gpci"), readr::parse_number)) |>
mutate(locality_name = str_remove_all(locality_name, fixed("*")),
state = fct(state))

gpci


board <- pins::board_folder(here::here("pins"))

board |>
pins::pin_write(rvu,
name = "rvu",
title = "PFS RVU 2024",
description = "National Physician Fee Schedule Relative Value File January 2024 Release",
type = "qs")
board |>
pins::pin_write(pfs_pay,
name = "pymt",
title = "PFS Payment Amount 2024",
description = "Annual Physician Fee Schedule Payment Amount File 2024",
type = "qs")
board |>
pins::pin_write(gpci,
name = "gpci",
title = "GPCIs 2024",
description = "Geographic Practice Cost Indices (GPCIs) by State and Medicare Locality 2024",
type = "qs")

board |> pins::write_board_manifest()
20 changes: 20 additions & 0 deletions man/limiting_charge.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pins/_pins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gpci:
- gpci/20240229T141339Z-56bda/
pymt:
- pymt/20240229T141334Z-f3472/
rvu:
- rvu/20240229T141242Z-b9bfe/
11 changes: 11 additions & 0 deletions pins/gpci/20240229T141339Z-56bda/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
file: gpci.qs
file_size: 3789
pin_hash: 56bda82317bd4f61
type: qs
title: GPCIs 2024
description: Geographic Practice Cost Indices (GPCIs) by State and Medicare Locality
2024
tags: ~
urls: ~
created: 20240229T141339Z
api_version: 1
Binary file added pins/gpci/20240229T141339Z-56bda/gpci.qs
Binary file not shown.
10 changes: 10 additions & 0 deletions pins/pymt/20240229T141334Z-f3472/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file: pymt.qs
file_size: 8590506
pin_hash: f347237b879b8c9a
type: qs
title: PFS Payment Amount 2024
description: Annual Physician Fee Schedule Payment Amount File 2024
tags: ~
urls: ~
created: 20240229T141334Z
api_version: 1
Binary file added pins/pymt/20240229T141334Z-f3472/pymt.qs
Binary file not shown.
10 changes: 10 additions & 0 deletions pins/rvu/20240229T141242Z-b9bfe/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file: rvu.qs
file_size: 487417
pin_hash: b9bfe6b2b6fbc381
type: qs
title: PFS RVU 2024
description: National Physician Fee Schedule Relative Value File January 2024 Release
tags: ~
urls: ~
created: 20240229T141242Z
api_version: 1
Binary file added pins/rvu/20240229T141242Z-b9bfe/rvu.qs
Binary file not shown.

0 comments on commit 4a7da1c

Please sign in to comment.