Skip to content

Commit

Permalink
update pkgdown workflow (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce authored Dec 4, 2024
2 parents 00d0923 + 807418c commit 7e4d108
Show file tree
Hide file tree
Showing 29 changed files with 87 additions and 520 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
Expand All @@ -21,6 +23,8 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}
CENSUS_API_KEY: ${{ secrets.CENSUS_API_KEY }}
permissions:
contents: write
steps:
- uses: actions/checkout@v2

Expand Down
7 changes: 1 addition & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Package: provider
Title: Access Public Healthcare Provider Data
Version: 0.0.1
Authors@R:
person("Andrew", "Bruce", , "andrewallenbruce@gmail.com", role = c("aut", "cre", "cph"))
person(c("Andrew", "Allen"), "Bruce", , "andrewallenbruce@gmail.com", role = c("aut", "cre", "cph"))
Maintainer: Andrew Bruce <andrewallenbruce@gmail.com>
Description: Provides various features to facilitate easy access to
publicly available healthcare provider data. Includes functions to
Expand All @@ -23,7 +23,6 @@ Imports:
janitor,
lifecycle,
lubridate,
pins,
purrr,
rlang (>= 1.1.0),
rxnorm,
Expand All @@ -34,11 +33,9 @@ Imports:
vctrs,
zeallot
Suggests:
covr,
data.table,
fipio,
fontawesome,
fs,
fuimus,
future,
glue,
Expand All @@ -47,8 +44,6 @@ Suggests:
htmltools,
httptest2,
knitr,
qs,
rmarkdown,
roxyglobals,
rvest,
sf,
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
COPYRIGHT HOLDER: Andrew Bruce
YEAR: 2022-2025
COPYRIGHT HOLDER: Andrew Allen Bruce
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 Andrew Bruce
Copyright (c) 2022-2025 Andrew Allen Bruce

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export(ror)
export(rx_years)
export(rxnorm)
export(summary_stats)
export(taxonomies)
export(taxonomy_codes)
export(taxonomy_crosswalk)
export(tidyup)
export(util_years)
Expand Down
45 changes: 0 additions & 45 deletions R/generated-globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,28 +104,14 @@ utils::globalVariables(c(
# <rbcs_util>
# <quality_payment>
"category",
# <taxonomy_codes>
"Category",
# <open_payments>
"category_1",
# <taxonomy_codes>
"Category_Level",
# <mips_2021>
"ccxp_ind",
# <download_nucc_csv>
"classification",
# <taxonomy_codes>
"Classification",
# <taxonomy_codes>
"Classification_Level",
# <laboratories>
"clia_number",
# <laboratories>
"cmplnc_stus_cd",
# <download_nucc_csv>
"code",
# <taxonomy_codes>
"Code",
# <laboratories>
"cola",
# <mips_2021>
Expand Down Expand Up @@ -154,17 +140,12 @@ utils::globalVariables(c(
"current_clia_lab_clsfctn_cd",
# <open_ids>
"data",
# <download_nucc_csv>
"definition",
# <gt_datadict>
"Definition",
# <cms_dataset_search>
"description",
# <taxonomy_codes>
# <gt_datadict>
"Description",
# <download_nucc_csv>
"display_name",
# <cms_update>
# <open_ids>
"distribution",
Expand Down Expand Up @@ -218,19 +199,13 @@ utils::globalVariables(c(
"group_id",
# <reassignments>
"group_state_code",
# <taxonomy_codes>
"Grouping",
# <taxonomy_codes>
"Grouping_Level",
# <cols_qelig>
"grp_status",
# <tidyup_provider.util>
"hcc_risk_avg",
# <rbcs_util>
# <compare_hcpcs>
"hcpcs",
# <taxonomies>
"hierarchy",
# <medline>
"html",
# <cms_update>
Expand Down Expand Up @@ -261,8 +236,6 @@ utils::globalVariables(c(
# <tidyup_drug.rx>
# <tidyup_service.util>
"level",
# <taxonomy_codes>
"Level",
# <ror>
"lg",
# <hospitals>
Expand Down Expand Up @@ -370,17 +343,9 @@ utils::globalVariables(c(
"rndrng_prvdr_geo_lvl",
# <quality_payment>
"score",
# <download_nucc_csv>
"section",
# <open_ids>
# <quality_payment>
"set",
# <download_nucc_csv>
"specialization",
# <taxonomy_codes>
"Specialization",
# <taxonomy_codes>
"Specialization_Level",
# <tidyup_provider.util>
# <tidyup_service.util>
"specialty",
Expand Down Expand Up @@ -423,16 +388,6 @@ utils::globalVariables(c(
"subtotal",
# <medline>
"summary._value",
# <taxonomy_codes>
"taxonomy_category",
# <taxonomy_codes>
"taxonomy_classification",
# <taxonomy_codes>
"taxonomy_code",
# <taxonomy_codes>
"taxonomy_grouping",
# <taxonomy_codes>
"taxonomy_specialization",
# <quality_eligibility>
"timelength_days",
# <cms_update>
Expand Down
35 changes: 13 additions & 22 deletions R/reassignments.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
#'
#' *Update Frequency:* **Monthly**
#'
#' @param npi < *integer* > __Individual__ 10-digit National Provider Identifier
#' @param pac < *integer* > __Individual__ 10-digit PECOS Associate Control ID
#' @param enid < *character* > __Individual__ 15-digit Medicare Enrollment ID
#' @param first,last < *character* > __Individual__ Provider's name
#' @param state < *character* > __Individual__ Enrollment state abbreviation
#' @param specialty < *character* > __Individual__ Enrollment specialty
#' @param organization < *character* > __Organizational__ Legal business name
#' @param pac_org < *integer* > __Organizational__ 10-digit PECOS Associate Control ID
#' @param enid_org < *character* > __Organizational__ 15-digit Medicare Enrollment ID
#' @param state_org < *character* > __Organizational__ Enrollment state abbreviation
#' @param entry < *character* > Entry type, reassignment (`"R"`) or employment (`"E"`)
#' @param tidy < *boolean* > // __default:__ `TRUE` Tidy output
#' @param na.rm < *boolean* > // __default:__ `TRUE` Remove empty rows and columns
#' @param npi `<chr>` __Individual__ 10-digit National Provider Identifier
#' @param pac `<chr>` __Individual__ 10-digit PECOS Associate Control ID
#' @param enid `<chr>` __Individual__ 15-digit Medicare Enrollment ID
#' @param first,last `<chr>` __Individual__ Provider's name
#' @param state `<chr>` __Individual__ Enrollment state abbreviation
#' @param specialty `<chr>` __Individual__ Enrollment specialty
#' @param organization `<chr>` __Organizational__ Legal business name
#' @param pac_org `<chr>` __Organizational__ 10-digit PECOS Associate Control ID
#' @param enid_org `<chr>` __Organizational__ 15-digit Medicare Enrollment ID
#' @param state_org `<chr>` __Organizational__ Enrollment state abbreviation
#' @param entry `<chr>` Entry type, reassignment (`"R"`) or employment (`"E"`)
#' @param tidy `<lgl>` // __default:__ `TRUE` Tidy output
#' @param na.rm `<chr>` // __default:__ `TRUE` Remove empty rows and columns
#' @param ... Empty
#'
#' @return A [tibble][tibble::tibble-package] with the columns:
Expand Down Expand Up @@ -173,12 +173,3 @@ fct_record <- function(x) {
levels = c("Physician Assistant", "Reassignment"),
labels = c("Employment", "Reassignment"))
}

#' @autoglobal
#' @noRd
# nocov start
georgia_reassignments <- function() {
pins::board_url(github_raw("andrewallenbruce/provider/main/pkgdown/assets/pins-board/")) |>
pins::pin_read("georgia_reassignments")
}
# nocov end
36 changes: 0 additions & 36 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,6 @@ narm <- function(df) {
janitor::remove_empty(df, which = c("rows", "cols"))
}

#' Return GitHub raw url
#' @param x url
#' @returns raw url
#' @examplesIf interactive()
#' github_raw("andrewallenbruce/provider/")
#' @autoglobal
#' @noRd
github_raw <- function(x) {
paste0("https://raw.githubusercontent.com/", x)
}

#' Format empty search results
#' @param df data frame of parameter arguments
#' @autoglobal
Expand All @@ -254,28 +243,3 @@ format_cli <- function(df) {
wrap = TRUE)

}

#' Mount [pins][pins::pins-package] board
#'
#' @param source `"local"` or `"remote"`
#'
#' @return `<pins_board_folder>` or `<pins_board_url>`
#'
#' @noRd
mount_board <- function(source = c("local", "remote")) {

source <- match.arg(source)

switch(
source,
local = pins::board_folder(
fs::path_package(
"extdata/pins",
package = "provider")
),
remote = pins::board_url(
fuimus::gh_raw(
"andrewallenbruce/provider/master/inst/extdata/pins/")
)
)
}
33 changes: 33 additions & 0 deletions data-raw/deprecated/mount_board.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#' Mount [pins][pins::pins-package] board
#'
#' @param source `"local"` or `"remote"`
#'
#' @return `<pins_board_folder>` or `<pins_board_url>`
#'
#' @noRd
mount_board <- function(source = c("local", "remote")) {

source <- match.arg(source)

switch(
source,
local = pins::board_folder(
fs::path_package(
"extdata/pins",
package = "provider")
),
remote = pins::board_url(
fuimus::gh_raw(
"andrewallenbruce/provider/master/inst/extdata/pins/")
)
)
}

#' @autoglobal
#' @noRd
# nocov start
georgia_reassignments <- function() {
pins::board_url(github_raw("andrewallenbruce/provider/main/pkgdown/assets/pins-board/")) |>
pins::pin_read("georgia_reassignments")
}
# nocov end
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions data-raw/deprecated/tests.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# test_that("github_raw() works", {
# expect_equal(github_raw("andrewallenbruce/provider/"),
# "https://raw.githubusercontent.com/andrewallenbruce/provider/")
# })

# ALWAYS FAILS
# test_that("file_url() works", {
#
# args <- dplyr::tibble(param = "NPI", arg = "1144544834")
#
# expect_snapshot(file_url(fn = "c", args = args, offset = 0L), error = FALSE)
# expect_snapshot(file_url(fn = "a", args = args, offset = 0L), error = FALSE)
# })
#
# HASH IN URL IS CHANGING FREQUENTLY
# https://data.cms.gov/provider-data/api/1/datastore/sql?query=%5BSELECT%20%2A%20FROM%201e88f761-7d99-55ca-a8fc-20b193b0d2ea%5D%5BWHERE%20NPI%20=%20%221144544834%22%5D%5BLIMIT%2010000%20OFFSET%200%5D;&show_db_columns

11 changes: 0 additions & 11 deletions data-raw/georgia_reassignments.R

This file was deleted.

4 changes: 0 additions & 4 deletions inst/extdata/pins/_pins.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions inst/extdata/pins/taxlong/20240409T213644Z-972c7/data.txt

This file was deleted.

Binary file not shown.
10 changes: 0 additions & 10 deletions inst/extdata/pins/taxonomy/20240409T213637Z-1a818/data.txt

This file was deleted.

Binary file not shown.
2 changes: 1 addition & 1 deletion man/provider-package.Rd

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

Loading

0 comments on commit 7e4d108

Please sign in to comment.