Request a demo
Use case

Use case: integration testing for a clinic network, without patient data

A worked example: a made-up clinic network's integration team uses a patients-and-doctors schema and webhook traffic to test a new intake endpoint under a steady load, with no real patient anywhere in the test.

November 4, 2026 · 6 min read · All articles

Healthcare integrations are tested far less than they should be, for an understandable reason: the realistic test data is patient data, and patient data cannot go into a vendor's sandbox. The result is integrations tested with a handful of hand-typed records and then debugged in production. Generating the records removes the reason.

Example · a made-up clinic network

Brightwater Clinics' new referral intake

Brightwater Clinics (a fictional network of outpatient clinics) is launching an intake endpoint that receives patient referrals from partner practices as JSON. Daniel, on the integration team, needs to know how it behaves with a realistic mix of records arriving every few seconds for an hour, and whether it rejects records that reference a doctor it does not know.

The schema

InsightDataGen ships a healthcare example with two related tables. Doctors is the parent; Patients has a patient id (unique, within a range), first and last name, date of birth (with a date format and a range), an insurance id and a primary_care_provider_id with a foreign key to Doctors.doctor_id. Fields carry examples and descriptions, which guide the LLM generator when it is used. Daniel adds the referral fields his endpoint expects.

For testers who prefer the web UI, tables live as data stores in a dataset, and a run is started from the Generate dialog: a format (CSV, JSON, SQL or NoSQL), the generator, the number of records and a saved location.

Data stores page for a clinic dataset with patients and appointments tables
A made-up clinic dataset in the web UI with two table data stores.
Generate Data dialog: CSV, No AI, 250 records, location clinic-test-data
The Generate dialog: CSV, the non-AI (Faker) generator, 250 records, to a test bucket.
Generation summary: 250 total, 250 completed, 0 failed
The run's summary when it finishes. The generated file then appears in the Data Explorer, where it can be previewed and downloaded.

Making references valid by construction

Daniel adapts the example schema in two small ways. He names each field with name, the key the Faker generator reads, and he makes sure every referral's provider id lands on a real doctor by matching its range to the doctors' ids. That gives him the tool he needs:

  1. Doctors get sequential ids. On doctor_id he adds a rule of type unique (a rules list, which is the form the de-duplication step reads). For an integer field it numbers the rows in order, so 20 doctors get ids 1 to 20.
  2. The valid run uses the same range. With primary_care_provider_id ranging from 1 to 20, every referral points at a doctor who exists. We ran exactly this check: every generated reference matched.
  3. The fault run widens it. A range of 1 to 30 makes roughly a third of referrals point at unknown doctors, at random, which is the deliberate fault below. Each webhook run generates fresh records, so the test cannot know in advance which referrals are bad; the evidence is the endpoint's log of rejected referrals, checked afterwards against the doctors table.

The test

  1. Reference data first. The same schema is generated into the test database as SQL, so the endpoint's doctor lookups have rows to find.
  2. Then traffic. The webhook command sends a batch of records (JSON, in Daniel's case) to the endpoint every interval seconds until max-time. He starts with 10 records every 5 seconds for 60 minutes.
  3. Then a deliberate fault. For a second run he points primary_care_provider_id at a range that includes ids not in the doctors table, to confirm that unknown doctors are rejected and logged rather than silently accepted.

What the endpoint receives

Each run of the webhook command posts one request: a JSON array of records with a JSON content type, or a CSV body with a header row as text/csv. If the schema has several tables, their rows are placed side by side into one record, so for traffic Daniel keeps a second, one-table schema for the referrals and generates the doctors separately. He also leaves num_records out of that schema, because a table's own count wins over the command's --records option, and he wants the batch size set on the command line.

Synthetic does not mean harmless in every field. Generated names, birth dates and insurance ids can coincide with a real person's by chance. Keep generated test data in test systems, and do not use it where a match with a real person could cause harm (for example, sending messages).

What the team learns

  • How the endpoint behaves under a steady, realistic rate, not just one request at a time.
  • Whether validation catches broken references, because the test controls exactly which ones are broken.
  • That the whole test can be rerun on every release, because it is two commands and a schema file.
Example · a case worth testing

Duplicate referrals on retry

Steady traffic is the setting in which retry problems show up: if a slow database response makes a partner-side retry fire, an endpoint without an idempotency key would accept the same referral twice. That is the kind of fault this test is designed to surface before real partners and real patients are involved. An illustration with a made-up organisation, not a reported result.

Questions integration teams ask

Can we send authenticated requests?

The webhook command sends JSON with a content-type header; for a test endpoint that requires a token, put a small proxy in front of it that adds the token, or allow the test sender in the test environment.

How do we get adult patients only?

Check the birth dates in each run against the intake rule. If an adult-only rule matters to the test, redraw birth dates in a short setup step before the run is sent, or keep the under-age records as a deliberate rejection test.

Does it report the endpoint's responses?

It logs the status code of each request. For latency, errors and duplicates, measure on the endpoint's side, where the evidence is anyway.

A note on regulation

Health-data rules (HIPAA in the United States, GDPR's special-category data in Europe, and national equivalents) restrict how patient information may be used, including for testing. Generating data that never came from a patient avoids most of those questions, but your organisation's policy decides what is acceptable. This is general information; check with your privacy officer.

Steps

  1. Start from the healthcare example; add the fields your endpoint expects.
  2. Generate the reference tables into the test database.
  3. Send webhook traffic at a low rate for a short max-time; check one batch end to end.
  4. Raise the rate and duration; watch latency, errors and duplicates.
  5. Add deliberate faults (broken references, out-of-range dates) in separate runs.

Next: use case: de-identified submissions for an AI team.

Generate test data for one of your systems

Bring the schema of one system you need to test. We will write the generation schema with you, generate related tables, and send them where your tests read from.

Request a demo