Kyrylo Simonov delivered a talk, FunSQL : a library for the compositional construction of SQL at JuliaCon 2021 that shows how FunSQL could be used to dynamically construct queries for the OMOP CDM. Notably, Kyrylo spends a few slides discussing how to implement cohort collapse logic.
Thanks! FunSQL looks very similar to R’s dbplyr. There have been plans to integrated our DatabaseConnector package with dbplyr for some time, but no developers to work on it.