Perform multistage deterministic linkages and apply case definitions to datasets. Records are linked by different matching criteria in a specified order of certainty. The linkage process handles missing data and conflicting matches using this same order. Track events (e.g. sample collection) and period (e.g. hospital admission) to episodes. This process permits several options such as episode lengths and recurrence. Record linkage and episode tracking assign unique group identifiers to matched records. Duplicate events or records can then be identified or sub-analyses performed within each group.