A function that takes the output of create_diabetes_cohort() and filters it to only individuals with prevalent diabetes: individuals with diabetes diagnosed prior to a specified index date who are also alive one this specified index date.
Also re-classifies diabetes type depending on insulin purchases in the year prior to the index date (very few individuals - we could potentially discuss with stakeholders whether to omit this in the future).
A function that takes the output of create_diabetes_cohort() and filters it to only individuals with prevalent diabetes: individuals with diabetes diagnosed prior to a specified index date who are also alive one this specified index date.
Also re-classifies diabetes type depending on insulin purchases in the year prior to the index date (very few individuals - we could potentially discuss with stakeholders whether to omit this in the future).