The purpose of this memo is to build the NACRS and DAD variables required for the Project 001 questions, and to record how each one is defined. These variables are calculated from source fields and are not kept in the source workbooks.
The two questions use the constructed variables as follows:
ctas_level, kept in the NACRS source file) and
pre-disposition stay in minutes (pre_disposition_los_min)
are examined in relation to hospitalization
(admitted_flag). Total emergency stay
(los_min) includes time after the disposition decision, so
Memo A03 reports it only as an appendix comparison.
los_min) are examined in relation to inpatient length of
stay (los_days). acute_los_days removes
alternate-level-of-care days. Memo A05 uses it only as a sensitivity
outcome.
The memo is organized as follows:
Data directory: data
| Dataset | File | Source rows | Source columns | Analytic columns |
|---|---|---|---|---|
| NACRS | pseudo_NACRS.xlsx | 30000 | 39 | 50 |
| DAD | pseudo_DAD.xlsx | 60000 | 60 | 64 |
Analytic copies, including the derived columns, are written to
data/analytic_nacrs.rds and
data/analytic_dad.rds.
patient_id
visit_id
facility_id
health_zone
sex
age
postal_fsa
arrival_datetime
arrival_mode
ctas_level
chief_complaint
main_diagnosis_icd10
secondary_diagnosis_1
secondary_diagnosis_2
intervention_1
intervention_2
consult_service
injury_flag
mental_health_flag
pain_score
triage_wait_min
physician_wait_min
disposition
revisit_72h_flag
discharge_datetime
disposition_decision_datetime
hospital_id
hospital_region
patient_residence
smoking
obesity
cardiometabolic_history
asthma_history
prior_ed_visits
ed_arrival_severity
dataset_version
hospital_name
hospital_city
ed_service_listed
dad_record_id
patient_id
chart_number
facility_id
health_zone
sex
age_at_admission
postal_fsa
admission_datetime
discharge_datetime
admission_category
admission_source
most_responsible_diagnosis
comorbidity_1
comorbidity_2
comorbidity_3
comorbidity_4
comorbidity_5
intervention_1
intervention_2
intervention_3
intervention_4
case_mix_group
mcc_flag
cci_score
resource_intensity_weight
alc_days
icu_flag
icu_hours
surgery_flag
transfusion_flag
readmission_30d_flag
discharge_disposition
discharge_destination
attending_service
most_responsible_provider
entry_code
transfer_from_facility
transfer_to_facility
newborn_flag
palliative_flag
abstract_status
data_quality_flag
source_system
link_patient_id_quality
admission_date_quality
created_datetime
hospital_id
hospital_region
patient_residence
smoking
obesity
cardiometabolic_history
asthma_history
prior_ed_visits
ed_arrival_severity
dataset_version
hospital_name
hospital_city
ed_service_listed
revisit_72h_flag and readmission_30d_flag
remain in the source files because they cannot be rebuilt from the
visits in these two workbooks. ctas_level and
alc_days also remain in the source files.
A field is derived when its value is determined by one or more source
fields. Missing inputs produce missing values. Binary indicators are
1 or 0, not character labels.
| Dataset | Variable | Study role | Rule |
|---|---|---|---|
| NACRS | los_min | Question 2 exposure; question 1 appendix | Rounded minutes from arrival_datetime to discharge_datetime. |
| NACRS | pre_disposition_los_min | Question 1 exposure | Rounded minutes from arrival_datetime to disposition_decision_datetime. |
| NACRS | post_disposition_los_min | Part of total stay, not an exposure | Rounded minutes from disposition_decision_datetime to discharge_datetime. |
| NACRS | admitted_flag | Outcome: hospitalized | 1 when disposition is Admitted inpatient; otherwise 0. |
| NACRS | lwbs_flag | Disposition indicator | 1 when disposition is Left without being seen; otherwise 0. |
| NACRS | ambulance_flag | Arrival indicator | 1 when arrival_mode is Ground ambulance; otherwise 0. |
| NACRS | timing_quality_flag | Timing quality | Triage wait greater than physician wait; else physician wait greater than los_min; else Pass. |
| NACRS | fiscal_year | Reporting period | Alberta fiscal year from arrival_datetime. The year starts on April 1. |
| DAD | los_days | Outcome: inpatient stay | Calendar days from the admission date to the discharge date, in UTC. |
| DAD | acute_los_days | Sensitivity outcome: acute stay | los_days minus alc_days, floored at 0. alc_days stays in the source file. |
| DAD | death_flag | Disposition indicator | 1 when discharge_disposition is Died; otherwise 0. |
| DAD | fiscal_year | Reporting period | Alberta fiscal year from admission_datetime. The year starts on April 1. |
| NACRS | age10 | Centered age for A07-A09 | (age - 50)/10; age in years. |
| NACRS | season | Calendar baseline covariate | Season from arrival month: Dec-Feb Winter, Mar-May Spring, Jun-Aug Summer, Sep-Nov Autumn. |
| NACRS | asthma_visit | Adult-asthma exposure/cohort indicator | 1 if main_diagnosis_icd10 begins with J45; 0 otherwise; missing if the main diagnosis is missing. Adult restriction is applied separately. |
los_min is total emergency stay, the rounded number of
minutes from arrival_datetime to
discharge_datetime. It is the stay measure used for the
inpatient length-of-stay question. The hospitalization question uses
pre_disposition_los_min instead, because total stay
includes minutes after the disposition decision. The pre-disposition and
post-disposition segments are split at
disposition_decision_datetime, and together they sum to the
total stay.
| Variable | Mean (SD) | Median | Min-Max | P1 | P5 | P10 | Q1 | Q2 | Q3 | P90 | P95 | P99 | Missing | N | Non-missing | Missing % |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| los_min | 213.87 (88.57) | 196.00 | 49.00 - 1054.00 | 83.00 | 105.00 | 120.00 | 152.00 | 196.00 | 257.00 | 329.00 | 380.00 | 503.00 | 0 | 30000 | 30000 | 0 |
| pre_disposition_los_min | 187.37 (86.05) | 170.00 | 40.00 - 1014.00 | 63.00 | 84.00 | 97.00 | 127.00 | 170.00 | 228.00 | 299.00 | 350.00 | 471.00 | 0 | 30000 | 30000 | 0 |
| post_disposition_los_min | 26.50 (15.19) | 22.00 | 4.00 - 173.00 | 8.00 | 11.00 | 13.00 | 16.00 | 22.00 | 32.00 | 46.00 | 57.00 | 83.00 | 0 | 30000 | 30000 | 0 |
timing_quality_flag classifies each visit using the
source wait times and the constructed los_min. The first
matching rule is used: triage wait greater than physician wait;
otherwise physician wait greater than emergency stay; otherwise
Pass. fiscal_year is the Alberta fiscal year
of arrival_datetime. Each fiscal year runs from April
through March and is written as 2025-26.
| timing_quality_flag | Visits |
|---|---|
| Pass | 29395 |
| NA | 605 |
| fiscal_year | Visits |
|---|---|
| 2024-25 | 7580 |
| 2025-26 | 22420 |
los_days is the inpatient length of stay used for the
second question. It is the number of calendar days from the UTC
admission date to the UTC discharge date. alc_days is not
recalculated; it remains in the DAD source file.
acute_los_days is los_days minus
alc_days, floored at zero. Memo A05 uses that acute stay
only as a sensitivity outcome. death_flag is 1
when discharge_disposition is Died.
fiscal_year uses the admission datetime and the same
April–March rule as NACRS.
| Variable | Mean (SD) | Median | Min-Max | P1 | P5 | P10 | Q1 | Q2 | Q3 | P90 | P95 | P99 | Missing | N | Non-missing | Missing % |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| los_days | 4.15 (2.23) | 4.00 | 1.00 - 33.00 | 1.00 | 2.00 | 2.00 | 3.00 | 4.00 | 5.00 | 7.00 | 8.00 | 12.00 | 0 | 60000 | 60000 | 0 |
| acute_los_days | 3.95 (2.28) | 3.00 | 1.00 - 32.00 | 1.00 | 1.00 | 2.00 | 2.00 | 3.00 | 5.00 | 7.00 | 8.00 | 11.00 | 0 | 60000 | 60000 | 0 |
| alc_days | 0.20 (0.62) | 0.00 | 0.00 - 3.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 1.00 | 2.00 | 3.00 | 0 | 60000 | 60000 | 0 |
| discharge_disposition | 0 | 1 |
|---|---|---|
| Died | 0 | 883 |
| Home | 46795 | 0 |
| Home with support | 9637 | 0 |
| Rehabilitation | 2685 | 0 |
| fiscal_year | Abstracts |
|---|---|
| 2024-25 | 14995 |
| 2025-26 | 45005 |
| Check | Evaluated | Violations | Status |
|---|---|---|---|
| NACRS pre + post stay equals los_min | 30000 | 0 | Pass |
| NACRS los_min matches arrival to discharge | 30000 | 0 | Pass |
| admitted_flag matches Admitted inpatient | 30000 | 0 | Pass |
| ambulance_flag matches Ground ambulance | 30000 | 0 | Pass |
| acute_los_days equals max(los_days - alc_days, 0) | 60000 | 0 | Pass |
| death_flag matches Died | 60000 | 0 | Pass |
| DAD los_days is non-negative | 60000 | 0 | Pass |