Healthcare data comes from various systems like electronic health records (EHRs), laboratory systems, pharmacies, medical imaging systems, and billing applications. And each system may use different data structures, naming conventions, and clinical coding standards.
For example, consider two hospitals storing information about patients diagnosed with type 2 diabetes.
| Hospital A | Hospital B |
|---|---|
| patient_id | patient_number |
| diagnosis_date | condition_start_date |
| diagnosis_code | clinical_code |
| E11.9 (ICD-10-CM) | 44054006 (SNOMED CT) |
How do we combine data from these hospitals to conduct clinical research or build healthcare AI applications?
The Observational Medical Outcomes Partnership Common Data Model (OMOP CDM) addresses this problem by providing a common structure and standardized clinical vocabularies.
In this tutorial, we’ll build an ETL pipeline using PySpark to transform synthetic healthcare data into OMOP CDM tables, validate the transformed data, and perform clinical analytics.
We’ll use the synthetic healthcare dataset generated in my previous freeCodeCamp tutorial, How to Generate Synthetic Healthcare Data Using Synthea – A Hands-On Tutorial. If you haven’t generated the dataset yet, I recommend following that tutorial before proceeding.
You can follow along with the accompanying Jupyter notebook, which contains the complete implementation.
What We’ll Cover
- Prerequisites
- What is OMOP CDM?
- Understanding the OMOP Common Data Model
- How to Build the Healthcare Data Standardization Pipeline
Prerequisites
To follow along with this tutorial, you should have a basic understanding of Python, SQL, and DataFrame operations. We’ll use Synthea, OMOP CDM v5.4, OHDSI ATHENA, PySpark, and Jupyter Notebook.
The entire pipeline runs locally, so you don’t need access to real patient data or cloud infrastructure.
What is OMOP CDM?
OMOP CDM stands for Observational Medical Outcomes Partnership Common Data Model. It’s an open data model maintained by the Observational Health Data Sciences and Informatics (OHDSI) community.
It enables healthcare data from different sources to be represented consistently for clinical research and analytics.
OMOP addresses two types of data standardization: structural and semantic.
Structural Standardization
Different healthcare systems may store patient information using different table names, column names, and data types. OMOP provides a common structure for representing this information.

Regardless of the source structure, the transformed data follows a common model.
Semantic Standardization
Having the same table structure isn’t enough if hospitals use different clinical codes to represent the same medical condition. OMOP uses standardized vocabularies to ensure that clinical information can be interpreted consistently across systems. This process is known as semantic standardization.

Understanding the OMOP Common Data Model
OMOP CDM organizes healthcare data into several categories, including clinical data, healthcare system data, health economics, standardized vocabularies, and metadata.
For this tutorial, we’ll focus primarily on clinical data.
| OMOP Table | Description |
|---|---|
PERSON | Patient demographic information |
VISIT_OCCURRENCE | Healthcare encounters, such as hospital admissions and outpatient visits |
CONDITION_OCCURRENCE | Diseases, diagnoses, signs and symptoms |
DRUG_EXPOSURE | Medications prescribed or administered |
PROCEDURE_OCCURRENCE | Medical and surgical procedures |
MEASUREMENT | Laboratory results, vital signs, and other measurements |
OBSERVATION | Other clinical facts, such as smoking status or family history |
OBSERVATION_PERIOD | Periods during which patient events can be captured |
These tables are connected through identifiers such as person_id and visit_occurrence_id, allowing us to connect a patient’s encounters, diagnoses, medications, and laboratory results.
You can explore the complete data model in the official OMOP CDM v5.4 documentation.
What Are Clinical Vocabularies and ATHENA?
A clinical vocabulary is a standardized collection of medical terms and codes used to represent healthcare information.
Some commonly used clinical vocabularies include SNOMED CT for diagnoses and clinical findings, LOINC for laboratory tests, RxNorm for medications, and UCUM for measurement units.
OMOP brings these vocabularies together and assigns each concept a unique identifier called concept_id.
ATHENA is OHDSI’s platform for exploring and downloading these standardized vocabularies. We’ll use the downloaded vocabulary files as reference data in our ETL pipeline.
How to Download OMOP Standardized Vocabularies from ATHENA
Create an account on ATHENA, and navigate to the vocabulary download section.
- Select SNOMED CT, LOINC, RxNorm, RxNorm Extension, UCUM, and the supporting vocabularies for demographics, visit types, and clinical record types.
- Create a bundle named
synthea_omop_vocabulary. For this tutorial, I’m using releasev20260829. Leave the Delta from Older Version option unchecked to download the complete bundle. - Once downloaded, extract the ZIP file. We’ll primarily use
CONCEPT.csv, which contains clinical concepts, andCONCEPT_RELATIONSHIP.csv, which contains relationships and mappings between concepts.
Although these files have a .csv extension, they’re tab-separated.
Note: Due to vocabulary-specific licensing restrictions, the downloaded vocabulary files aren’t included in the GitHub repository. Download them directly from ATHENA after accepting the applicable licensing terms.
How to Build the Healthcare Data Standardization Pipeline
Now that you understand OMOP CDM and have downloaded the standardized vocabularies, let’s build our ETL pipeline using PySpark.
The pipeline has four main stages: ingestion, transformation, validation, and storage.
Step 1: Set Up the Development Environment
Create the following directory structure:
omop-cdm/
├── synthea_to_omop.ipynb
├── requirements.txt
├── .gitignore
└── data/
├── synthea/
├── vocabulary/
└── omop/
The synthea directory contains the source healthcare data, the vocabulary directory contains the downloaded OMOP standardized vocabularies, and the omop directory will contain the transformed healthcare data in OMOP CDM format.
With this directory structure in place, you have the foundation for the ingestion, transformation, validation, and storage stages of the pipeline.