Abstract
INTRODUCTION: Studies of epidemiology and health system use that use linked admitted patient data benefit from understanding the patient journey, particularly when it spans multiple records within or across multiple datasets. OBJECTIVES: To develop a flexible method for grouping together administrative admitted patient records into periods of hospital care that follow patients from admission to discharge. METHODS: We describe a flexible and generalisable graph theoretic algorithm for grouping patient records into periods of hospital care. The algorithm can account for a variety of complex hospitalisation patterns involving multiple transfers and overlapping records. An R package, journeyer, that implements this algorithm, is included in the Supplementary Material. RESULTS: This algorithm was applied to the New South Wales Admitted Patient Data Collection, finding 21,405,451 periods of hospital care from 22,794,746 hospital records. The parameters and decisions required for this algorithm were assessed and found appropriate for this dataset, but we offer some advice for generalisation to other datasets. CONCLUSIONS: Our method assists in preparing data for epidemiological research in New South Wales and can be generalised to inpatient data in other jurisdictions. The method can be extended to include ambulance and emergency department data.