Open eleroel opened 1 year ago
This cohort includes concepts Ids for measurements in LOINC vocabulary such as: • Detected, Concept ID: 45877985 • Positive, Concept ID: 45884084 • Present, Concept ID: 45879438 However in the json file generated using toJson, these concepts ids are: 45877990, 45884080, and 45879440, respectively
Looks like a numerical precision issue during transformation from list to json.
The issue is probably happening here
validJsonExpression <- RJSONIO::toJSON(cohort$expression)
try
validJsonExpression <- RJSONIO::toJSON(cohort$expression, digits = 23)
That should fix it
(i.e. its probably an issue of RJSONIO, not ROhdsiWEbApi)
In the ROhdsiWebApi documentation for getCohortDefinitionExpression, it says that this function has been deprecated. To obtain a definition expression, it is suggested to use the following: 1) cohortDefinition <- getCohortDefinition(baseUrl = baseUrl, cohortId = cohortId) 2) validJsonExpression <- RJSONIO::toJSON(cohortDefinition$expression) 3) save validJsonExpression object as .txt
However, when saving the cohortDefinition expression, concepts ids >10^8 are not saved properly, the number is rounded.
Here is an example:
This cohort includes concepts Ids for measurements in LOINC vocabulary such as: • Detected, Concept ID: 45877985 • Positive, Concept ID: 45884084 • Present, Concept ID: 45879438 However in the json file generated using toJson, these concepts ids are: 45877990, 45884080, and 45879440, respectively.