Skip to content

Commit

Permalink
retry check
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce committed Oct 27, 2023
1 parent 84cfd18 commit 10076c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
12 changes: 6 additions & 6 deletions R/order_refer.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ order_refer <- function(npi = NULL,
tidy = TRUE,
pivot = TRUE) {

if (!is.null(npi)) {npi <- validate_npi(npi)}
if (!is.null(partb)) {partb <- tf_2_yn(partb)}
if (!is.null(dme)) {dme <- tf_2_yn(dme)}
if (!is.null(hha)) {hha <- tf_2_yn(hha)}
if (!is.null(pmd)) {pmd <- tf_2_yn(pmd)}
npi <- npi %nn% validate_npi(npi)
partb <- partb %nn% tf_2_yn(partb)
dme <- dme %nn% tf_2_yn(dme)
hha <- hha %nn% tf_2_yn(hha)
pmd <- pmd %nn% tf_2_yn(pmd)

args <- dplyr::tribble(
~param, ~arg,
Expand All @@ -89,7 +89,7 @@ order_refer <- function(npi = NULL,
response <- httr2::request(build_url("ord", args)) |>
httr2::req_perform()

if (isTRUE(vctrs::vec_is_empty(response$body))) {
if (vctrs::vec_is_empty(response$body)) {

cli_args <- dplyr::tribble(
~x, ~y,
Expand Down
14 changes: 6 additions & 8 deletions R/providers.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ providers <- function(npi = NULL,
tidy = TRUE,
na.rm = TRUE) {

if (!is.null(npi)) {npi <- validate_npi(npi)}
if (!is.null(pac)) {pac_id <- check_pac(pac)}
if (!is.null(enid)) {check_enid(enid)}
if (!is.null(gender)) {rlang::arg_match(gender, c("F", "M", "9"))}
npi <- npi %nn% validate_npi(npi)
pac <- pac %nn% check_pac(pac)
enid <- enid %nn% check_enid(enid)
gender <- gender %nn% rlang::arg_match(gender, c("F", "M", "9"))

args <- dplyr::tribble(
~param, ~arg,
Expand Down Expand Up @@ -106,10 +106,8 @@ providers <- function(npi = NULL,
}
results <- httr2::resp_body_json(response, simplifyVector = TRUE)

if (tidy) {
results <- cols_pros(tidyup(results))
if (na.rm) {results <- narm(results)}
}
if (tidy) results <- cols_pros(tidyup(results))
if (na.rm) results <- narm(results)
return(results)
}

Expand Down
2 changes: 1 addition & 1 deletion R/taxonomy_crosswalk.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ taxonomy_crosswalk <- function(taxonomy_code = NULL,
format_cli(cli_args)
return(invisible(NULL))
}
if (tidy) {results <- cols_cross(tidyup(results))}
if (tidy) results <- cols_cross(tidyup(results))
return(results)
}

Expand Down

0 comments on commit 10076c1

Please sign in to comment.