Healthcare ETL: Architecture, Mapping and Implementation, and When ELT Wins (2026)
CTO & Co-Founder
CTO & Co-Founder at Nirmitee.io. Leads US healthcare integration work across EHRs, payers and clearinghouses: X12 claims, eligibility, ERA posting, prior auth and FHIR, plus ABDM and NHCX in India. Writes from builds the team has taken live.

Updated November 2026
Short answer. Healthcare ETL means extracting data from systems such as the EHR, labs and claims, transforming it into clean, standard tables, and loading it into a warehouse. Today most teams use the ELT pattern: they load the raw data first and transform it inside the warehouse, so they can fix a mapping and run it again. This guide shows the architecture, a real source-to-target mapping, common transformations, incremental loads and the tests that keep the data right.
What is healthcare ETL?
ETL stands for extract, transform, load:
- Extract: pull data from source systems, such as an EHR's FHIR API, HL7 v2 feeds, lab interfaces and X12 claim files.
- Transform: clean it, map codes and units to standards, match patients, remove duplicates and reshape it into tables.
- Load: write the result into a warehouse where reports, dashboards and AI models read it.
Healthcare ETL is harder than ETL in most industries for three reasons. Every source uses its own codes. Records get corrected after the fact. And the data is protected health information, so access and audit rules apply at every step. For the whole flow from source to report, read our healthcare data pipeline guide. To hire a team, see our healthcare data warehouse services.
ETL vs ELT in healthcare: which should you choose?
In ETL, data is transformed before it reaches the warehouse. In ELT (extract, load, transform), raw data is loaded first and transformed inside the warehouse, often with dbt.
| ETL | ELT | |
|---|---|---|
| Where the transform runs | A separate engine before the warehouse | Inside the warehouse |
| Raw data | Often not kept, unless you add a raw store | Kept in raw tables by design |
| Fixing a mapping mistake | Usually needs a new extract from the source | Fix the SQL and rebuild from raw |
| Schema changes at the source | Can break the transform step | Raw tables absorb them, models change later |
| Best fit | Heavy cleansing before data enters the warehouse, or a warehouse with little compute | Modern cloud warehouses and teams that work in SQL |
| Watch out for | Lost history and slow fixes | Protected data sitting in raw tables, so access must be tight |
Our view: for most healthcare analytics in 2026, use ELT with a raw layer you never edit. Use ETL-style cleansing before the warehouse only where a rule says certain data must not enter it, for example data a patient's consent excludes.
A note on HIPAA. HIPAA does not tell you to keep raw source messages. It requires safeguards for protected health information and keeps its own documentation rules. How long you keep raw data depends on state law, contracts and your own policy. Keep raw data because it makes your pipeline fixable and auditable, and write a retention rule for it.
Healthcare ETL architecture: the layers
Most healthcare warehouses use four layers. Each one has a single job.
| Layer | What it holds | Who changes it |
|---|---|---|
| Raw | Data exactly as extracted, with source and load time | No one. The pipeline only adds to it |
| Staging | One clean table per source table: renamed columns, correct types, parsed JSON | The data team, in code |
| Intermediate | Joined and mapped data: patients matched, codes standardized, units converted | The data team, in code |
| Marts | Tables built for questions: patients, encounters, lab results, claims, measures | The data team, with the business owner |
Name things the same way in every layer, put every transformation in version control, and run every change through review and tests.
Source-to-target mapping: a worked example
A source-to-target mapping says, for every column in the target table, where it comes from and how it changes. Write it before you code, and keep it next to the code.
Here is part of a mapping for a lab results table, from an HL7 v2 ORU feed:
| Target column | Source | Rule | Test |
|---|---|---|---|
| patient_key | PID-3 (patient identifier) | Look up the master patient key for this source and identifier | Not null, exists in patients |
| loinc_code | OBX-3 (observation identifier) | Map the local code to LOINC with the mapping table | Not null, valid LOINC, unmapped codes go to a queue |
| result_value | OBX-5 (observation value) | Convert to a number when OBX-2 is NM. Keep text results in result_text | Numeric when the type is NM |
| result_unit | OBX-6 (units) | Map to UCUM | In the allowed unit list for this LOINC code |
| abnormal_flag | OBX-8 (abnormal flags) | Map H, L, A and others to readable values | In the accepted values list |
| result_status | OBX-11 (result status) | F to final, C to corrected, P to preliminary | In the accepted values list |
| result_time | OBX-14, or OBR-7 if empty | Parse with the sending facility's time zone, store in UTC | Not in the future, not before birth date |
| source_message_id | MSH-10 (message control ID) | Copy as is | Unique per source and version |
And the same record before and after (all data is made up):
| Field | Raw HL7 v2 | Warehouse row |
|---|---|---|
| Patient | PID-3: 778812^^^LAB_A | patient_key 10482 |
| Test | OBX-3: K^Potassium^LOCAL | loinc_code 2823-3, Potassium [Moles/volume] in Serum or Plasma |
| Value and unit | OBX-5: 5.9, OBX-6: mEq/L | 5.9, mmol/L |
| Flag | OBX-8: H | High |
| Status | OBX-11: F | final |
| Time | OBX-14: 20261014083000 (sender in US Central time) | 2026-10-14 13:30 UTC |
Potassium in mEq/L and mmol/L has the same numeric value, so only the unit label changes. That is not true for every test, which is why the unit rule lives in the mapping table, test by test.
The transformations that take the most time
| Problem | Before | After | How |
|---|---|---|---|
| Local codes | GLU, GLUC, 1001 | LOINC 2345-7 | Mapping table, reviewed by a clinical informaticist |
| Units | mg/dl, MG/DL, mg% | mg/dL (UCUM) | Unit mapping, plus conversion where the scale differs |
| Dates and time zones | 20261014083000 with no zone | 2026-10-14 13:30 UTC | Use the sender's time zone, store in UTC |
| Names and addresses | DOE^JANE^A | family: Doe, given: Jane | Parse HL7 components, keep the raw value |
| Duplicates | Same result sent twice | One row | Key on source, message ID and version |
| Corrections | A final result, then a corrected one | Two versions, the newest marked current | Keep history, do not overwrite |
| Diagnosis codes | E11.9 with and without the dot | E11.9 | Normalize format, validate against the code set |
Incremental loads: only what changed
Reloading everything every night gets slow and expensive. Load only new and changed records, and handle the ones that arrive late.
- Watermark. Remember the last load time or the highest change ID, and extract only records after it.
- Change data capture (CDC). Where the source database allows it, read its change log instead of querying tables.
- Late data. Look back a safe window, such as three days, on every run, because claims and corrections arrive late.
- Corrections. Insert a new version and mark the old one as replaced. Never update a row in place without history.
A simple dbt incremental model for lab results:
{{ config(materialized='incremental', unique_key='result_version_key') }}
select
source_system || '|' || source_message_id || '|' || result_version as result_version_key,
patient_key, loinc_code, result_value, result_unit,
abnormal_flag, result_status, result_time, loaded_at
from {{ ref('int_lab_results_mapped') }}
{% if is_incremental() %}
-- look back three days so late and corrected results are picked up
where loaded_at > (select max(loaded_at) - interval '3 days' from {{ this }})
{% endif %}
Testing healthcare ETL
Test every load. A failed test must stop the load or send records to a queue. A log line alone is not enough.
| Test | Example | What it catches |
|---|---|---|
| Not null | patient_key, loinc_code, result_status | Broken lookups and missing data |
| Unique | result_version_key | Duplicate loads |
| Accepted values | result_status in final, corrected, preliminary, cancelled | Unmapped status codes |
| Relationships | Every lab result has a patient in the patients table | Matching failures |
| Ranges | Heart rate between 20 and 300 | Unit mix-ups and typos |
| Freshness | The newest result is less than six hours old during the day | A feed that stopped |
| Reconciliation | Rows loaded equal messages received, per source per day | Silent drops |
In dbt, the first four are a few lines of YAML:
models:
- name: fct_lab_results
columns:
- name: result_version_key
tests: [unique, not_null]
- name: patient_key
tests:
- not_null
- relationships: {to: ref('dim_patients'), field: patient_key}
- name: result_status
tests:
- accepted_values: {values: ['final', 'corrected', 'preliminary', 'cancelled']}
For rules beyond the warehouse, our healthcare data quality guide covers metrics, exception queues and ownership.
Running it in production
- Schedule and order. Run staging before intermediate before marts, and stop downstream steps when a test fails.
- Monitor. Alert on failed runs, stale data, rising exception queues and reconciliation gaps.
- Backfill. When a mapping changes, rebuild the affected tables from raw, and tell report owners what changed.
- Protect the raw layer. Raw and staging tables hold identifiers. Limit access to the data team, log every query, and give analysts marts with only the fields they need.
- Document. Keep the mapping, the tests and a short description of each table in the same repository as the code.
Common mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| No raw layer | A mapping bug means asking the source to resend months of data | Keep raw data and rebuild from it |
| Mapping only in code | Business users cannot check the rules | Keep a readable mapping table next to the code |
| Ignoring time zones | Results appear on the wrong day | Store UTC, keep the source zone |
| Overwriting corrections | Reports change with no trace | Keep versions |
| Full reloads every night | Slow loads and high cost | Incremental loads with a look-back window |
| Tests that only log | Bad data reaches reports | Tests that stop the load or quarantine records |
An implementation plan
- List sources and questions. Which systems, which tables, and which reports or models need them first.
- Write the mappings for the first two or three target tables, and agree them with the people who will use the data.
- Build the raw layer and the first extracts, with source and load time on every record.
- Build staging and intermediate models, starting with patients and one clinical table, such as lab results.
- Add tests and reconciliation before the first mart goes to users.
- Build the first mart and have its owner check the numbers against a source they trust.
- Add incremental loads, monitoring and alerts, then the next table.
Tools teams commonly use
| Job | Common choices |
|---|---|
| Extract | Interface engines (Mirth Connect, Open Integration Engine), FHIR Bulk Data export, CDC tools, file transfer |
| Transform | dbt, Spark, SQL |
| Warehouse | Snowflake, BigQuery, Databricks, Postgres |
| Orchestration | Airflow, Dagster, dbt Cloud jobs |
| Testing | dbt tests, Great Expectations |
For a lakehouse approach, see our Databricks healthcare lakehouse guide and Delta Lake for healthcare data.
How Nirmitee helps
We design and build healthcare ETL and ELT: source extracts, mappings reviewed with your clinical team, dbt models, tests, incremental loads and monitoring. See our healthcare data engineering services. Or book a data assessment: we review your sources, mappings and tests, and tell you what to fix first.
Ready to scale?
Talk to our healthcare engineering team about building, integrating, and shipping faster.
Frequently Asked Questions
What is ETL in healthcare?
What is the difference between ETL and ELT in healthcare?
Is ELT better than ETL for healthcare data?
What is a source-to-target mapping?
How do you handle corrected lab results in ETL?
Does HIPAA require keeping raw source data?
Which tools are used for healthcare ETL?


