Skip to main content
EncodeBox is a semantic layer for healthcare analytics on FDA Sentinel CDM v8.2.2. It generates SQL at query time rather than materializing intermediate tables.

Design principles

YAML connectors map data to FDA Sentinel CDM v8.2.2 table structures with standardized code types ("10" ICD-10, "C4" CPT, "ND" NDC).
SQL is generated dynamically at query time and runs directly on raw data — no intermediate table management.
Three interoperable layers: Table/ColumnEventFrameCohort. Shared IR and one compiler to SQLAlchemy. Lazy until .to_df() / .to_sql() / .attrition().
Single API across PostgreSQL, Redshift, Snowflake, BigQuery, and MySQL. Dialect-specific SQL is handled internally.

Layers

Preferred path: YAML connector → Database → author at Layer 0/1/2 → shared IR → one compiler → SQLAlchemy → DataFrame.

Core components

Consecutive gaps

EventFrame.occurring(gap_days=N) uses lead() over ordered distinct dates — not span (max − min). See Which API? and Migration.

Transparent SQL

All generated SQL is inspectable via .to_sql() and .explain() before you call .to_df().