Circe is the component of OHDSI that converts cohort expressions into SQL. Circe takes JSON formatted cohort expressions, available in Atlas, and produces SQL for populating the cohort table with matching subjects.
OHDSICohortExpressions.jl is an Apache licensed Julia library that re-implements OHDSI’s Circe. It converts a cohort expression into SQL, specialized to a given database system. Although written in Julia, this library can be used directly from R. It does not depend upon Circe, SQLRender, or other OHDSI components. Instead, it uses FunSQL.jl, a Julia library for compositional construction of SQL queries.
We hope the OHDSI community will be interested in an independent implementation of executable cohort expressions. OHDSICohortExpressions does not reproduce the queries generated by Circe, but the queries it generates should produce the same cohorts. An independent implementation can act as a validity check to assure that SQL translation is correct. If, for any cohort expression and database, our library produces a different result, please report this discrepancy so that we could investigate.