Closed TheCedarPrince closed 7 months ago
Thanks @jay-sanjay for being interested in this issue! Here's a skeleton for the way to address this issue (i.e. how to create new getters):
The process of creating families of a getter function is as follows:
In this case, I can see at least a few functions we may want to create:
GetDatabaseCohorts
-- get all unique cohort IDs associated with a databaseGetCohortSubjects
-- get all subjects associated with a specific cohort IDGetCohortSubjectStartDate
-- given a cohort_id and subject_id, get their start date (should work for single subject id's or multiple id's)GetCohortSubjectEndDate
-- given a cohort_id and subject_id, get their end date (should work for single subject id's or multiple id's)The names are a bit long but that is what I am imagining! I also imagine we should make a couple additional functions for COHORT_DEFINITION but we can worry about that in a separate issue! :D Thanks for the question on this and I hope that was helpful! I'd highly suggest looking at the other source code for some of the other getters for inspiration on how to tackle this. Also, the FunSQL documentation is fantastic here: https://mechanicalrabbit.github.io/FunSQL.jl
Let me know if you have any questions! ~tcp :deciduous_tree:
It dawned on me that after running an OHDSI Cohort Expression, that oftentimes, we would just like to get the patient cohort directly from the output of that expression execution. Usually, these cohorts are stored in an auxiliary table in a given database called
cohort
. We should have a few new Getter functions which does the following:Those are at least two things I can think of now. I know sometimes cohorts will have more metadata associated with them, but I think this would be good to bring initial support to this package.