Template phenotype for identifying the status of subject for a specified condition at a certain date
This template phenotype identifies cases of a chronic condition at a specified date in the primary care record using curated SNOMED CT codelists for positive evidence of the condition and, where available, negative evidence such as resolution or explicit absence. Status is assigned from the latest qualifying code (positive = 1, negative = 0), with a default of 0 when no qualifying event exists. Applied across populations, the phenotype supports prevalence estimation, cohort construction, and derivation of a patient-level variable for downstream analysis.
| Parameter | Description |
|---|---|
patient_record |
A single patient's longitudinal record |
status_date |
Date at which the status is to be determined |
positive_codelist |
SNOMED CT codes identifying diagnosis events for the specific condition |
negative_codelist |
SNOMED CT codes indicating absence (including recovery from or remission of) the specific condition (optional) |
A composite codelist composite_codelist is defined as the union of positive_codelist, and negative_codelist.
Let most_recent_status be the most recent event in patient_record with a code from composite_codelist on or before status_date.
If such an event exists:
positive_codelist -> return 1negative_codelist -> return 0Otherwise:
Section will be removed