Electronic Health Records (EHRs) provide valuable source of information detailing patient encounters over time and representing patient trajectories. By leveraging machine learning (ML) techniques, researchers can develop models to support healthcare professionals in decision-making for better patient care. However, EHRs exhibit a complex temporal structure, with diverse entities such as diagnostic codes and medications posing challenges when representing patient trajectory over time. Several methods are used in literature to represent EHRs as time-series data. Some represent patient trajectory as an irregular time series with the sequence of patient encounters. Others use fixed time intervals and aggregate patient encounters within a particular time window. This paper examines the optimization of temporal granularity by exploring two aggregation methods: the established time-based aggregation and a newly introduced similarity-based approach, which aggregates consecutive encounters with a high overlap of clinical codes. Additionally, this study utilizes graph and recurrent neural network models to represent patient trajectories and assess how these aggregation techniques affect model performance. Furthermore, we propose a hybrid ML model combining graph neural networks with a recurrent model. We evaluated model performance using two clinical prediction tasks, the first is to predict the top-k diagnoses codes for the last patient encounter, while the second is to predict top k codes at every future encounter. Results show that time-based aggregation enhances performance of recurrent models, while similarity-based aggregation allows hybrid and graph neural models to reach higher performance than recurrent model. © 2025 The Author(s). Published by Elsevier Inc. on behalf of American College of Emergency Physicians.
This research is included in the CAISR Health research profile.