100% synthetic data Consulting demonstration

Synthetic Alberta emergency & inpatient data.

Project 001 generates fictional NACRS and DAD records to study hospitalization and inpatient length of stay. The same NACRS cohort supports adult-asthma propensity-score matching, outcome regression, and hospital-level regional comparisons. Ten memos document the methods, findings, and limits.

2Synthetic data sources
90kOriginal NACRS + DAD records
12kIndependent adult visits in A07
9Rendered memos

The research

Two linked questions and an asthma extension

The original questions use CTAS, the Canadian Triage and Acuity Scale (levels 1–5, where level 1 is most urgent). A07–A09 use adults from the same NACRS file to study asthma, admission, and hospital-region differences.

Question 1 · Memo A03

Hospitalization — yes or no?

Among emergency visits, do CTAS and the time before the disposition decision affect whether the patient is hospitalized?

Population
Emergency (NACRS) visits
Exposure
Pre-disposition stay pre_disposition_los_min and ctas_level
Outcome
Hospitalization admitted_flag (1 = yes, 0 = no)
Model
Logistic regression
Appendix
Total emergency stay los_min is a comparison, not the primary exposure
Question 2 · Memo A05

Inpatient length of stay — how long?

Among hospitalized visits that link to a DAD record, do CTAS and total emergency stay affect inpatient length of stay in days?

Population
Linked admissions (from A04)
Exposure
Total NACRS stay los_min and ctas_level
Outcome
Inpatient stay in days los_days
Model
Linear regression
Sensitivity
Acute stay acute_los_days, after alternate-level-of-care days are removed
Asthma and regions · Memos A07–A09

Adult asthma and admission risk

Among comparable adult ED visits, how does admission risk differ when asthma is the main diagnosis?

Adults aged ≥18 are selected from the shared 30,000-visit NACRS file. Matching is exact within hospitals, with baseline propensity scores. Outcome models reuse the fixed pairs, and A09 fits hospital random-intercept logistic models for Calgary, Edmonton, and other regions, including surrounding towns.

CTAS is downstream of the episode in this design. The causal interpretation applies to the stated simulation; the effect is not a clinical finding.

Open asthma analysis (A07) Outcome regression (A08)

The data

Two synthetic Alberta sources

Every value is randomly generated. The records imitate the structure — the record grain, field families, and linkage — of two real Alberta administrative sources, without using any real patient information.

NACRS

Emergency & ambulatory care

National Ambulatory Care Reporting System. Here, one row is an emergency department visit — arrival, triage, disposition timing, and whether the patient was admitted.

30,000Records
50Variables
1Row = one ED visit
DAD

Inpatient care

Discharge Abstract Database. Here, one row is an inpatient stay, including the derived length of stay. Question 2 uses the subset linked from a hospitalized NACRS visit.

60,000Records
64Variables
1Row = one stay

The method

How the study is built

Each memo hands off to the next — from constructing the derived variables, through describing the files, to the two models and the summary.

A00Build variablesDerive emergency stay, admission, and length of stay from source fields
A01 · A02Describe filesSummarize the analytic NACRS and DAD files
A03Model hospitalizationLogistic regression for Question 1
A04Link recordsMatch admissions to DAD by PHN and a six-hour window
A05Model length of stayLinear regression for Question 2
A06SummarizeDesign, methods, findings, limitations

The deliverables

Consulting memos A00–A09

Start with A06 for the original study summary, A07 for the adult-asthma matching simulation, A08 for post-matching outcome regression, and A09 for regional GLMM comparisons. Each card opens a rendered report.

A00

Research variable construction

Builds emergency stay, hospitalization, and inpatient length of stay from the source fields, and records each definition.

Open memo
A01

Emergency & ambulatory summary

Descriptive summary of the analytic NACRS file — 30,000 records, 50 variables.

Open memo
A02

Inpatient summary

Descriptive summary of the analytic DAD file — 60,000 records, 64 variables.

Open memo
A03 · Q1

Hospitalization models

Logistic regression of hospitalization on pre-disposition stay and CTAS. Total stay and other covariates sit in the appendix.

Open memo
A04

Emergency-to-inpatient linkage

Links hospitalized NACRS visits to DAD abstracts by PHN and a six-hour window, then compares linked with unlinked visits.

Open memo
A05 · Q2

Inpatient length of stay

Linear regression of inpatient days on emergency stay and CTAS in the linked cohort, with an acute-stay sensitivity analysis.

Open memo
A06 · Summary

Research summary

Study design, data, statistical methods, key findings, and limitations across Memos A00 through A05.

Open memo
A07 · Asthma

Adult asthma, matching & causal simulation

Adults from the shared NACRS cohort, within-hospital propensity-score matching, hospital-clustered admission risks, and known-effect validation.

Open memo
A08 · Outcome models

Post-matching admission risks

Logistic outcome models on A07's fixed pairs, standardized risks, hospital-clustered uncertainty, and repeated-simulation checks against known truth.

Open memo
A09 · Regional GLMM

Asthma admission across hospital regions

Thirty real ED hospital reference names; entirely synthetic patients and results. Hospital random intercepts, case-mix standardized risks, and an asthma-by-region interaction.

Open memo
Repo

Source repository

Public repository, variable dictionary, and the GitHub-safe reporting examples in code_examples/.

Open on GitHub

Supporting reference

The reference behind the design

Project 001 is the project. The Alberta Health Data Atlas is only the reference used to keep the synthetic records realistic — it holds no patient-level values and is not a second project.

Alberta Health Data Atlas cover — 9 datasets, guided learning, responsible access — with a connected map of dataset concepts

Structure, not records.

A Chinese–English guide to nine Alberta administrative datasets and clinical information systems. Project 001 uses it to decide record grain, field families, and linkage before generating the synthetic NACRS and DAD examples — it holds no patient-level values.

9 dataset guides DAD · NACRS · PIN deep dives 中文 / English

For developers

Run the public examples

The working R Markdown and analytic data stay local, so the memos cannot be rebuilt from the GitHub copy alone. What is public are the sanitized, project-relative reporting examples in code_examples/ and the shared variable dictionary.

  • nacrs_summary_example.Rmd and dad_summary_example.Rmd
  • Standalone import, schema-validation, and summary helpers
  • Shared definitions in config/variable_dictionary.csv
  • Reports stop on a missing, unregistered, or out-of-range flag variable
bash · repository root
# install example dependencies
Rscript code_examples/setup_dependencies.R

# render the public example reports
Rscript code_examples/render_all_rmd.R

# place synthetic workbooks first:
# code_examples/example_data/synthetic_nacrs.xlsx
# code_examples/example_data/synthetic_dad.xlsx

Project & client

Fictional public-facing labels

All names and organizations below are fictional. They do not identify real people, clients, employers, or institutions.

Project lead
Miss V
Consulting org
The V Lab
Client
Dr. ABC
Client org
ABC Department

Responsible by design.

All data are randomly generated and entirely synthetic. They contain no real patient records, personal health information, client data, or operational information. Hospital names are real reference labels; patient records, activity levels, and results are simulated and do not describe those hospitals.

The data are for software demonstration, education, and portfolio presentation only. They must not be used for clinical, policy, financial, or operational decision-making.

The Alberta Health Data Atlas is an independent educational resource and is not an official Alberta Health Services, University of Calgary, Government of Alberta, or CIHI publication. It contains no patient-level data and does not copy the official data-dictionary workbooks.