OHDSI / ROhdsiWebApi

An R package for interfacing with a WebAPI instance
https://ohdsi.github.io/ROhdsiWebApi
10 stars 17 forks source link

Update to postDefinition() to tolerate missing JSON variables #245

Closed DrTTrousers closed 1 year ago

DrTTrousers commented 2 years ago

GetPostDeleteDefinition_postDefinition.txt

Hi,

I was trying to parse loads of concept sets into ATLAS, using concept mapping from CapR and CirceR in the R environment. I encountered an issue, in that the postConceptSetDefinition() function didn't accept the s4 objects created in CapR, and the CirceR JSON output was missing the concept definition variables (from the set of "isExcluded", "includeMapped", "includeDescendants") if these variables were set to FALSE throughout.

This resulted in the postDefinition() function failing when it tried to manipulate the columns (as they weren't there). To correct this, I cloned the package and updated the postDefinition() function to first check if these columns are present, and create them if not before proceeding, defaulting to FALSE.

Its a small, probably niche use case admittedly, but if users are generating concept sets in R using CapR tools I believe this modification is valuable, and has no effect if the columns were present in a JSON as expressed in the documentation.

(also this is my first contribution to someone elses GitHub package, so please advise) #248

gowthamrao commented 1 year ago

Closed thru https://github.com/OHDSI/ROhdsiWebApi/commit/b03b58d28683257c690af513a8a541a3df823af9