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.
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.



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:
- Doctors get sequential ids. On
doctor_idhe adds a rule of typeunique(aruleslist, 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. - The valid run uses the same range. With
primary_care_provider_idranging from 1 to 20, every referral points at a doctor who exists. We ran exactly this check: every generated reference matched. - 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
- Reference data first. The same schema is generated into the test database as SQL, so the endpoint's doctor lookups have rows to find.
- 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.
- Then a deliberate fault. For a second run he points
primary_care_provider_idat 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.
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.
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
- Start from the healthcare example; add the fields your endpoint expects.
- Generate the reference tables into the test database.
- Send webhook traffic at a low rate for a short max-time; check one batch end to end.
- Raise the rate and duration; watch latency, errors and duplicates.
- Add deliberate faults (broken references, out-of-range dates) in separate runs.


