Blog

    Healthcare Data Warehousing

    By GauravNovember 13, 202610 mins read
    On this page

    A health system that copies last night's EHR extract, a claims file, and a device feed into one database has not finished a warehouse. Analysts still cannot tell which row is the current medication list, which database is allowed to store a patient name, or what to do when a lab result arrives three days late.

    Healthcare data warehousing is the set of decisions that make that copy usable: which model the tables follow, which zone still holds protected health information, and how each source refreshes. This guide is for hospital data teams and digital health companies building the store.

    What is healthcare data warehousing?

    Building a clinical warehouse?

    Agnotic Technologies designs the model, the PHI zones, and the refresh jobs that copy EHR, claims, and device data into a queryable store.

    Healthcare data warehousing is the design of a store that copies clinical, claims, and device data out of live systems so analysts can query history without touching the chart. The build starts with three choices: the data model (FHIR, OMOP, or custom), which zone still holds protected health information, and how often each source refreshes.

    The live EHR stays the system of record for care. The warehouse is a second store, built so a quality team, a researcher, or a product analyst can ask a question that would be reckless to run on production. If the copy cannot name its grain (what one row represents), its as-of time, and its privacy zone, it is an extract. Write those three on the table.

    Should the warehouse use FHIR, OMOP, or a custom model?

    Choose the model from the questions you will ask, not from the format of the extract. A FHIR-shaped store suits chart reconstruction and partners who already speak HL7 FHIR. The OMOP Common Data Model suits observational research. A custom model suits one operational metric you have already defined in writing.

    Four layers of a healthcare data warehouse: source systems such as the EHR, claims, and devices; a raw landing zone that keeps files as received; a PHI warehouse with access control and audit; and a de-identified mart with separate credentials

    A FHIR-shaped warehouse keeps resources close to what a bulk export already returns: Patient, Encounter, Condition, Observation, MedicationRequest, with references left intact. It is a poor fit when analysts need one person-level research row and will not follow resource references. OHDSI's OMOP Common Data Model is the opposite bet. Its privacy note describes a person-centric model and points implementers at HIPAA de-identification, including date shifting and ZIP truncation, so a research table can leave the PHI zone. A custom fact table is justified only when both of those shapes hide the grain you need, for example one row per open result with an owner and an age in hours.

    • FHIR-shaped tables: Keep resources and references when the next consumer is an app, a bulk export, or a partner on HL7 FHIR.
    • OMOP tables: Use the OHDSI model when the work is observational research across a shared person, visit, condition, drug, measurement, and procedure pattern.
    • Custom fact: Build a narrow table only for a metric with a written definition, an owner, and a known grain.
    • Raw files stay: Store the file or message as received so a bad transform can be replayed without asking the EHR for yesterday again.
    • One model first: Do not load FHIR, OMOP, and a custom star in the same quarter. Finish one use case, then add a second shape.

    How do you separate PHI zones in a warehouse?

    Split the platform into a raw landing zone, a protected zone that still contains identifiers, and a mart that was de-identified or limited on purpose. People and jobs receive credentials for one zone. A convenience view that joins all three is a design defect, not a shortcut.

    45 CFR 164.514(a) states that health information which does not identify an individual, and for which there is no reasonable basis to believe it can be used to identify an individual, is not individually identifiable health information. Section 164.514(b) allows two methods: expert determination, documented by someone with appropriate statistical knowledge, or Safe Harbor removal of the listed identifiers plus no actual knowledge that the remaining data could still identify someone. If you keep a code to re-identify, 164.514(c) says the code is not derived from information about the person, and the mechanism is not disclosed for another purpose.

    • Landing zone: Immutable files as received, a short retention, and access limited to the pipeline identity.
    • PHI warehouse: Names, medical record numbers, and exact dates, with a unique user id and an audit of queries.
    • De-identified mart: No direct identifiers, separate credentials, and no analyst-visible key back to the PHI zone.
    • Limited data set: Dates or some geography may remain only under a data use agreement, not as the default analyst copy.
    • Re-identification: The code and the method live with a named privacy owner, not in the mart schema.

    How should source data refresh into the warehouse?

    Refresh on a watermark you can explain: a source updated time, a message time, or a file sequence. Full reloads fit small dimensions. Clinical facts need incremental loads plus a written window for late and corrected results.

    The failures are ordinary and costly. A lab interface voids yesterday's value and the warehouse keeps both, so a measure double counts. An ADT discharge arrives before the admission because two feeds use different clocks. A claims file restates a month and the job treats every line as new. Before the first schedule, write the business key, the version column, and whether a correction replaces a row or appends a new version. Keep the source timestamp beside a warehouse timestamp stored in one timezone.

    • Business key: Patient, encounter, order, and placer or filler number, documented per source system.
    • Late window: How many days a result may arrive and still update the visit it belongs to.
    • Voids: A status on the row, not a silent delete, so a prior load can be rebuilt.
    • Restatements: Claims files that replace a month are applied as a version, not appended as extra encounters.
    • Replay: A load id on every row so one bad batch can be removed without rebuilding the zone.

    What fails when clinical facts do not match?

    Facts fail when two sources disagree and the warehouse picks a winner without a written rule. The medication list, the problem list, and the encounter diagnosis are the usual collisions, and so is the patient identity itself.

    Epic, Oracle Health (Cerner), and athenahealth do not share one patient identifier. A join on name and date of birth will merge the wrong people and split the right ones. Match on a governed enterprise id where you have one, keep every source id, and send unmatched rows to a queue a person reviews. Store both conflicting values and a reason code. Do not average a lab panel into a single number because two rows were inconvenient.

    • Person: Enterprise id first, then a reviewed match. An unlogged name join is not a matching strategy.
    • Encounter: Account number and visit number, plus a rule for merged or cancelled visits.
    • Codes: Local codes mapped to a standard, with unmapped codes counted and retained, not dropped.
    • Time: Result time, specimen time, and signed time stay as separate columns. The metric names which one it uses.
    • Conflict: Both values remain, with the rule that chose the one shown on the mart.

    Which controls does the HIPAA Security Rule expect on the warehouse?

    If a zone holds electronic protected health information, 45 CFR 164.312 applies to that zone the same way it applies to the EHR. Calling the database a warehouse does not lighten the technical safeguards.

    Section 164.312 names five technical safeguards: access control, audit controls, integrity, person or entity authentication, and transmission security. Access control includes a unique name or number for each user. Audit controls require mechanisms that record and examine activity in systems that contain or use ePHI. Integrity is protection from improper alteration or destruction. Authentication verifies that the person or job seeking access is the one claimed. Transmission security covers the path from the EHR, the payer, or the device into the landing zone. Encryption is addressable, which means you implement it when reasonable or you document an equivalent. A shared SQL login for the analytics team fails the unique user identification specification on its face.

    • Access: Named people and named pipeline identities. No shared password on the PHI zone.
    • Audit: Who ran a query, which zone, when, and whether identifiers came back.
    • Integrity: A checksum on each landed file and a load log that is append-only.
    • Authentication: The job that reads the EHR feed is a known identity, not an anonymous copy script.
    • Transmission: The feed into landing is protected in transit, or an equivalent control is written down.

    What should the first warehouse use case include?

    The first use case should be one question, one population, and a definition of done small enough to expose identity, coding, and late-data problems. A warehouse with no question becomes a copy of every table the EHR will export.

    Pick a question the organization already answers by hand, such as open results older than an agreed age, or one quality denominator a nurse abstractor already counts. Write the inclusion rules, the code sets, and the as-of time. Load only the sources that question needs. If the warehouse cannot reproduce last month's hand count within a tolerance the clinical owner accepts, do not add a second question. The tolerance is an agreement with that owner. It is not a gap you close by editing rows before a meeting.

    How do you test a healthcare data warehouse?

    Test by replaying a known week of source messages and comparing counts, then by tracing individual patients from the raw file to the mart.

    Take a week of ADT, orders, results, and the claims file. Count patients, encounters, and results in the source and in each zone. Then follow a few patients from the raw file through the PHI tables to the mart, including a void, a merge, a late correction, and an unmapped code. A mart role must not be able to select names. If the counts match and that join still works, the warehouse fails.

    How Agnotic can help

    Agnotic Technologies builds the warehouse for the client: the model decision, the zone split, the refresh jobs, and the replay tests. Agnotic does not stop at a diagram and leave the load jobs for a later phase. The pipeline, the audit of queries against the PHI zone, and the de-identification step ship together.

    When a team already has nightly extracts, the work starts from the question the store must answer. Unlogged name joins are replaced with a match queue, a written grain, and a load id that makes a bad batch removable.

    Put a real question on the warehouse

    Plan the model, the zones, and the first load with our engineers, or read the data engineering guides.

    Related reading on Agnotic

    Go further on a FHIR to OMOP pipeline, EHR analytics, large-scale clinical data, and the operational EHR database underneath the extract.

    Sources

    Frequently Asked Questions

    A lake can hold the raw files. A warehouse adds a declared grain, a refresh rule, and a privacy zone so a query returns one version of a fact. Many programs keep both: files in the landing zone, and modeled tables in the warehouse.

    Talk to an engineer about your project

    We build clinical warehouses with a declared model, separate PHI zones, and refresh jobs you can replay.

    Go deeper

    Services and solutions on this topic