Generating a patient
A job generates one patient. Send POST /v1/jobs with a request; every field is optional, so
{} generates a random patient, of any age, with five documents.
The patient
Everything in patient is a fact the generated patient will have. Whatever you leave out is
filled in to fit: a 72-year-old with heart failure gets a plausible medication list, history
and care, even if you only name the condition.
The patient’s history is as it stands when the documents begin, so
onset_years_ago and years_ago count back from there. "onset_years_ago": 0
puts a new diagnosis at the start of the documents, which is how you get a
condition’s whole workup and treatment to fall within them.
Names you give are coded in the record (conditions with SNOMED CT and ICD-10-CM, medications with RxNorm), and keep your wording as their text.
Primary conditions
A primary condition is what the chart is mainly about. Most of the patient’s visits, specialists, studies and hospital stays follow from the primary conditions, their complications and their treatment — alongside the routine care and occasional unrelated problems any real chart has.
Mark as many as apply; complex patients often have several. If you mark none, the conditions
you asked for that are not resolved are the primary ones, and if you ask for no conditions
at all, primary conditions are chosen to fit the patient — none for a healthy one.
On a cohort, primary applies to the patients given that condition. If none of a patient’s
conditions is marked there, all of them are primary.
Complexity
complexity sets how sick the patient is and how much care they get, from 1 to 10. It is
chosen at random if omitted, and reported in the job’s summary.
Documents
num_documents is how many clinical documents to write, from 1 to 50. An office, emergency,
virtual or home visit produces one document. A hospital stay produces several: usually an
admission history and physical, progress notes on the following days, consult notes when
specialists are involved, an operative or procedure note on the day of a procedure, and a
discharge summary on the last day. Each counts toward num_documents.
Restrict the documents to the types you need with document_types. Encounters are planned so
each type is written where it belongs:
Clinical notes
Allied health
Diagnostic reports
Insurance
Charts include the allied health, diagnostic and insurance documents where the patient’s care
calls for them — speech-language pathology after a stroke, cardiac rehabilitation after a heart
attack, a prior authorization before advanced imaging. Each report type stays a minority of the
chart, at most a tenth of it, so name one in include_document_types to be sure of at least one.
Insurance documents
Three things worth knowing before you use them:
- Every detail is fictional. Insurers have generic names such as “Regional Health Plan”. Member IDs and clinician NPIs are invented — and the NPIs are built to fail the NPI check digit, so none can ever match a real clinician’s.
- No CPT or HCPCS codes. Services are described in words. Diagnoses carry ICD-10-CM codes.
- The coverage fits the patient. In the US, Medicare or Medicare Advantage from 65, commercial or Medicaid otherwise, and a parent’s plan for a child. In Canada, the provincial plan, often with extended health benefits.
A document type that records a procedure (operative, procedure, radiology and pathology reports) comes with that procedure in the record.
Oncology and hematology notes open with the patient’s oncologic history in a sentence or two — stage, biomarkers, and each treatment with its cycles, dose, fractions and dates — and their assessment and plan covers the treatment, the response and side effects, the next steps with dates, and what was agreed with the patient.
When you don’t restrict document_types, a patient’s documents fit their problems. A patient
with cancer has oncology notes, imaging and pathology reports, and radiation oncology notes
when radiation is part of treatment. A patient with advanced cancer has palliative care and
social work notes, and an operation comes with its preoperative assessment, operative report
and pathology report. Left to itself a chart follows a realistic mix — mostly visits and
consultations, with fewer reports.
Only these types, or include these types
document_types restricts the chart to the types you list. To get a normal chart that is
sure to contain certain documents, list those in include_document_types instead: the chart
then has at least one of each, and the rest of its documents fit the patient’s care.
The two work together — every type you include must also be in document_types, where you
give both. A request cannot include more types than it has documents, which for a cohort means
no more than documents_per_patient.min.
Radiation oncology documents are written while the patient is treated. To get them, describe
a cancer diagnosed near the start of the timeline (for example "onset_years_ago": 0), so
its treatment falls within the documents’ dates.
Timeline
By default the documents end today and start far enough back to fit them, given the
patient’s complexity. Set timeline.end_date, timeline.start_date, or both, to place them.
If you give the patient both age and birth_date, the timeline starts when the patient is
that age.
Before the timeline, the record holds the patient’s history: past conditions, procedures, immunizations and the medications they take when it starts.
Outputs
result.json, the patient’s full record, is always included. The default is
["fhir", "notes"]. See Results.
Reproducing a patient
The job’s summary.seed identifies the patient. Send it as seed with the same request, and
the new patient has the same dates, age, sex, state or province, and complexity. The rest of
the record and the documents are generated again, so they are similar but not identical.
Cancelling
DELETE /v1/jobs/{job_id} cancels a queued job, or a running one (its results are
discarded). Canceled jobs are not billed.
When a job fails
A job that could not be completed has status failed and an error with a code:
See Errors for the codes.

