Abstract
Patient similarity offers an exciting potential to improve our understanding of treatment patterns. Medication history is a valuable source of information given the clinical considerations taken during the physician’s prescription process. However, available similarity methods do not consider timeliness of event occurrence in the longitudinal care of patients. In this observational cohort study, we propose an event alignment algorithm, MedAl, which uses a dynamic programming approach for pairwise alignment of medication histories. To test our algorithm, we obtained the medication usage from a cohort of patients with pediatric acute-onset neuropsychiatric syndrome (PANS). After calculating a distance metric with MedAl, we compute a hierarchical clustering and explore the most appropriate number of clusters. We identified four clusters in PANS with distinct medication usage histories, driven primarily by penicillin. We foresee that our algorithm could be used to identify clusters in other syndromes treated with multiple medication regimens.
Introduction
Pediatric Acute-onset Neuropsychiatric Syndrome (PANS) is a complex condition characterized by the sudden, dramatic onset of OCD or severe eating restrictions. Because the underlying causes are often inflammatory or autoimmune, treatment typically involves a "polypharmacy" approach including antibiotics, anti-inflammatories, and steroids.
Currently, there is no standard "gold-standard" protocol for PANS, leading clinicians to adjust treatments based on unique patient responses. This creates longitudinal data that is difficult to analyze using traditional methods like Euclidean distance, which often ignore the temporality of treatment—the specific timing of drug initiation, duration, and gaps between doses. This study introduces MedAl to group similar patients based on the temporal flow of their treatment over time.
Methods: The MedAl Algorithm
The researchers developed MedAl (Medication Alignment), an algorithm inspired by bioinformatics tools used for DNA and protein sequence alignment. The pipeline involves several key steps:
- Encoding: Medication histories are transformed into binary vectors representing daily intake.
- Alignment: Using a modified dynamic programming approach, the algorithm aligns these vectors for pairs of patients. Unlike genomic alignment, MedAl only allows insertions, reflecting the clinical reality that medical history cannot be deleted, only shifted in timing.
- Scoring: The algorithm uses 16 possible combinations of usage patterns to calculate a weighted "edit distance" between patients.
- Clustering: These distances are used to group patients via Hierarchical and K-means clustering.
Study Population
The study utilized a retrospective cohort from the Stanford PANS clinic. Starting with an initial pool of 305 patients, the authors applied strict eligibility criteria to ensure high-quality data and reduce recall bias. The final cohort consisted of 43 pre-pubertal, new-onset patients who had at least three clinic visits and a first appointment within four months of symptom onset.
Key Results and Insights
The MedAl algorithm successfully identified four distinct clusters of PANS patients characterized by their medication usage histories:
- Treatment as a Phenotype Proxy: In syndromes where biological markers are elusive, clinician prescription behavior serves as a high-fidelity signal of the patient's state. For instance, the use of high-dose IV steroids reliably indicates high disease severity.
- Temporal Significance: The algorithm explicitly considers gaps in prescription patterns. A "holiday" from a medication is often a deliberate clinical decision, and MedAl treats these gaps as part of the patient's similarity profile.
- Cluster Characteristics: The identified clusters were driven primarily by penicillin usage. Some groups required intensive interventions like high-dose IV steroids and showed significant improvement in psychometric scores (Global Impairment Scale) over two years, while others were managed with shorter courses of NSAIDs.
- Statistical Validation: Statistical analysis confirmed significant heterogeneity in recovery trends between these clusters, proving that the algorithm-defined groups reflected real-world clinical outcomes.
Discussion and Future Work
While the study demonstrates the power of treating clinical events as sequences, it has limitations. The cohort size was relatively small (N=43), and the focus was primarily on non-psychiatric medications. Future iterations of MedAl could incorporate psychiatric drugs and behavioral therapies to provide a more holistic view of care.
Ultimately, MedAl serves as a tool for hypothesis generation. It identifies patterns in how clinicians treat patients, providing a foundation for future research to determine which specific treatment sequences are most effective for different patient phenotypes.
Summary updated