RSC repository banner
PROTOTYPE SITE UNDER CONSTRUCTION

RSC Phenotype RSC-PH1

Phenotypes Help

New cases of condition [T]

Brief description

Template phenotype for identifying new cases of a specified condition.

Overview

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.

Input

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

Output

  • Description: A list of time-stamped events for the clinical condition of interest that are considered to indicate new cases within the observation window.

Pseudocode

  • 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:

      • There are no prior events from candidate_events in the interval days before this event.
      • and
      • The event is within observation_window
  • Return the list of the time-stamped events of all events that define a new case.

Notes on use

  • Applying this phenotype to primary care records can produce:
    • case counts and incidence
    • patient-level variables (for example, patient has at least one case in list)
    • cohorts (for example, all patients with at least one case)

Template note

Section will be removed