OHDSI Home | Forums | Wiki | Github

Using OHDSI Atlas WebAPI to Automatically Bulk Import Concept Sets into a Cohort Definition

Hello, everyone! After creating a new cohort definition in Atlas, I wish to bulk upload specific concept sets into this cohort definition. While I can manually import the desired concept IDs or use a JSON format of the concept set expression via the interface at https://atlas-demo.ohdsi.org/ under the concept set option, I am keen on using the WebAPI to set up a Python pipeline to achieve this task automatically. However, I haven’t been able to find a function within the WebAPI that accomplishes this. Could anyone guide me on how to achieve this through the WebAPI?

From a WebAPI perspective, all the information related to the concept set is ‘bulk loaded’, in that: You submit the inclusion rules, entry events, concept sets, etc, together and it all gets saved to the DB together. There’s no API to just add entry events, or just add inclusion rules, or just add concept sets to a cohort definition. What you’d have to do is download the expression, modify it to add your concept sets, and then post it back to WebAPI if you wanted to do this.

The reason why I think we’d be hesitant to do this in the Atals UI is that when you import concept sets, you have the option to append or overwrite (at least in one use case I can think of), although I can imagine a case where you have a different function to import a user-selected list of concepts… however, I don’t know how that would be made ‘automatic’…when you say ‘automatic’ i am imagining you mean that there’s a preset-batch of concepts that you want to import into a cohort definition on a click. I don’t know how to make that ‘make sense’ in the context of the curent UI: when you add anything, you have to make a selection of thigs (ie: a checkbox must be clicked for each thing you want). So this idea would have to be explored further to have it incorporated into the UI…otherwise using an external process that calls out to WebAPI to add concept sets would be a simpler approach.

t