We’re interested in supporting many projects in a single OHDSI tools / web API enviroment, satisfying these basic requirements:
-
Cohorts / user data created for one project are not (at least by default) visible in other projects.
-
Users can create their own data for the project matching the OMOP schema, and merge it with the main dataset in OMOP, without affecting other projects. This will allow users to create their own observations about people and use them in a subsequent cohort building or analysis.
-
We do not want to make a copy of the main dataset for every project, or spin up separate databases or servers for each project.
One approach to doing this would be adding row-level security to both WebAPI and OMOP tables, based on some new fields indicating the project owners of those rows. This could work, but isn’t super-portable, and there are some concerns about how it would perform.
Another approach, which we think may work better, is:
-
Dynamically create a schema for each project, containing all the user created WebAPI tables (e.g. cohort_definition), that only that project can access. (These would need to be deleted when a project is deleted.)
-
In the same schema (or perhaps a second schema), create project-specific tables with definitions matching the OMOP tables with some prefix (e.g. project_observation, project_measurement), and create views with names matching the names of the OMOP tables, doing a UNION between the OMOP tables and the project tables.
-
Change WebAPI so that the schema used to access cohorts, etc. and the schema used to access OMOP can be dynamically replaced based on the project being used.
(There may be some limits on number of schemas per database, which may necessitate creating more databases and sharding projects across them; otherwise this should scale reasonably well.)
Has anyone attempted to do this sort of thing before? Is there a better way of supporting projects with separate data in a single instance?
Thanks!
Dan Rodney
Verily Life Sciences