OHDSI Home | Forums | Wiki | Github

OhdsiRTools question

(Vojtech Huser) #1

For Dream challenge, I am working with this definition here

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
url <- paste(baseUrl, "cohortdefinition", definitionId, 
             sep = "/")
json <- httr::GET(url)

I believe the regex in the function below is failing all the cool features for cohorts on OHDSRTools.

function (baseUrl) 
  patterns <- list("https?:\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})+(\\/.*)?\\/WebAPI$", 
  results <- lapply(patterns, function(p) {
    result <- grepl(pattern = p, x = baseUrl, ignore.case = FALSE)

I get false when I run

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)

(Chris Knoll) #2

The WEBApi is hosted on a separate top level domain from atlas-demo. I found the WebAPI endpoint hosted at: http://api.ohdsi.org/WebAPI/info

So, try changing the base url to http://api.ohdsi.org/WebAPI

(Vojtech Huser) #3

I did that URL as well but it fails the RegEx in the check function as well.


Until it would say TRUE, all the great functions in OhdsiRTools will fail.

(Lee Evans) #4

@Vojtech_Huser The URL is case sensitive.

Try this URL instead:

(Vojtech Huser) #5

same failure with WebAPI.
The problem is that the regex check (at the start of every OhdsiRTools call is expecting a pattern that this does not match. (I think the port 80 requirement there is failing it). But I am not a regex expert. I think a check based on try of a httr call would be much better than forcing a pattern with regex.

formal issue now here https://github.com/OHDSI/OhdsiRTools/issues/27