• Healthcare
  • 3 tables
  • 11,189 rows
  • 7 formats
  • synthetic data

Electronic Health Records Dataset

This ready-made synthetic dataset provides a sample of electronic health records data for developers and testers. It contains 11,189 rows and 23 columns, covering patient demographics, visit details, and diagnoses. Preview rows are available for free, with full download requiring credits.

  • last updated 13 Oct 2026
  • by GoMask
  • Dataset includes 11,189 rows and 23 columns.
  • Covers patient demographics, visit types, and diagnoses.
  • Data ranges from 2010-01-03 to 2024-06-30.
  • Available in CSV, Excel, SQL, and other formats.
  • Free sample rows available for preview.

At a glance

  • 3tables
  • 11,189rows
  • 23columns
  • Jan 2010 – Jun 2024date range

The 3 tables

preview and data dictionary per table

Patients patients · table · 1,000 rows

Contains demographic and insurance information for 1,000 synthetic patients.

Preview

First 10 of 1,000 rows of the Patients table
patient_iduuidfirst_namestringlast_namestringdate_of_birthdategenderstringaddressstringcitystringstatestringzip_codestringethnicitystringinsurance_providerstring
7e3675aa-1a40-4d95-8168-e8349e87334bDavidThompson2002-02-22Male123 Oak AvenueLas CrucesNM88001Black or African AmericanUnitedHealthcare
3f40ade4-21df-470b-a0c2-28aadfd30b25MichaelPeterson2003-03-22Male456 Pine StreetProvidenceRI02903WhiteBlueCross
5f765331-a9b8-46bf-961c-1b6b38b0e09cJamesTaylor2015-12-06Male789 Maple DriveCharlestonWV25301WhiteUnitedHealthcare
0a037b2b-79d2-4a2b-94c2-00e7286dbfaeRobertPerez2008-05-29Male101 Elm RoadMobileAL36602Hispanic or LatinoUnitedHealthcare
9594668e-7ba4-441f-b5bb-9b069c1e7326WilliamTorres2020-06-05Male202 Birch LaneBismarckND58501Black or African AmericanAetna
fe6c0677-8787-44ee-b0f9-17186b56f8b6JosephPatel2011-06-10Male303 Cedar CourtFargoND58103WhiteUnitedHealthcare
3bbe022f-9d5b-40ef-8d3a-2d94ec522127CharlesTurner2006-03-08Male404 Spruce WayAnchorageAK99501WhiteAetna
d8e13ccd-e538-4c97-81c6-c10d95abf9c8ThomasPrice2005-02-24Male505 Walnut StreetRichmondVA23218WhiteUnitedHealthcare
fd9abd04-426f-49a2-be78-122d3ca93c0cChristopherThompson2009-05-09Male606 Cherry BoulevardDetroitMI48201Black or African AmericanUnitedHealthcare
e28b2c96-e8fa-4c97-bb70-d468e70eda58DanielTaylor2010-03-31Male707 Poplar AvenueNewarkNJ07102WhiteAetna
10 of 1,000 rows · 11 columns

Data dictionary

Data dictionary for the Patients table
columntypedescriptionexamplenull %
patient_iduuidPrimary identifier uniquely assigning each patient record.unique7e3675aa-1a40-4d95-8168-e8349e87334b0%
first_namestringGiven first name of the patient.David0%
last_namestringSurname or family name of the patient.Thompson0%
date_of_birthdateDate of birth of the patient between 2000-01-01 and 2023-12-31.2002-02-220%
genderstringIdentified gender of the patient.Male0%
addressstringResidential street address of the patient.123 Oak Avenue0%
citystringCity of residence.Las Cruces0%
statestringTwo-letter US state postal abbreviation of residence.NM0%
zip_codestringFive-digit standard US postal ZIP code.880010%
ethnicitystringReported race or ethnicity classification.Black or African American0%
insurance_providerstringPrimary healthcare insurance provider or self-pay status.UnitedHealthcare0%

Visits visits · fact table · 8,066 rows

Records 8,066 clinical encounters, including visit type and dates.

Preview

First 2 of 8,066 rows of the Visits table
visit_iduuidvisit_datedatevisit_typestringattending_physicianstringdischarge_datedatepatient_iduuid
656d7a27-2ade-459c-b923-e2cd41fdc2fe2020-01-27OutpatientDr. Isabella Priceblank0a037b2b-79d2-4a2b-94c2-00e7286dbfae
1c9649c8-e5dd-4c86-a1f1-7a779f49590d2014-05-15OutpatientDr. Scarlett Brooksblank3bbe022f-9d5b-40ef-8d3a-2d94ec522127
2 of 8,066 rows · 6 columns

Data dictionary

Data dictionary for the Visits table
columntypedescriptionexamplenull %
visit_iduuidUnique identifier for the clinical encounter.bf88de11-0c46-410f-83fa-1187021f5aeb0%
visit_datedateDate the patient was admitted or the clinical encounter occurred.2021-05-030%
visit_typestringCare setting/category of the clinical encounter.Outpatient0%
attending_physicianstringName and title of the lead medical doctor responsible for the patient visit.Dr. Robert Smith0%
discharge_datedateDate the encounter concluded or the patient was formally discharged from the hospital.2015-07-2077.6%
patient_iduuidForeign key to patients.patient_id.453c6cd2-cd71-430f-9c00-cdaaf0afd0810%

Diagnoses diagnoses · fact table · 2,123 rows

Details 2,123 diagnoses, including codes, descriptions, and dates.

Preview

First 10 of 2,123 rows of the Diagnoses table
diagnosis_iduuiddiagnosis_codestringdiagnosis_descriptionstringdiagnosis_datedateis_primarybooleanvisit_iduuid
b1ab5a4e-e956-4d2f-8d73-994311384bc5R07.9Chest pain, unspecified2017-12-26truee0dc5dac-12b9-4391-a244-60828a22b397
fcfe5b8b-8e4a-4117-a077-34fe0b468585Z00.00Encounter for general adult medical examination without abnormal findings2018-03-16true12cef987-b00e-4482-b1ef-496a9666d34b
d1727126-5f8f-4320-a007-87ddd9cb2fa0K21.9Gastro-esophageal reflux disease without esophagitis2023-03-06true6b2314b8-3a88-4c0c-bfdc-9b78208704b9
a48df774-be83-4d52-adfd-bfaa0777cd74I10Essential (primary) hypertension2023-10-23true6ce1f395-483c-4565-b18d-95e88b1b3ad3
8853992d-03b3-4a06-a877-34c77c4eb4c3J06.9Acute upper respiratory infection, unspecified2017-05-26true84151169-32c3-4b93-be0d-ff2387cfca82
812593f5-59c8-4ab8-a920-462c37345264E11.9Type 2 diabetes mellitus without complications2015-04-17truee641ec93-882a-4117-bd68-4522e69de423
fa522346-d777-4abc-8c5c-c9b8840bd821F41.1Generalized anxiety disorder2016-01-27true0484c62f-ea64-4e3f-a22f-d7f036347a67
c058f345-e811-488c-a4c4-2d1dfe91f28fZ00.00Encounter for general adult medical examination without abnormal findings2013-11-05true23b45253-4fb3-4577-b650-4ecfa404aefc
d724c8f9-ac35-435e-9542-8646a60e0345R07.9Chest pain, unspecified2010-12-23true77f83cbf-3ae1-4107-8b0b-603286b1e704
067cb95e-4efb-42f4-b23f-438cb3094596F41.1Generalized anxiety disorder2013-12-31true2ae87be3-490f-429d-a60c-bfd30ff1531e
10 of 2,123 rows · 6 columns

Data dictionary

Data dictionary for the Diagnoses table
columntypedescriptionexamplenull %
diagnosis_iduuidUnique identifier for the clinical diagnosis record.uniqueb1ab5a4e-e956-4d2f-8d73-994311384bc50%
diagnosis_codestringStandardized ICD-10-CM diagnosis code.R07.90%
diagnosis_descriptionstringStandard clinical text description matching the ICD-10 diagnosis code.Chest pain, unspecified0%
diagnosis_datedateDate on which the diagnosis was established by the clinician.2017-12-260%
is_primarybooleanIndicates whether this diagnosis represents the primary reason for the clinical visit.true0%
visit_iduuidForeign key to visits.visit_id.uniquee0dc5dac-12b9-4391-a244-60828a22b3970%

How the tables join

  • visits.patient_id references patients.patient_idmany to one: each Visits row points to one Patients row
  • diagnoses.visit_id references visits.visit_idmany to one: each Diagnoses row points to one Visits row

Questions to answer with it

  1. List the top 5 most frequent diagnosis codes and their descriptions for patients in California.

    Join patients, visits, and diagnoses tables. Filter by state='CA'. Group by diagnosis_code and diagnosis_description, count occurrences, and order by count descending.

    tables: patients, visits, diagnoses

  2. Calculate the average number of visits per patient for each gender.

    Join patients and visits tables. Group by gender and count visits per patient_id, then calculate the average of these counts.

    tables: patients, visits

  3. Identify patients who had an 'Inpatient' visit and were diagnosed with a 'Pneumonia' (or similar code).

    Join patients, visits, and diagnoses tables. Filter visits.visit_type = 'Inpatient' and diagnosis_code LIKE '%J18%' (or similar pneumonia codes).

    tables: patients, visits, diagnoses

  4. Create a dashboard showing the count of visits per month, broken down by visit type.

    Extract month from visit_date. Group by month and visit_type, counting the number of visits.

    tables: visits

Starter SQL

run against this data before publishing

Table names match the SQLite file and the SQL script.

Top 13 Diagnosis Codes in California

sql
SELECT d.diagnosis_code, d.diagnosis_description, COUNT(d.diagnosis_id) AS diagnosis_count
FROM diagnoses d
JOIN visits v ON d.visit_id = v.visit_id
JOIN patients p ON v.patient_id = p.patient_id
WHERE p.state = 'CA'
GROUP BY d.diagnosis_code, d.diagnosis_description
ORDER BY diagnosis_count DESC
LIMIT 20;

Average Visits Per Patient by Gender

sql
SELECT p.gender, AVG(visits_per_patient.visit_count) AS average_visits
FROM patients p
JOIN (
  SELECT patient_id, COUNT(visit_id) AS visit_count
  FROM visits
  GROUP BY patient_id
) AS visits_per_patient ON p.patient_id = visits_per_patient.patient_id
GROUP BY p.gender
LIMIT 20;

Monthly Visit Counts by Type

sql
SELECT STRFTIME('%Y-%m', visit_date) AS visit_month, visit_type, COUNT(visit_id) AS visit_count
FROM visits
GROUP BY visit_month, visit_type
ORDER BY visit_month, visit_type
LIMIT 20;

Load it with pandas

python
import pandas as pd

# Unzip the CSV download first: one file per table
patients = pd.read_csv("patients.csv")
visits = pd.read_csv("visits.csv")
diagnoses = pd.read_csv("diagnoses.csv")

# Join visits to patients
df = visits.merge(patients, left_on="patient_id", right_on="patient_id", how="left", suffixes=("", "_patients"))
print(df.groupby("gender").size().sort_values(ascending=False))

Using it in your tool

Excel
Load each table into a separate sheet. Use Power Query to join tables based on foreign keys (e.g., patient_id, visit_id). Create a PivotTable from the joined data to analyze visit counts by month and type.
Power BI
Load tables into Power BI. Create relationships: patients[patient_id] -> visits[patient_id] and visits[visit_id] -> diagnoses[visit_id]. Create measures like 'Total Visits' = COUNT(visits[visit_id]) and 'Visits by Type' = CALCULATE(COUNT(visits[visit_id]), ALLEXCEPT(visits, visits[visit_type])).
SQL
Load the SQLite or SQL relational download. The tables are already structured with primary and foreign keys. Use JOIN clauses on patient_id and visit_id to link related data.
Python
Use pandas to load CSV or other formats. Join dataframes using pd.merge(). Perform aggregations and analysis using pandas functions.

Formats available

  • CSV (zip)One CSV file per table, zipped
  • Excel workbookOne worksheet per table
  • SQLite databaseA ready-to-query database file with every table
  • Parquet (zip)One Parquet file per table, zipped
  • SQL scriptCREATE TABLE with primary and foreign keys, then INSERTs
  • CSVA single CSV file
  • JSONA single JSON file

How this data was generated

Synthetic data. Every row was generated: no real people, customers or companies are in this dataset.

Synthetic data generated by GoMask DataFactory from a relational blueprint: keys, links and rules are enforced in code, text columns are filled by a language model. No real people, companies or transactions.

  • Data is synthetically generated using GoMask DataFactory.
  • Patient IDs are UUIDs, ensuring unique identification.
  • Diagnosis codes are based on ICD-10-CM standards.
  • Checked by an automated quality gate: unique keys, no orphan foreign keys, required columns filled, declared rules and date ranges (realism score 100).

Limitations

  • The dataset is synthetic and does not represent real patient data.
  • Discharge dates have a high null percentage (77.57%).
  • Diagnosis codes and descriptions have limited distinct values (14).
  • Distributions and correlations are modelled, not measured from real records.

blueprint · electronic-health-records-dataset

Scale this dataset

Same tables. As many rows as you need.

Open the blueprint behind these 3 tables in Data Factory: keep the relationships, change a column, and generate it at the size you need.

  • 50,000 rows
  • 200,000 rows
  • 1,000,000 rows
Scale this dataset in Data Factory
Tables
patients, visits, diagnoses
Licence
yours to use, including commercially
API slug
electronic-health-records-dataset

What should your data show?

Preview 20 rows free
No signup. No card.