The case definition for AF has three categories:
1. Historical: first recorded AF code indicates monitoring of an existing condition, or reference to a previous AF diagnosis.
2. Diagnosed: first record is a diagnosis code for AF; preference given to the earliest dated record rather than diagnosis source (i.e. no preference for primary versus secondary care).
3. Inferred: no diagnosis code is present, but the patient record includes a warfarin prescription in the absence of prior DVT or PE, or a digoxin prescription in the absence of HF.
The phenotype algorithm incorporates these definitions in a hierarchical, mutually exclusive manner (see FIGURE). If the earliest recorded AF codes relate to a historical diagnosis or monitoring, the patient is in category 1 which precludes inclusion in other categories. If these codes are absent, then the presence of a coded diagnosis from primary or secondary care places a patient in category 2. Finally, in the absence of a coded diagnosis, a patient may be allocated to category 3, depending on the combination of prescriptions and diagnoses in their record. Otherwise a participant is treated as undiagnosed.