Skip to main content

Healthcare Test Data: A Field Set and Sample Schema for EHR and Claims Systems

A healthcare test dataset that exercises an EHR or claims integration needs FHIR-structured records, codes that belong to ICD-10-CM, CPT, and LOINC, and providers with valid NPI numbers. This page names the 15 required fields, maps fixture fields that carry Safe Harbor letters (B, C, H, R) in the field table and enumerates A to R in a separate table, shows a 3-table patient/encounter/observation schema, and lists 5 test scenarios.

Field set (15) for EHR and claims systems

Include patient demographics, NPI test identifiers, ICD-10 diagnosis codes, and FHIR-oriented resource shapes as synthetic fixtures. Use only synthetic identifiers; do not copy real clinical records.

Healthcare FHIR-oriented field set
#FieldCardinalityBinding / membershipSafe Harbor
1patient_id1..1FHIR Patient.idR
2patient_identifier0..*Identifier-
3mrn0..1facility-local uniqueH
4birth_date0..1YYYY-MM-DDC
5postal_code0..15-digit or 3-digit prefixB
6npi0..110 digits; CMS Luhn+24R
7encounter_id1..1FHIR Encounter.id-
8encounter_status1..1required binding-
9encounter_class0..*preferred binding-
10encounter_subject0..1Reference(Patient|Group)-
11actual_period0..1Encounter.actualPeriod-
12diagnosis_code_icd10cm0..*ICD-10-CM membership-
13procedure_code_cpt0..*CPT 5-char membership-
14observation_code_loinc0..*LOINC + mod-10 check-
15observation_value / effective / range0..1Quantity / dateTime / range-

HIPAA Safe Harbor identifier enumeration (A to R)

Definitional / testing context only; not legal advice. HHS Safe Harbor enumerates identifiers (A) through (R) that must be removed for de-identification of real records (hhs.gov de-identification guidance, retrieved 2026-08-01). Synthetic rows are generated, not derived from PHI. Generate-Data makes no HIPAA compliance guarantee.

Safe Harbor A to R mapped to fixture fields
LetterIdentifierFixture mapping
ANamesfamily_name / given_name (synthetic)
BGeographic subdivisions smaller than a statepostal_code_3 (3-digit ZIP prefix)
CElements of dates except year; ages over 89birth_date (illustrative)
DTelephone numbersnot in this fixture
EFax numbersnot in this fixture
FEmail addressesnot in this fixture
GSocial security numbersnot in this fixture
HMedical record numbersmrn
IHealth plan beneficiary numbersnot in this fixture
JAccount numbersnot in this fixture
KCertificate / license numbersnot in this fixture
LVehicle identifiersnot in this fixture
MDevice identifiersnot in this fixture
NURLsnot in this fixture
OIP addressesnot in this fixture
PBiometric identifiersnot in this fixture
QFull-face photographsnot in this fixture
RAny other unique identifying number / codepatient_id, npi (synthetic shapes)

Compliance framing

As general practice, synthetic healthcare fixtures help teams avoid placing real PHI in non-production environments. Invene notes synthetic data "reduces HIPAA exposure significantly but doesn't eliminate all compliance considerations" (retrieval date 2026-08-01). This is industry framing, not a Generate-Data HIPAA guarantee.

Sample schema: patient, encounter, observation

Model patient as parent, encounter as child, and observation referencing encounter. Include an NPI column that is obviously synthetic. Keep referential integrity so claims cannot point at missing encounters.

patient

patient sample
patient_idmrnfamily_namegiven_namebirth_datepostal_code_3
pat-0001MRN-SYN-000001SynthfieldAvery1979-03-14021
pat-0002MRN-SYN-000002TestworthyBrin1962-11-02606
pat-0003MRN-SYN-000003NullingtonCass1994-07-25941

encounter

NPI 1234567893 is CMS's own worked Luhn+24 example (illustrative). ICD-10-CM and CPT values are structural examples from cited CMS/CPT pages, not clinical guidance.

encounter sample
encounter_idsubject_patient_idstatusclass_codeattending_npidiagnosis_icd10cmprocedure_cpt
enc-1001pat-0001completedoutpatient1234567893R10.1399213
enc-1002pat-0002in-progressinpatient9876543213S32.010A0042T
enc-1003pat-0003dischargedinpatient1111111112M1A.01111018F
enc-1004pat-0001cancelledoutpatient2000000002O9A.2110123T

observation

observation sample
observation_idencounter_idcode_loincvalue_quantityunitref_lowref_high
obs-5001enc-10012951-2139mmol/L135145
obs-5002enc-100217863-21.18mmol/L1.11.35
obs-5003enc-1003806-03/uL05

Code-system membership and NPI shape checks

ICD-10 values must belong to the code system your claims pipeline accepts. NPI test values should satisfy the CMS Luhn-plus-24 check-digit shape without corresponding to a real provider. That combination catches both membership and format bugs.

Test scenarios

  1. Claim adjudication: ICD-10-CM coded below required specificity must reject.
  2. Placeholder-character validation: T36 to T50 poisoning code missing X placeholder must fail.
  3. NPI check-digit rejection at enrollment (feed a failing Luhn+24 shape).
  4. Encounter state machine: illegal status transitions refused; cancelled/entered-in-error excluded from billing extracts.
  5. Reference-range boundaries: observations at low/high and low-only range without null dereference.

Generate a larger version

Use the free generator to extend the schema with the FHIR-ish fields your environment needs, then export. Anonymous use is capped at 100 rows, 6 fields, 3 exports, and CSV only. Signed-in formats: csv, json, xml, parquet, xlsx, jsonl, hf-datasets. Prefer synthetic IDs and published test code lists over any production extract.

Frequently asked questions

Can synthetic data completely eliminate HIPAA compliance requirements?

No. Invene's guide states that synthetic data "reduces HIPAA exposure significantly but doesn't eliminate all compliance considerations" ([invene.com/blog/synthetic-data-healthcare](https://www.invene.com/blog/synthetic-data-healthcare), retrieval date 2026-08-01). The HHS de-identification guidance addresses real records that contain protected health information; a generated record that was never derived from real patient data is not de-identified in that sense, because there was no real PHI to remove. That said, the workflow, environment, access controls, and audit trails around synthetic data still carry their own obligations, especially when a synthetic dataset is generated from real records as a seed. Generate-Data makes no HIPAA compliance guarantee. This is a general industry framing based on cited sources.

How do leading healthcare organizations validate synthetic data quality?

Invene's guide covers validation approaches that include checking code-system membership (ICD-10-CM specificity level, CPT category), referential integrity (encounter rows that reference valid patient identifiers), and clinical plausibility (LOINC observation values within reference range) ([invene.com/blog/synthetic-data-healthcare](https://www.invene.com/blog/synthetic-data-healthcare), retrieval date 2026-08-01). Synthea, which generates "high-quality, synthetic, realistic but not real, patient data," uses a population simulator that constrains outputs to plausible clinical trajectories ([synthetichealth.github.io/synthea](https://synthetichealth.github.io/synthea/), retrieval date 2026-08-01). For schema-level validation, the field set on this page names the specific membership rules and cardinalities a test harness should assert.

When should we avoid using synthetic data entirely?

Invene's guide names cases where synthetic data is insufficient: where the real statistical distribution is required for a clinical trial, where a vendor explicitly requires real production records for support, or where the system under test validates data against a live patient index ([invene.com/blog/synthetic-data-healthcare](https://www.invene.com/blog/synthetic-data-healthcare), retrieval date 2026-08-01). Synthetic data is also a poor fit when the test specifically needs to exercise de-identification tooling on real PHI, because there is no real PHI present. These limits are stated as general industry framing from the cited source, not as legal advice.

Generate a custom dataset · Back to all guides