For Dream challenge, I am working with this definition here
http://atlas-demo.ohdsi.org/#/cohortdefinition/1772216
I am hoping to use OhdsiRTools::insertCohortDefinitionInPackage
If I look at the code, the key part of the code works fine (with the following parameters)
definitionId = 1772216
baseUrl='http://atlas-demo.ohdsi.org:80/WebAPI'
url <- paste(baseUrl, "cohortdefinition", definitionId,
sep = "/")
json <- httr::GET(url)
httr::content(json)
I believe the regex in the function below is failing all the cool features for cohorts on OHDSRTools.
.checkBaseUrl
function (baseUrl)
{
patterns <- list("https?:\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})+(\\/.*)?\\/WebAPI$",
"https?:\\/\\/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(:[0-9]{1,5})+(\\/.*)?\\/WebAPI$")
results <- lapply(patterns, function(p) {
result <- grepl(pattern = p, x = baseUrl, ignore.case = FALSE)
})
return(any(as.logical(results)))
}
I get false when I run
OhdsiRTools:::.checkBaseUrl(baseUrl)
Is this true bug or am I doing something wrong.
version I am using is OhdsiRTools * 1.7.0 2019-08-05 [1] Github (OHDSI/OhdsiRTools@8626e57)