OHDSI Home | Forums | Wiki | Github

Cohort Definition error


(Scott Fischbein) #1

Hi there,
I’m trying to get our local installation of ATLAS working, which it is, for the most part, but can’t figure out this issue with the Cohort Definitions - I can create new definitions, and everything works as expected, but if I try to click on an existing definition, the application tries to deliver that page but just spins (ie: /Atlas/#/cohortdefinition/13), and the console shows the following error:

Uncaught SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse ()
at Object. (CohortDefinition.js:68)
at Object. (jquery.js:3411)
at fire (jquery.js:3232)
at Object.fireWith [as resolveWith] (jquery.js:3362)
at done (jquery.js:9840)
at XMLHttpRequest.callback (jquery.js:10311)

This is the JSON that is being returned form the WebAPI for that cohort definition:

{“id”:11,“name”:“male”,“description”:null,“createdBy”:"",“createdDate”:“2020-01-14 21:15”,“modifiedBy”:"",“modifiedDate”:“2020-01-14 21:19”,“expressionType”:“SIMPLE_EXPRESSION”,“expression”:{“cdmVersionRange”:">=5.0.0",“PrimaryCriteria”:{“CriteriaList”:[{“VisitOccurrence”:{“VisitTypeExclude”:false}}],“ObservationWindow”:{“PriorDays”:0,“PostDays”:0},“PrimaryCriteriaLimit”:{“Type”:“First”}},“ConceptSets”:[],“QualifiedLimit”:{“Type”:“First”},“ExpressionLimit”:{“Type”:“First”},“InclusionRules”:[{“name”:“male”,“expression”:{“Type”:“ANY”,“CriteriaList”:[],“DemographicCriteriaList”:[{“Gender”:[{“CONCEPT_ID”:45766035,“CONCEPT_NAME”:“Feminine gender”,“STANDARD_CONCEPT”:null,“STANDARD_CONCEPT_CAPTION”:“Unknown”,“INVALID_REASON”:null,“INVALID_REASON_CAPTION”:“Unknown”,“CONCEPT_CODE”:“703118005”,“DOMAIN_ID”:“Gender”,“VOCABULARY_ID”:“SNOMED”,“CONCEPT_CLASS_ID”:null}]}],“Groups”:[]}}],“CensoringCriteria”:[],“CollapseSettings”:{“CollapseType”:“ERA”,“EraPad”:0},“CensorWindow”:{}}}

Any suggestions on how to fix this or where to look for further debugging information?


(Chris Knoll) #2

The JSON looks correct, and it doesn’t look like there is a token ‘o’ anywhere in that JSON, so I’m guessing that perhaps the Atlas UI code is expecting a different format.

Can you confirm the version of Atlas and the version of WebAPI you are using?

Also, if you can set a breakpiont on that CohortDefinition.js like (around where it is trying to load the JSON into a CohortDefinition instance) you can confirm that the value attempting to be parsed is what is being returned from the WebAPI endpoint.


(Scott Fischbein) #3

Thanks Chris - turns out I was running an older version of WebAPI - when I updated that, it fixed the issue.


t