JuliaHealth / OMOPCDMCohortCreator.jl

Create cohorts from databases utilizing the OMOP CDM
https://juliahealth.org/OMOPCDMCohortCreator.jl/stable
Other
8 stars 7 forks source link

[FEATURE] Overhaul Usage of `GenerateTables` #51

Open TheCedarPrince opened 1 year ago

TheCedarPrince commented 1 year ago

GenerateTables() is a rather odd function that I think can be made much more into a utility function that operates in the background. What it does is create for OMOPCDMCohortCreator.jl an internal representation of the tables available within the schema being accessed via a given connection. This internal representation are SQLTable objects that originate within FunSQL.

I think what we can do instead is to add OMOPCommonDataModel as a dependency. From there, we can access and export every single table from that package and within CohortCreator, convert the table structs within OMOPCommonDataModel to FunSQL tables. This could be triggered during the GenerateDatabaseDetails function.

Additionally, we can keep this function in case someone needs to modify further the table connection.

TheCedarPrince commented 1 year ago

It also just dawned on me that we will want to add OMOPCommonDataModel as a conditional dependency as well -- this will be somewhat tricky and may need to be a second issue altogether.