From 2cd2b9edc16fed74b36cb7399035581ee9b1763d Mon Sep 17 00:00:00 2001 From: Andrew Bruce Date: Sat, 4 Nov 2023 16:28:37 -0400 Subject: [PATCH] affiliations test --- DESCRIPTION | 2 +- R/order_refer.R | 3 +-- man/order_refer.Rd | 6 ++---- tests/testthat/test-affiliations.R | 11 +++++++++++ 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 tests/testthat/test-affiliations.R diff --git a/DESCRIPTION b/DESCRIPTION index 2e791c95..4bccb7bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,7 @@ URL: https://andrewallenbruce.github.io/provider/, https://github.com/andrewallenbruce/provider BugReports: https://github.com/andrewallenbruce/provider/issues Depends: - R (>= 3.6) + R (>= 4.1.0) Imports: anytime, cli, diff --git a/R/order_refer.R b/R/order_refer.R index 2439c319..0b5ccca0 100644 --- a/R/order_refer.R +++ b/R/order_refer.R @@ -51,8 +51,7 @@ #' |`last` |Order and Referring Provider's Last Name | #' |`service` |Services An Eligible Provider Can Order/Refer To | #' -#' @seealso [providers()], [opt_out()], [pending()] -#' @examples +#' @examplesIf interactive() #' order_refer(npi = 1003026055) #' #' # Filter for certain privileges diff --git a/man/order_refer.Rd b/man/order_refer.Rd index e3c155e4..771cdbe4 100644 --- a/man/order_refer.Rd +++ b/man/order_refer.Rd @@ -70,11 +70,12 @@ Medicare may reimburse on behalf of its beneficiaries. order and refer. They can also enroll solely to order and refer. } \examples{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} order_refer(npi = 1003026055) # Filter for certain privileges order_refer(last = "Smith", partb = FALSE, hha = TRUE) - +\dontshow{\}) # examplesIf} } \references{ links: @@ -86,6 +87,3 @@ links: \emph{Update Frequency:} \strong{Twice Weekly} } -\seealso{ -\code{\link[=providers]{providers()}}, \code{\link[=opt_out]{opt_out()}}, \code{\link[=pending]{pending()}} -} diff --git a/tests/testthat/test-affiliations.R b/tests/testthat/test-affiliations.R new file mode 100644 index 00000000..d3a89d6e --- /dev/null +++ b/tests/testthat/test-affiliations.R @@ -0,0 +1,11 @@ +httptest2::without_internet({ + test_that("affiliations() returns correct request URL", { + httptest2::expect_GET( + affiliations(npi = 1144429580, + pac = 3577659580, + facility_type = "irf", + facility_ccn = "67T055", + parent_ccn = 670055), + 'https://data.cms.gov/provider-data/api/1/metastore/schemas/dataset/items/27ea-46a8?show-reference-ids=true') + }) +})