OHDSICohortExpressions.jl

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.

3 Likes

OHDSICohortExpressions.jl v0.1 – Proof of Concept

At this time, this implementation is able to convert all 797 cohorts from PhenotypeLibrary v0.1 to generate SQL that works against Amazon RedShift, Microsoft SQL Server, and PostgreSQL. There are still gaps in functionality. When OHDSICohortExpression encounters an expression it cannot yet convert, it raises an assertion error.

2 Likes