MemoA04
ClientDr. ABC
Client OrganizationABC Department
Version2.0
StatusDraft
ClassificationInternal use only
Note: Data preparation is completed in Memo A00. This memo links hospitalized emergency visits to inpatient abstracts.

1 Overview

1.1 Introduction

The purpose of this memo is to link hospitalized emergency visits to the inpatient abstract for the same stay. The cohort consists of all NACRS visits with admitted_flag equal to 1. Memo A00 sets that flag when disposition is Admitted inpatient.

Linkage is visit-level, not person-level. A person with two admitted emergency visits can match two different DAD abstracts. The personal health number (PHN) is matched first, and the time window is then applied only to abstracts that share that number. A DAD abstract with a different personal health number is never accepted, even if the times are close.

Data preparation is completed in Memo A00. This memo reads analytic_nacrs.rds and analytic_dad.rds.

2 Linkage rule

In these files the personal health number is stored as patient_id. There is no separate PHN column. Let visit \(i\) be a hospitalized NACRS visit and abstract \(j\) a DAD record. The visit links to the abstract only when both conditions hold:

\[\mathrm{PHN}_i = \mathrm{PHN}_j\]

\[\left| t_i^{\mathrm{discharge}} - t_j^{\mathrm{admission}} \right| \le 6 \text{ hours}\]

\(t_i^{\mathrm{discharge}}\) is the NACRS discharge_datetime. \(t_j^{\mathrm{admission}}\) is the DAD admission_datetime. The comparison uses the absolute difference, so an admission up to 6 hours before or after the emergency discharge is eligible. A difference of exactly 6 hours is included.

If more than one abstract passes both tests, the abstract with the smallest absolute difference is kept. If two abstracts tie for the smallest difference, the visit is left unlinked and counted as ambiguous. DAD rows with a missing patient_id cannot pass the first test.

2.1 Data

Training data notice: The visits and abstracts are randomly generated synthetic records. Preprocessing is completed in Memo A00.
Analytic files used for linkage
File Records Used in linkage
analytic_nacrs.rds 30000 5,810 hospitalized visits
analytic_dad.rds 60000 59,533 abstracts with a PHN

One row per hospitalized visit is written to data/analytic_linkage.rds. Unlinked visits are kept, with the DAD record ID left missing.

3 Linkage results

3.1 Funnel

The counts below are hospitalized emergency visits. Each step keeps only the visits that passed the previous step.

Linkage funnel for hospitalized emergency visits
Step Visits Share of hospitalized visits
Hospitalized NACRS visits 5810 100.0%
Same PHN on at least one DAD abstract 4922 84.7%
Discharge within 6 hours of that admission 4633 79.7%

3.3 Linked pairs

Description of the linked pairs
Measure Value
Linked visits 4,633
Distinct DAD abstracts 4,633
Same facility 4,633 of 4,633
DAD admission source Emergency Department 4633
Hours, admission minus discharge: minimum 0.17
Hours, admission minus discharge: median 1.07
Hours, admission minus discharge: maximum 2.00

The hours column is DAD admission time minus NACRS discharge time. A positive value means the inpatient admission is after the emergency discharge. Among the linked pairs, the median difference is 1.07 hours, and every difference is within 6.00 hours by construction. 4,633 of the linked pairs are at the same facility.

3.4 Personal health number matches outside the window

Closest same-PHN admission among visits that failed the time-window rule
Measure Value
Visits 289
Closest PHN match, absolute hours: minimum 7.00
Closest PHN match, absolute hours: median 16.00
Closest PHN match, absolute hours: maximum 24.00

These 289 visits do have a DAD abstract with the same personal health number. The closest of those admissions is still more than 6 hours from the emergency discharge. The closest gaps range from 7.00 to 24.00 hours, so these visits are not linked.

3.5 Linked and not linked

Memo A05 uses only the linked visits, which are a subset of all hospitalized visits. The table below compares linked and unlinked visits on CTAS, total emergency stay, and pre-disposition stay. The hospitalization question uses pre-disposition stay. The length-of-stay question uses total emergency stay.

CTAS and emergency stay among hospitalized visits, by linkage
Measure Linked Not linked
Visits 4,633 1,177
Median total emergency stay, minutes 235 239
Median pre-disposition stay, minutes 189 194
CTAS 1 1,443 (31.1%) 347 (29.5%)
CTAS 2 1,488 (32.1%) 393 (33.4%)
CTAS 3 1,110 (24.0%) 290 (24.6%)
CTAS 4 456 (9.8%) 117 (9.9%)
CTAS 5 136 (2.9%) 30 (2.5%)

Any difference in this table means that the length-of-stay results do not automatically extend to the unlinked hospitalized visits. No length of stay is imputed for them.

4 Shared release

This memo uses unified synthetic release 2.0-2026-10-09, built from the same NACRS/DAD source files as A07–A09. Hospital location and patient residence are separate variables. See A00 for definitions and provenance.