Return to Patient Loom

Population model

Each location selects a council, local authority, local government district or region. London covers Greater London. Derry/Londonderry covers the Derry City and Strabane district. These are resident populations at census time. Emergency departments, wards and clinics have different case mixes.

Areas Data used to draw the patient
14 in England and Wales, 2021 ONS age by recorded sex, ethnicity by age band and sex (RM032), activity limitation by age and sex (RM073), legal partnership by age and sex (RM074), religion by age (RM118), and sexual orientation marginal for age 16+ (TS077). TS022 supplies local ethnic detail within selected parent groups without another age split.
Aberdeen, Dundee, Edinburgh and Glasgow, 2022 NRS age by recorded sex in five-year bands, local ethnicity by age (UV201b), religion by sex and age (UV205b), activity limitation by age (UV303b) and partnership by age for 16+ (UV104b).
Belfast and Derry City and Strabane, 2021 NISRA single-year age by sex, ethnicity, activity limitation, sexual orientation and partnership by five-year age band and sex, and religion by age band. Ages 90+ share one display category.

The generator draws age and sex together. It then draws each measured characteristic from the available conditional table. Religion and ethnicity can therefore both vary with age while remaining independent of one another within that age. The generator does not reconstruct entire census households or the complete joint distribution of all characteristics.

Scotland uses uniform single-year interpolation within published age bands. Its local ethnic, religious, disability and partnership tables are aggregated from output areas using the 2022 census geography index. Subtotals and overlapping ethnic group totals are excluded. A dash contributes no count. Disclosure control can introduce differences between summed small areas and tables published at council level.

For Scottish residents aged 16+, figures 4 and 10 in the NRS chart workbook give each council's percentages reporting trans status/history and LGB+ respectively. Two independent draws use those local percentages. For orientation the remaining outcomes stay unspecified. For trans status, the remainder is split using the Scottish national non-response share among residents outside the positive category (5.92 / 99.56). Using the same conditional share in each council is a modelling assumption. See the NRS quality assurance report.

Elsewhere the generator uses a fictional adult case mix: 95% explicitly non-trans, 1% trans or with a trans history and 4% unspecified. These rates are illustrative and have no claim to local census prevalence. The status draw is independent of recorded sex. Only an explicit non-trans outcome supplies the paired man/woman default. A trans-history-only outcome leaves gender unspecified. Writer-supplied identities and unknown or undisclosed answers take precedence. The England and Wales gender identity question and the Scottish trans status/history question measure different concepts.

Northern Ireland's combined LGB+ category and non-response category are preserved. In five-year bands spanning age 16, ineligible responses are excluded before drawing an adult response. Children under 16 receive no automatic sexual orientation, partnership or gender identity. The identity field reads “Not explored” when no identity has been supplied.

Diversity mode deliberately changes sampling weights. In the supported ethnicity tables, non-reference categories receive a multiplier of 2.6. The reference category is White British, White Scottish or the local Northern Irish White category. Minority sexual orientations receive a multiplier of 3 where modelled. These multipliers are teaching choices. Author-specified characteristics, diagnosis-conditioned ages and locked fields also change distributions. No calibration to hospital presentation rates is claimed.

The census describes limitations on daily activities. A specific impairment or adjustment in a fictional English or Welsh case is illustrative. Real people can self-describe in greater detail than available categories. The generator samples occupation independently of ethnic group. Fictional names use the illustrative associations described in the simulation materials section.

Sources and reproduction

The census describes limitations on daily activities. In England and Wales the local census weights determine the disability draw. A positive draw selects one age-appropriate fictional description from up to 19 sensory, mobility, cognitive or long-term activity limitations. Examples include reduced hearing, limited walking distance, fatigue limiting activities and difficulty remembering multi-step tasks. The descriptions have illustrative, equal weights within each eligible pool. A negative draw is labelled “No disability reported”. Scotland and Northern Ireland retain their census activity-limitation wording, including “Day-to-day activities not limited”. Writers may explicitly select “Not disclosed”, or edit and keep a description. Missing population data retains its own label. These fields do not determine a diagnosis, actor instruction or communication style. Real people can self-describe in greater detail than available categories. The generator samples occupation independently of ethnic group. Fictional names use the illustrative associations described in the simulation materials section.

Population validation

On 18 November 2026 the release audit drew 500,000 unconstrained profiles, 25,000 per supported population. It ran the application's own JavaScript sampling pipeline in Node with inert form controls. Browser interaction was tested separately. A seeded random number generator (20261118 plus location index) makes the audit reproducible.

All 218 comparisons passed the specified tolerances. Of these, 178 compare the output with separately tabulated official figures and 40 check the sampler against its own age-by-sex input. The latter catch implementation errors but cannot verify the input data independently. See the per-area results (CSV) for observed counts, eligible denominators, expected fractions and thresholds.

The English and Welsh benchmarks include sex, age under five and 85+, disability, religion, orientation, partnership and selected ethnic groups. Northern Ireland includes activity limitation among females aged 65+ and males under 15. The Scottish external checks cover Polish ethnicity, reporting LGB+ and trans status/history. Non-response and minimum eligible age affect the denominators. Each simulated age and recorded sex is checked for validity, and under-16 outputs are checked for accidental orientation or legal-partnership imputation.

The pre-specified sampling tolerance uses a two-sided Bernstein bound for a binary event with a union bound for up to 1,000 comparisons at a family error probability of 0.001, plus 0.1 percentage point for rounding and disclosure differences. This conservative threshold is much wider for small subgroups. The largest absolute difference was 1.66 percentage points in Derry/Londonderry (metric limitedFem65). The result file gives the tolerance for each cell.

Outstanding validation

Corrective preview and regional source checks

The external report tested 1.1.1. On the 1.1.2 development baseline, both explicit adult maternity conflicts generated a profile, and the seven-year-old pregnancy generated with a review message. The corrective regression exercises cover rejection before confirmation and deliberate construction afterwards, including a locked edit. Every active catalogue concept was also exercised 100 times through the application (35,000 cases, seed 0xC1A171C). These are development checks; independent clinical sign-off remains outstanding.

The 500,000-profile unconditioned run reproduced all 218 results in the 1.1.2 CSV exactly. A separate read-only comparison used freshly downloaded source files and compared the exact sets of keys and integer counts. NRS UV201b was aggregated by 2022 output area to four councils using the NRS geography index. All 456 ethnicity-by-age cells matched. The NISRA Census 2021 custom table was checked for Belfast and Derry City and Strabane. All 988 ethnicity-by-age-by-sex cells matched. Scottish ethnicity weights are pooled across sexes. These comparisons cover the named source tables, not every demographic relationship.

Reproduce with python scripts/check-regional-ethnicity.py bulk.zip index.zip nieth.csv. The bulk and index locations and NISRA custom table query are in scripts/region-sources.py. Source SHA-256 digests in that order were 6e1673bafa2d31a4342a767bb96872639697232706c0fa4cde5250da71afc58f, 0e4096a321cba2318dc5d2e35c197bf815ac333aebdf4cb0ddce82112b57a261 and 5ec17eba704c4bf6b22cc05fcad656ff0f03c7332ab714c9ef2fc857810dc1c0.

In 1.1.5 the 218 target proportions and tolerances methodology are retained. Name draws consume the same seeded generator as subsequent patients, so changing a repertoire can change the realised sample. All 218 comparisons passed again.

Clinical recognition and faculty review

Patient Loom 1.1 has 350 teaching concepts. There are 82 presenting complaints, 237 diagnoses and 31 scenarios. The clinical catalogue and review register (CSV) contains the preferred wording, recognised variants, specialty, related concepts, required anatomy or physiology, authoring defaults, source, limitations and independent review status for every entry. The file can be filtered by specialty or type.

The GMC MLA content map informed the choice of teaching subjects and the distinction between presentations and diagnoses. Faculty scenarios also address acute care, handover, palliative care, communication and primary care. The vocabulary, cross-links and authoring assumptions were developed for Patient Loom. A curriculum reference establishes educational scope. It does not supply a prevalence estimate or validate a rule.

What the writer enters

A complaint can stand on its own. A case of chest pain leaves the cause open. If a writer supplies pulmonary embolism as a working diagnosis, that adds a separate concept. A sepsis assessment represents an activity and leaves the outcome open. Where related entries appear in the register, they are suggestions for a faculty member exploring the catalogue. They never assign an additional diagnosis.

The matcher recognises complete words, clinical aliases, selected abbreviations and a small number of spelling variants. It can identify multiple mentions and distinguish active, suspected, negated, historical, differential and family-history wording. The original text remains available to the faculty member. Ambiguous shorthand such as “PE” needs spelling out. Novel expressions, quoted speech, changes of subject and the scope of negation can defeat a rule-based parser. Writers should check each interpretation before using the patient. A match confirms vocabulary recognition only.

How ages are chosen

Most entries have no diagnosis-specific age model. These use the ordinary demographic sampler unless the writer supplies a constraint. This can produce an unusual patient for a common diagnosis. It is especially important to check the age for conditions such as dementia, lung cancer and osteoarthritis. In particular, a general-population sample cannot estimate the distribution of patients attending an acute medical unit.

Version 1.0 introduced illustrative age and gestation bands and several weighted age-pattern rules. These remain labelled as authoring assumptions. Some newer age bands use the typical ages or scope described in named UK guidance. For instance, NICE describes bronchiolitis in children under two; the corresponding whole-year band is 0–1. NICE's COPD guidance prompts consideration in symptomatic people over 35 with a risk factor. A teaching draw within either interval is illustrative. The shape of the draw has not been fitted to surveillance or incidence data. Writers should review unusual ages in context. The local census age category 90 includes everyone aged 90 and over.

Neonatal sepsis and jaundice use an age of zero years. This field alone cannot identify a newborn. Faculty must specify chronological and, where relevant, corrected age in days, or postnatal age in hours, and check the timing of clinical findings. Febrile seizures most commonly occur between six months and six years. A profile recorded as under one therefore needs a specific age in months.

Sources include NICE NG9 on bronchiolitis, NICE NG115 on COPD, NHS information on febrile seizures, NICE NG195 on neonatal infection, and NICE CG98 on neonatal jaundice.

Anatomy and maternity

Active organ-dependent diagnoses add specific case assumptions. Ovarian torsion needs an ovary. Cervical disease requires a cervix. A history of hysterectomy alone cannot establish which organs remain. A trans woman with a prostate or a trans man with a cervix can have disease affecting that organ. Breast cancer has no census-sex restriction. Endometriosis has no requirement for a current uterus. Faculty should establish relevant history directly in the case.

Recorded sex can use a conventional diagnosis-specific default if the writer supplies none. This changes the sex distribution of diagnosis-conditioned profiles. Gender identity and trans history cannot establish surgical history. A confirmed absent organ conflicts with a rule requiring its presence. Review cases involving surgery, metastasis or recurrence individually.

Pregnancy and recent childbirth are separate physiological contexts. Ectopic pregnancy makes no universal assumption about implantation site. Postpartum haemorrhage, postnatal pre-eclampsia, postnatal eclampsia and postpartum psychosis require a recent birth. Pregnant patients with headache and hypertension still need a separate writer-supplied working diagnosis if one is intended. The programme does not establish pre-eclampsia from that combination.

Sources include NHS hysterectomy information, NHS 111 Wales screening information, NICE NG126 on ectopic pregnancy, NICE NG133 on hypertension in pregnancy, RCOG on reduced fetal movements and NHS information on postpartum psychosis.

Outstanding clinical review

Every entry in the register awaits independent clinical review. Priorities are:

Automated tests check recognition and the implementation of declared rules. Independent clinical review, reader testing and measurement of recognition performance on real simulation briefs are outstanding. No diagnostic accuracy, clinical validity or care recommendation follows from a passing software test.

Corrective preview 1.1.3

A current obstetric diagnosis establishes its required pregnancy context. Trans men and non-binary patients can be generated with this context, including with male recorded census sex. A writer's stated gestation is retained. The generator leaves the week unspecified otherwise. Contradictory anatomy or maternity selections require the writer to revise the case. An explicitly selected trans woman or cisgender man prompts a choice to revise the obstetric scenario or select a compatible patient. The generator preserves the selection until the writer changes it.

Automatic maternity cases use the existing population or illustrative trans-status draw. For the small positive-status group, illustrative relative weights of 48 to 30 select a trans man or a non-binary patient. Non-binary patients retain unspecified trans history. The weights use the relative counts in the 2021 England and Wales Census as a teaching approximation. Pregnancy-specific prevalence is unknown in this model. Ectopic pregnancy has no required implantation site. A negative current pregnancy statement can coexist with recent childbirth.

Under 13, generation and regeneration require a separate acknowledgement of physiology and safeguarding in a supervised teaching case. New cases start without acknowledgement. Ages 13–15 trigger review. Pregnancy above age 50 requires physiology/timeline confirmation. The upper age and the prompt to correct gestations outside 1–45 weeks are editorial parameters pending specialist review. Neonatal and infant cases must distinguish the patient's history from that of the birthing parent. Neonatal diagnoses paired with age one year or above require clarification. Where a stated infant age reaches 28 days, review onset and corrected age. Whole-year ages alone cannot establish either. These checks do not reconstruct obstetric history, establish puberty or interpret arbitrary narrative timelines.

Clinical source context: NICE CG89, section 1.2, NICE CG98, NICE NG195.

The generator applies the active scenario's assumptions directly. For example, placenta praevia supplies its pregnancy context. An unusual combination that needs the author’s confirmation prompts a case-specific question at the point of generation or regeneration. The same workflow retains the separate safeguarding acknowledgement. Changing the case or starting a new patient clears the prompt.

The parser recognises explicit statements such as “retained cervix”, “uterus absent” and “previous total hysterectomy”. An incompatible confirmed absence requires a change to the clinical brief. A family history or a negated diagnosis does not establish the patient’s anatomy. The parser recognises a limited vocabulary, so writers should check its interpretation of surgical histories and complex free text.

Fictional patient details and simulation materials

How the narrative is generated

After the census profile is complete, an illustrative name sampler uses the final ethnic background, age and gender selection. At publication it contains 23 curated repertoires of given names and family-name elements. These include multiple sets for people in broad groups such as Black African, Chinese and British Indian. Each set favours combinations familiar within a particular naming tradition. Sets overlap. A repertoire is an internal writing aid and never becomes part of a patient's biography.

The sampler picks a starting repertoire from the exact census label, including selected detailed local labels. A British Indian profile, for example, draws from the Indian, Gujarati, Punjabi and Bengali repertoires. The Indian repertoire gets two of the five tickets. Broad mixed groups can use several repertoires. Labels without an explicit mapping, including free-text descriptions, draw uniformly across all repertoires. Unmapped labels therefore have particularly limited cultural specificity. All tickets, branch probabilities and within-list frequencies are illustrative author choices.

Before the gender-neutral draw, 82% select both parts from the starting repertoire, 10% select a shared UK given name and 4% select a shared UK surname. A further 3% select a complete pair from another repertoire and 1% select the surname from another repertoire. Where local neutral names are available the neutral branch gives them a 65% chance. These probabilities describe the algorithm. They do not measure migration, intermarriage, or the share of UK families using any naming tradition. The two-part display uses given-name-first order for generated UK examples. It cannot model all patronymics, name orders, mononyms, marriage practices, transliteration choices or individual preferences. The full name field accepts the writer's own spelling and order in Edit & regenerate. Locking it preserves it.

An explicitly chosen man or woman profile selects the corresponding given-name list. An unspecified identity uses the census sex field to select an illustrative list without setting the patient's identity. Non-binary and other stated identities can draw from either list. All profiles can draw from a shared gender-neutral list (7%, or 40% for open sampling). These are teaching conventions. The generator makes no claim about a person's transition or name choice. Name generation has no access to religion, orientation, language, occupation, disability or diagnosis and cannot alter demographic fields. Clinical age constraints can still affect the names one sees through age.

The ONS 2023 birth registration bulletin supplies six recent given names: Muhammad, Noah, Oliver, Olivia, Amelia and Isla. Contains public sector information licensed under the Open Government Licence v3.0. For under-sixes drawing from the shared repertoire, 12% of remaining non-neutral draws favour these names. These rankings concern births in England and Wales, not adult residents or UK ethnicity-specific preferences. There is no age adjustment for older patients or for other repertoires. The ONS historical series describes birth-cohort trends but does not supply the missing joint probabilities. Other entries are original curated examples. HM Passport Office guidance describes additional variation in name formats. Community and simulated-patient review of the repertoires, crossover rates, gender assumptions and fallback remains outstanding.

Name sampling audit

A seeded draw of 336,000 names covered 14 backgrounds, three ages (3, 32 and 75) and both census sexes, with 4,000 draws per combination. It yielded 34,559 distinct full names, 570 distinct given names and 279 distinct family-name elements. Each stratum contained at least 864 distinct full names. The highest frequency of one full name within a stratum was 33/4,000 (0.825%). A separate 60,000-name test for British Indian adult men yielded 1,177 Abhisheks, 3,149 Arjuns, 2,003 Ravis and 203 Pauls. These figures test design intent and reveal repetition. They cannot establish real-world name frequencies or cultural acceptability.

Download the results for each group (CSV). Reproduce it with NAME_AUDIT_OUTPUT=docs/name-audit.csv node --test tests/names.test.cjs. Tests also exercise trans and non-binary profiles, the young-cohort branch, independence from unrelated inputs and sampling after the final identity and ethnicity are known.

Age bands guide daytime activity, interests and household examples. Teenagers may be at school, college, in an apprenticeship or working. Older adults can be working or retired. The household sampler allows relatives, friends, partners and living alone. For children it includes care across two homes, foster carers, grandparents and other family arrangements. It uses marital status when explicitly married or in a civil partnership. Partnership status otherwise leaves room for living with an unmarried partner. These illustrative choices do not estimate labour-force or household prevalence.

Personal background

An optional paragraph appears only when the selected interest has a further everyday detail. The patient overview and interest field retain the underlying facts. Authors can supply consultation details in the shared opening and private acting instructions in the actor cues box.

Using the materials

Under Simulation materials and export, choose the full faculty sheet, actor brief or student handout. A plain-text preview shows exactly what will be downloaded or printed. Print / save PDF uses the browser's print dialogue. The existing Copy sheet and Print controls apply to the full faculty version.

Material Generated details Author's scenario details
Full faculty sheet Patient demographics, personal background and available clinical context All three author inputs
Actor brief Patient name, age, location, occupation, household, interest and any additional background Shared opening information and private actor cues
Student handout Patient name, age band and location Shared opening information and learner task

The actor and student templates explicitly select their own fields. Neither automatically includes the working diagnosis, anatomical assumptions or private demographic details. The author decides what goes in the shared opening, task and actor cue. The private cue section appears when the author supplies instructions. Text entered into a shared box is reproduced verbatim, including any diagnostic information deliberately or inadvertently included by the author. Review the role-specific preview before distributing.

Author inputs survive Edit & regenerate for the same case. Starting a fresh case clears all three, including private actor cues. Inputs remain in the current page until the writer chooses Save patient or exports a faculty case file. Clinical history, observations, examination findings, safeguarding information, and mark schemes need to be authored or reviewed for the individual teaching session.

Checks

Run node --test tests/simulation.test.cjs. Tests cover independence from protected characteristics, coverage across 13 ages and 1,300 synthetic profiles, brief overrides, locked wording, legacy fields, age formatting, author-supplied cues, and the fields visible to each audience. These are functional checks. Independent simulation writer and simulated patient feedback is still needed, particularly on age appropriateness, accessibility and how households and names are represented.

The ordinary interest pool contains 64 adult activities, 30 school-age activities (including teenagers) and 10 preschool activities. Optional elaborations of those activities bring the numbers of selectable descriptions to 79, 35 and 13 respectively. Infants have two simple shared activities; recognised neonatal scenarios omit an interest. These are fictional options selected by age. Ethnicity, religion, gender and disability do not change the interest weights. The writer can edit and keep an interest.

Saving a case

Save patient records a titled snapshot in this browser. Open Saved patients to reopen, duplicate, rename, delete or export it. After editing and regenerating, choose Save changes to update the original. Duplicate makes an independent variation. Clearing browser data can remove local cases. Browser profiles, devices and site addresses each have separate storage.

The version 1 JSON case file is a full faculty backup. It preserves the generated person, clinical interpretation, scenario inputs, locks, original demographic constraints and all three authored materials. Import makes a separate copy. A student handout or actor brief can be distributed using the audience-specific materials selector. Local case operations require no account and send no case contents to a server.

The faculty and actor materials retain the social fields even when the optional paragraph is absent. Details come from a small, reviewed catalogue keyed to the final interest and age. Changing a hobby removes its former detail. The paragraph has no access to the patient's name, diagnosis, disability, ethnicity, household or authored notes. Writers can place scenario-specific context in the appropriate audience field.

An explicit, unqualified statement that the patient cannot walk excludes ordinary walking and running activities from the automatic draw. A wheelchair or a diagnosis alone does not establish this restriction. An explicit statement that the patient cannot work can supply the neutral daytime description “Not currently working”. Neither rule narrates a medical cause. Social fields entered and kept by the writer remain under their control. These narrow text rules do not interpret a comprehensive functional history or resolve arbitrary conflicts between authored fields.

In a seeded check of 12,000 profiles spanning 12 ages, 2,042 had an extra detail and 9,958 omitted the paragraph. The sample covered all 31 available descriptions. The catalogue is finite, so the same interest can produce the same detail in different cases.

Whole-patient checks for version 1.1.5

The seeded test generated 12,000 fictional patients across 20 locations, covering 12 cases per location with 50 draws per case. It alternated ordinary and teaching diversity mode. The cases include childhood and neonatal presentations, specified and unspecified identities, organ-dependent diagnoses, pregnancy, family history, and 1,000 Pakistani female patients aged 42. The last group yielded 615 distinct full names. In 827 cases both elements came from the same curated repertoire. The sample is designed to exercise the software and cannot estimate population frequencies.

For every patient, the test built the faculty sheet, actor brief and student handout. It checked the final name across audiences, the factual biography in faculty and actor materials, and the presence and privacy of author-supplied cues. It also checked that the retired characteristics were absent from generated objects, editable fields and export headings. A separate fixture containing old fields verifies that these values do not appear when rendering an older profile.

The development browser suite exercises rendering, editing and locking, author notes, text downloads and print content at desktop and phone widths. To reproduce the full-profile sample, run PROFILE_REVIEW_OUTPUT=examples.json node --test tests/profile-quality.test.cjs using the source checkout.

The external report supplied an aggregate of 37 cross-list flags, naming Kiran as an example. Individual flagged full names were not included. Kiran remains available across gendered repertoires. The current stratified test generated 336,000 names, including 34,559 distinct full names. These curated associations and the case-writing age and gender weights remain illustrative. External cultural review is still needed.

Backgrounds combine home and occupation or daytime activity in age-appropriate wording. A neonatal case omits a generated interest. Authors can still set individual details and private actor instructions. The review CSV contains 48 examples from the final seeded run.

Version 1.1.5

The selected population supplies census weights. Authors choose the simulation setting separately. Advanced patient options contain the existing demographic constraints and teaching diversity mode. In the editor, typing in a characteristic selects Keep for that field. Clearing Keep makes it eligible for regeneration within the original case constraints. Cancel discards the draft values and restores the previous locks.

The independent 1.1.4 review highlighted a Vietnamese-background profile with a Yoruba full name. The specific Vietnamese label previously used the unrestricted fallback. It now has a Vietnamese repertoire, with the existing illustrative crossover routes. These are fictional case-writing weights. They have no measured UK full-name frequency interpretation. Names follow the application's existing given-name-first display convention. The wording of a generated interest is stable between the profile and materials for different audiences. It adds no new biographical facts.