Template phenotype for identifying new cases of a specified condition.
This template phenotype identifies new cases of a specified condition from longitudinal primary care records using a SNOMED CT codelist. Within the observation window, each qualifying event is evaluated against a clearance interval; an event is counted as a new case only if no earlier qualifying event occurred in the preceding interval. The phenotype returns a list of incident events per patient, allowing identification of either single cases or multiple episodes over longer observation windows. Applied across populations, it supports incidence estimation, cohort construction, and derivation of a patient-level variable for downstream analysis.
| Parameter | Description |
|---|---|
patient_record |
A single patient's longitudinal record |
observation_window |
Timeframe within which new cases are to be identified |
condition_codelist |
SNOMED CT codes identifying diagnosis events for the specific condition |
interval |
Minimum number of days between two diagnosis events for the latter to indicate a new case |
Let extended_observation_window be observation_window extended to include the preceding interval days
Let candidate_events be all events in patient_record with codes from condition_codelist within extended_observation_window.
For each event in candidate_events:
The event is considered to define a new case if:
candidate_events in the interval days before this event.observation_windowReturn the list of the time-stamped events of all events that define a new case.
Section will be removed