Blog

    Epic FHIR Research Data Pipeline: From Approved Cohort to De-Identified Data Set

    By GauravNovember 27, 20269 mins read
    On this page

    Research teams often ask for "all the Epic data for these patients" and get either nothing for months or far more than the study can justify. Both outcomes come from treating a research extract as a one-off data request instead of a pipeline with rules about scope, identity and refresh.

    This post is for health system data teams, research informatics groups and the engineers who build for them. It explains how to scope a cohort, which approvals shape the build, how FHIR bulk export fits, and how to keep identified and de-identified data apart.

    What is an Epic FHIR research data pipeline?

    Choosing where research data should land?

    Our comparison of FHIR data stores sets out the options for holding exported FHIR data before analysis.

    An Epic FHIR research data pipeline is a repeatable process that selects an approved cohort, exports its records from an Epic customer through FHIR, stages them under access controls, and delivers a de-identified or limited data set to researchers. Agnotic Technologies builds these pipelines so every delivery can be traced to an approval and a cohort definition.

    The word pipeline matters. A study that runs for years needs the same extract logic every month, with changes recorded, not a new script each time someone asks.

    Which research questions suit FHIR data from Epic?

    FHIR data suits questions about diagnoses, medications, labs, vitals, encounters and procedures, because those map to well-defined resources. It suits less well any question that depends on free-text notes, device waveforms or workflow timestamps that the customer does not expose through FHIR.

    • Good fit: outcomes after a diagnosis, medication exposure, lab trends and visit patterns.
    • Partial fit: notes, which may be available as documents but need separate review and handling.
    • Poor fit: questions that need fields only the customer's reporting databases hold.

    Check the question against the resources the customer has enabled before promising a data set. A short feasibility query saves weeks of export work on data that is not there.

    Coding also matters. Diagnoses may arrive as ICD-10-CM, SNOMED CT or both, labs may carry local codes beside LOINC, and medications may use RxNorm or a local formulary. Record which code systems each resource actually uses at this customer before the analysis plan assumes one.

    Start with the cohort, not the export

    A research pipeline should start from a written cohort definition: inclusion and exclusion rules, date range and the data elements the protocol needs. The export follows from that definition, not the other way round.

    • Inclusion rules: diagnoses, ages, visit types and date windows, written as codes, not phrases.
    • Exclusions: opt-outs, restricted records and any population the approval does not cover.
    • Data elements: the resources and fields the analysis plan uses, each one justified.
    • Version: a cohort definition number that every delivery records.

    Turn the cohort into a group of patients on the Epic side, or into a patient list your pipeline submits, depending on what the customer supports. Either way, the list is the boundary the rest of the pipeline enforces.

    How does bulk export work?

    Bulk export works asynchronously: the pipeline asks the server to prepare files for a group of patients, waits, then downloads the results. It avoids paging through thousands of individual API calls.

    The HL7 FHIR Bulk Data Access guide defines an asynchronous export: the client sends a kick-off request, for example to [base]/Group/[id]/$export, polls a status location, then downloads output files that servers must support as newline-delimited JSON.

    • Kick-off: request an export for the cohort group, limited to the resource types the study needs.
    • Poll: check the status location at a polite interval until the job finishes or fails.
    • Download: fetch each output file, verify counts against the manifest and record checksums.
    • Incremental runs: request only records changed since the last successful export, where the server supports it.

    Not every Epic customer enables bulk export for every use. Where it is not available, agree an alternative route with the health system's reporting team rather than hammering the standard API.

    What approvals does research data need?

    Research data needs an approval that matches how identifiable the data is. Identified data usually needs patient authorization or an approved waiver, while properly de-identified data falls outside most of those rules.

    The HIPAA Privacy Rule lets covered entities use or disclose health information for research with a waiver of authorization approved by an IRB or privacy board.

    The engineering consequence is simple: the pipeline should refuse to run without an approval reference, and that reference should travel with every delivery. When an approval expires or changes, the pipeline stops until someone updates the configuration.

    Identified staging and the de-identified research store

    Keep two zones. The staging zone holds identified exports under tight access, and the research zone holds only what the approval allows the researchers to see.

    Epic research data pipeline from an approved cohort group through FHIR bulk export into an identified staging zone, then de-identification into a research store, with a governance bar covering approvals, cohort version and access review

    HIPAA allows two ways to de-identify health data: expert determination, or the safe harbor method, which removes 18 categories of identifiers.

    • Staging zone: raw exports, the patient list and the linkage key, readable by a small named group.
    • Transform step: removes or generalizes identifiers, shifts dates if the method allows, and drops unused fields.
    • Research zone: the analysis data set, with a study id in place of the medical record number.
    • Linkage key: stored apart from both zones, so re-identification needs a separate, logged request.

    How often should the research copy refresh?

    Refresh as often as the study needs and no more. A retrospective study may need a single frozen extract, while a registry may need monthly incremental loads.

    Each refresh should produce a new delivery version with counts, the cohort definition version and the approval reference. Researchers should be able to cite which delivery an analysis used, and reproduce it later.

    Keep old deliveries for as long as the study's retention rules require, and make them read-only. A paper under review may need the exact data set that produced its tables, even after newer loads have changed the counts.

    What goes wrong in Epic research pipelines?

    Research pipelines fail quietly: the data arrives, the analysis runs, and the error shows up only when results do not match a chart review.

    • Scope creep: extra resources exported because they were easy, then stored without a justification.
    • Moving cohorts: a definition edited between runs without a new version, so deliveries do not compare.
    • Lost opt-outs: patients who declined research included because the exclusion list was not refreshed.
    • Silent truncation: a failed output file skipped, so counts are short without anyone noticing.
    • Mixed zones: an identified file copied into the research workspace to fix an urgent question.

    Each of these failures is cheaper to prevent in code than to find in review. Make the pipeline fail loudly on a missing file, an unversioned cohort change or a stale opt-out list, and make the research zone reject files that did not come through the transform step.

    A worked example: a heart failure readmission study

    A research group wants to study readmissions after heart failure admissions at one health system. The cohort definition lists the diagnosis codes, the date range, adult patients only, and the exclusion of anyone who opted out of research.

    The pipeline submits the patient list as a group, exports encounters, conditions, medications and selected labs, and checks each file against the manifest. In staging, encounters are linked into admission and readmission pairs.

    The transform step replaces identifiers with study ids and drops fields the analysis plan does not use. The research team receives delivery version one with counts and the approval reference, and later monthly loads add new admissions only.

    Who owns what?

    A research pipeline needs owners on the research side, the health system side and the engineering side. Each one signs off a different part.

    • Principal investigator: the cohort definition, the data elements and the analysis plan.
    • IRB or privacy board: the approval and any conditions on identifiability.
    • Health system data team: endpoint access, the patient group and the opt-out list.
    • Engineering team: export jobs, staging, de-identification, delivery versions and monitoring.

    Name a single contact on each side for re-identification requests and for incidents. When a researcher spots a patient who should not be in the data, the path from that report to a corrected delivery should take one message, not a search for whoever built the export.

    How do you check the research data is right?

    Check it against the source on a sample before every first delivery, then automatically on each refresh. Counts alone are not enough.

    • Manifest check: every file listed by the server was downloaded and parsed.
    • Count check: patients, encounters and key resources compared with the previous delivery and explained.
    • Chart sample: a handful of patients reviewed against the source record by an authorized analyst.
    • Identifier scan: the research zone searched for names, record numbers and full dates before release.

    What are Epic research data pipeline best practices?

    Write the cohort definition first and version it, export only what the analysis plan uses, and refuse to run without an approval reference. Keep identified staging, the linkage key and the research store apart.

    Verify every export against its manifest, scan the research zone for identifiers before release, and give each delivery a version that researchers cite in their results.

    How Agnotic can help

    Agnotic builds research data pipelines for health systems and research groups: cohort groups, bulk export jobs, identified staging, de-identification, delivery versions and the checks that prove each delivery is complete. We work inside your approvals and your Epic customer's access rules.

    Build your research data pipeline with Agnotic

    We set up export, staging and de-identification that hold up to an audit.

    Sources

    Frequently Asked Questions

    Yes, for data the customer exposes through FHIR and approves for research. Bulk export suits cohorts, while the standard API suits small, targeted pulls.

    Talk to an engineer about your project

    Share your cohort definition and approval scope. We will outline the export, staging and de-identification steps.

    Go deeper

    Services and solutions on this topic