Observational Health Data Sciences and Informatics (or OHDSI) is a program to bring out the value of health data through large-scale analytics. OHDSI defines the OMOP CDM, a data warehouse database schema for storing observational medical data. It also defines a cohort expression, a JSON based format for specifying when a person’s medical records meet certain conditions. OHDSI provides a tool, Circe, for converting cohort expressions to SQL queries.
OHDSICohortExpressions.jl is a Julia library that re-implements OHDSI’s Circe. It converts a cohort expression into SQL, specialized to a given database system. It does not depend upon Circe or other OHDSI components. Instead, it uses FunSQL.jl, a Julia library for compositional construction of SQL queries. This package provides an example of how to use FunSQL to build sophisticated SQL queries programmatically.