Healthcare data · Explainer

Designing an OMOP ETL: scan, specify, map, then build

Most OMOP conversions that go wrong do not fail in the SQL. They fail earlier, when nobody wrote down what a source field means, which codes matter, or what happens when the vocabulary changes next quarter. The OHDSI community has a well-tested answer: separate the design of the ETL from its implementation, and treat code mapping and maintenance as work in their own right. This is how that process works and where I would put the effort.

ExplainerSumanta Mukhopadhyay8 min read6 sources
#healthcare#omop#data
EXPLAINER · HEALTHCARE DATA · EXPLAINER5 Dec 2026 · 21:30 GST

Design and build are different jobs

The ETL chapter of The Book of OHDSI describes four steps, each owned by different people:

  1. Data experts and CDM experts design the ETL together.
  2. People with medical knowledge create the code mappings.
  3. A technical person implements the ETL.
  4. Everyone is involved in quality control.

The point of the split is focus. Designing requires deep knowledge of the source and of the OMOP Common Data Model; implementing requires knowing how to move large volumes of data efficiently. Doing both at once, the chapter warns, is how teams get stuck in detail before the logic is agreed1. In practice the most expensive mistake I see is a team writing transformation code from a verbal briefing, then discovering weeks later that a field meant something else.

DesignWhite Rabbit scanRabbit-in-a-Hat specification
MapExisting vocabulary mappingsUsagi for local codessource_to_concept_map
BuildSQL, Spark or any stack the team knowsIntermediate tables
CheckPeer reviewPerson-level traceETL unit testsCount reconciliation
Each layer has a different owner and a different artefact. The specification is the contract between them.

Step 1: scan before you specify

White Rabbit connects to the source (delimited files or common databases such as PostgreSQL, SQL Server, Oracle and Redshift) and produces a scan report: every table and field, data types, row counts, how often each field is empty and, optionally, the frequency of each value. Two defaults are worth knowing. Values appearing fewer than five times are suppressed by the "min cell count" setting, and by default 100,000 randomly selected rows per table are scanned. Both matter on sensitive data, and both should be set deliberately rather than left as they are2.

The scan describes; it does not interpret. The book's example is a sex column holding 1 and 2: White Rabbit will not tell you which is which, and the data holder has to. I treat every such question as a line item in the specification, with a named person who answered it.

Rabbit-in-a-Hat then reads the scan and lets the design team draw connections from source tables and columns to CDM tables and columns, with logic and comments on each. It generates documentation, not code. That is a feature: the output is a specification that a reviewer can read and an implementer can build from2.

Diagram of the general flow of an OMOP ETL: the person table first, then observation_period and visit_occurrence, then clinical tables such as condition_occurrence, drug_exposure, measurement, observation and procedure_occurrence
Design in dependency order: PERSON first, then visits, then the clinical event tables that reference them. Source: The Book of OHDSI · CC0

The order matters because the CDM is person-centric. Every clinical event table refers to PERSON through person_id, and the book recommends working out VISIT_OCCURRENCE before the clinical tables because they reference visit_occurrence_id. Visit logic is usually the hardest part of the design: what counts as one visit in your source rarely matches the CDM's idea of one5.

A good specification line reads like the published ETL-Synthea specification. For gender, for instance, it states that M becomes concept 8507, F becomes 8532, rows with missing gender are dropped, and why. Destination field, source field, logic and reasoning: nothing left for the implementer to guess4.

Step 2: map the codes that matter

Start by checking what the OMOP vocabularies already cover. If your source uses ICD-10-CM, for example, the "Maps to" relationships in CONCEPT_RELATIONSHIP already give you the standard concept, and no manual work is needed. I covered how those vocabularies fit together in clinical terminologies explained.

Local codes, national formularies and in-house lab codes are where the effort goes. Usagi suggests mappings from textual similarity between source descriptions and concept names, and a person with coding experience then approves, replaces or rejects each suggestion3.

Usagi screen with an overview table of source codes and suggested concepts with match scores, a selected mapping panel, and a search panel with filters
Usagi's review screen: suggested matches with scores, the selected mapping, and a search panel for finding a better concept. Source: The Book of OHDSI · CC0

The practices I would insist on all come from the book:

  • Sort by frequency. A code that is rarely used will rarely matter in a study. Map the codes that cover most of the records first.
  • Concept 0 is allowed. Some codes have no good target, and an honest 0 is better than a misleading match.
  • Check the concept's context. Look at its parents and children; an orphan concept with no hierarchy makes a poor target, because cohort definitions rely on the hierarchy.
  • Record why. Usagi supports comments on mappings. Use them, because the person reviewing next year will not remember.
  • Export only approved mappings. Usagi exports approved rows in the SOURCE_TO_CONCEPT_MAP format, with your own source_vocabulary_id, so your mappings stay distinguishable from the standard ones.

Step 3: build with whatever the team can run

OHDSI deliberately does not prescribe an implementation stack. Sites have used SQL builders, SAS, C#, Java and Kettle; the book lists ETL-Synthea, a SQL builder, alongside .NET and AWS Lambda builders. It also notes that the community gave up on an "ultimate" user-friendly ETL tool after several attempts: such tools handle most of the work, but the rest always needs code specific to the source. My rule is simpler: choose the stack the team that will maintain it already knows.

Two implementation details from the book are worth adopting. Intermediate tables, for example to assign visit_occurrence_id or to pre-resolve source codes to standard concepts, are encouraged, because mapping on the fly is slow. Relying on them after the build is not: the CDM should be complete without them. And the designers should stay available to the implementers, because logic that is obvious to the person who wrote it is often ambiguous to the person coding it.

Step 4: check against the specification

The book's quality control steps are review by a second person, tracing one person's records through source and CDM, comparing overall counts, replicating a known study, and unit tests that encode each rule in the specification as a small synthetic record. I go through the layers, including the Data Quality Dashboard, in OMOP data quality checks. The design point here is that every one of these checks needs the specification to exist. Without it, a count difference cannot be classed as a bug or an intended exclusion.

Where the specification has gaps, use the community conventions before inventing your own. The OHDSI conventions documented through the THEMIS work group answer questions such as what to do with a person who has no year of birth (drop them; missing month or day is allowed). Following them keeps your data consistent with the rest of the network6.

Plan for maintenance from day one

The book lists four triggers for ETL maintenance: the source data changes, a bug is found, a new vocabulary release appears, or the CDM itself changes. Vocabularies can have several releases in a month; the book suggests adopting a new one once or twice a year, which means rerunning the ETL and its checks.

TriggerWhat to rerunWhat to keep
New source codesUsagi with "apply previous mapping", then map only the new codesApproved mappings and their comments
New vocabulary releaseRebuild the Usagi index, find mapped concepts that are no longer standardThe vocabulary version each CDM build used
Bug in the ETLTriage by who uses the affected tables, then fix and add a unit testThe test, so the bug cannot return
New CDM versionSpecification and ETL for changed or added tablesThe previous build until the new one passes checks

The book's example of triage is a cost column rounded to whole units: minor for researchers characterising conditions, critical for health economists. Bug priority depends on who uses the data, which is one more reason to know your users before you build. If you plan to feed the CDM from FHIR, the pipeline view is in FHIR to OMOP architecture, and synthetic patient data with Synthea covers test data you can share freely.

The short version. Scan the source, write the specification before the code, map the frequent codes properly and leave the rare ones, follow the community conventions, and budget for vocabulary updates as recurring work rather than a surprise.

The CTO's take

An OMOP conversion is often budgeted as a data engineering project. The engineering is the predictable part. The cost and risk sit in the specification, the code mapping and the maintenance, which need clinical and source-system knowledge that engineers alone do not have. Staff those parts explicitly, make the specification the reviewable contract, and the build becomes routine.

If you are planning an OMOP conversion or rescuing one, I am a fractional CTO and AI architect based in India, the United States and the UAE, working globally. You can analyse your challenge and bring the result to a call.

References
  1. 1
  2. 2
  3. 3
    UsagiOHDSI
  4. 4
  5. 5
  6. 6
FAQ

Common questions

What is the first step in building an OMOP ETL?

Profile the source data before designing anything. OHDSI's White Rabbit scans tables, fields and value frequencies, and that scan report becomes the shared reference for data experts and CDM experts designing the mapping together.

Do all source codes need to be mapped to standard concepts?

No. The Book of OHDSI recommends focusing on the most frequent codes, because rarely used codes are seldom worth the effort. Mapping some codes to concept 0 is acceptable, and the remainder can be handled later as use cases need them.

Is an OMOP ETL a one-off project?

No. Source data changes, bugs are found, the OMOP vocabularies are updated, sometimes several times a month, and the CDM itself evolves. OHDSI suggests adopting a new vocabulary once or twice a year, which means rerunning the ETL and its checks.

Keep reading

Related

Open to advisory, fractional CTO & select builds

Let's talk about what you're building.

The fastest route is a free 30-minute call. Prefer to write? Send a message and I'll reply personally within two business days.

Start a conversation

How would you like to reach me?

Book a 30-min callFastest. Pick any open slot on my calendar.→ Write in GmailOpens a pre-filled draft in your browser.→ Use my email appOutlook, Apple Mail or your default client.→

I reply personally within two business days. Time zones from the Americas and Europe to the Middle East and Asia-Pacific.