Skip to content

In 2024 CQC required registration for API key.#3

Open
simondashnash wants to merge 10 commits into
evanodell:masterfrom
simondashnash:master
Open

In 2024 CQC required registration for API key.#3
simondashnash wants to merge 10 commits into
evanodell:masterfrom
simondashnash:master

Conversation

@simondashnash

Copy link
Copy Markdown

Hi Evan

I had a go at updating your library to work with CQC's API key. Please could you review and merge if its OK?

This commit adds a file subscription_key.R which replaces partner_code.R and amends some other files to use a new base URL and pass the API key in the header. I also amended the introduction.Rmd file to reflect CQC's change.

Yours

Simon

This commit adds a file subscription_key.R which replaces partner_code.R and amends multiple other files to use a new base URL and pass the API key in the header.

@evanodell evanodell left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of commenting out old functions you can remove them entirely.

Otherwise it looks good to me. I've not been actively maintaining any of my R packages so I'm rusty on the code but it seems to work.

Also please add yourself as a contributor in the DESCRIPTION file and bump the version up.

Comment thread R/utils-query-construct.R Outdated
Comment on lines +32 to +58
# cqc_query_construction <- function(query) {
# partner_code <- getOption("cqc.partner.code")

# if (is.null(partner_code)) {
# message("CQC Partner Code not set.")
# } else if (!grepl("&", query)) {
# query <- paste0(query, "?")
# }

# query2 <- paste0(
# baseurl, query, partner_code
# )

# query2 <- gsub("?&partnerCode=", "?partnerCode=", query2, fixed = TRUE)

# x <- httr::GET(query2)

# if (httr::status_code(x) != "200") {
# stop(paste(
# "Request returned error code:",
# httr::status_code(x)
# ), call. = FALSE)
# }

# suppressMessages(cont <- jsonlite::fromJSON(httr::content(x, "text")))

# cont

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of commenting out old formulas can you remove them entirely?

@simondashnash

Copy link
Copy Markdown
Author

Hi.
I tidied up commented lines, added contributor lines to DESCRIPTION and ran devtools::document() . Hopefully OK now.

Simon

@simondashnash

Copy link
Copy Markdown
Author

I amended the tests to prompt user for API key, did some other tidying as you advised, added myself as a contributor and incremented the version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants