Inferring Chronic Treatment Onset from ePrescription Data: A Renewal Process Approach

This paper proposes a probabilistic framework that models outpatient ePrescription dynamics as a renewal process with change-point detection to infer chronic treatment onset more accurately than rule-based methods, particularly in the presence of left-censored diagnosis data.

Pavlin G. Poličar, Dalibor Stanimirović, Blaž Zupan

Published 2026-03-02
📖 4 min read☕ Coffee break read

Imagine you are trying to figure out exactly when a person started having a chronic health problem, like high blood pressure or diabetes. You have access to their medical records, but there's a big catch: the records are messy and incomplete.

In many countries, including Slovenia (where this study took place), doctors started using digital systems for diagnoses only recently. Before that, records were on paper, scattered, or never digitized. So, if you look at the "diagnosis" date in the computer, it might just be the day the doctor finally typed it in, not the day the patient actually got sick. It's like trying to guess when a movie started by looking at the timestamp on the DVD case you bought three years later.

The Problem with "Diagnosis" Dates
The researchers found that relying on diagnosis dates is like trying to find a needle in a haystack that's been moved around. Sometimes the date is wrong, sometimes it's missing, and sometimes it's just a typo. For example, they found cases where people were labeled as having two types of diabetes at the same time, which is extremely rare in real life but common in the messy data.

The Solution: The "Prescription Rhythm"
Instead of looking at the diagnosis, the researchers decided to listen to the patient's prescription rhythm.

Think of a patient's medication history like a music track:

  • Sporadic (Random) Music: At first, a patient might get a prescription here and there. Maybe they have a cold, or they are trying a new vitamin. These are random, one-off notes. In math terms, this is a "Poisson process"—like raindrops hitting a roof randomly.
  • Sustained (Rhythmic) Music: Then, the patient gets sick with a chronic condition. Now, they need to refill the same medicine every 3 months or every year, like clockwork. This is a steady beat, a drum loop. In math terms, this is a "Weibull renewal process."

The researchers built a smart computer program that acts like a music producer. It listens to the patient's prescription history and tries to find the exact moment the music switched from "random raindrops" to a "steady drum beat." That moment is the onset of the chronic treatment.

How the "Smart Producer" Works

  1. The Baseline: The program knows what "random" looks like. If a patient gets a pill once a year, that's noise.
  2. The Switch: The program watches for a change. When a patient starts getting the same pill regularly (e.g., every 90 days), the program says, "Aha! The rhythm has changed. This person has likely started a long-term treatment."
  3. The Filter: The program is very strict. It won't declare a chronic condition just because someone got one pill. It waits until it sees a clear, repeating pattern. This prevents the computer from making up false stories about when a disease started.

Why This is Better
The researchers tested their "Smart Producer" against a simple, dumb rule: "If the doctor writes 'chronic' on the prescription, assume the disease started today."

  • The Dumb Rule: It often said the disease started years before the patient even existed in the digital system (because the system was just being set up). It was like a smoke detector that goes off because someone burned toast.
  • The Smart Producer: It figured out the start date much more accurately. For a disease like COVID-19 (which didn't exist before 2020), the dumb rule said people got it in 2016. The Smart Producer correctly said, "Nope, no one was getting these specific regular prescriptions before 2020."

The Catch (The "Signal" Problem)
The study also found a limitation. This method works great for diseases where people take pills every single day or every month (like heart disease or diabetes). It's like trying to hear a steady drum beat—it's easy to spot.

However, for diseases where people only take medicine occasionally (like an allergy that flares up once a year), the "beat" is too quiet. The computer can't hear the rhythm, so it can't tell when the treatment started. The more prescriptions a patient has, the clearer the signal, and the better the computer works.

The Big Picture
In short, this paper teaches us that how we take medicine tells us more about when we got sick than the doctor's notes do. By treating prescription data like a musical rhythm and using math to find the beat, we can reconstruct a patient's health history much more accurately, even when the official records are missing or wrong. It's a new way to listen to the story of a patient's life, one pill at a time.

Get papers like this in your inbox

Personalized daily or weekly digests matching your interests. Gists or technical summaries, in your language.

Try Digest →