diff --git a/R/get_latest_resource.R b/R/get_latest_resource.R index 2532bdd..30cbfa7 100644 --- a/R/get_latest_resource.R +++ b/R/get_latest_resource.R @@ -50,8 +50,6 @@ get_latest_resource <- function(dataset_name, row_filters = NULL, col_select = NULL, include_context = FALSE) { - - applicable_datasets <- c( "gp-practice-populations", "gp-practice-contact-details-and-list-sizes", "nhsscotland-payments-to-general-practice", "dental-practices-and-patient-registrations", @@ -78,15 +76,17 @@ get_latest_resource <- function(dataset_name, # check if data set is within applicable datasets # throw error if not if (!dataset_name %in% applicable_datasets) { - cli::cli_abort(c( - "The dataset name supplied {.var {dataset_name}} is not within the applicable datasets. + cli::cli_abort( + c( + "The dataset name supplied {.var {dataset_name}} is not within the applicable datasets. These are:\n {.var {applicable_datasets}}", - "x" = "Please see get_latest_reource documentation.", - "i" = "You can find dataset names in the URL + "x" = "Please see get_latest_reource documentation.", + "i" = "You can find dataset names in the URL of a dataset's page on {.url www.opendata.nhs.scot}." - ), - call = rlang::caller_env()) + ), + call = rlang::caller_env() + ) } diff --git a/R/get_latest_resource_id.R b/R/get_latest_resource_id.R index cf353cd..d9d534b 100644 --- a/R/get_latest_resource_id.R +++ b/R/get_latest_resource_id.R @@ -16,8 +16,6 @@ #' #' @return a string with the resource id get_latest_resource_id <- function(dataset_name) { - - # send the api request query <- list("id" = dataset_name) content <- phs_GET("package_show", query)