diff --git a/vignettes/design.Rmd b/vignettes/design.Rmd index ebfd9aa..2ea9248 100644 --- a/vignettes/design.Rmd +++ b/vignettes/design.Rmd @@ -29,8 +29,9 @@ These are the guiding principles for this package: is a data frame, the output is a data frame). 4. Functions have consistent naming based on their action. 5. Functions have limited additional arguments. -6. Casing of input variables (upper or lower case) is agnostic, all - internal variables are lower case, and output variables are lower case. +6. Casing of input variables (upper or lower case) is agnostic, all + internal variables are lower case, and output variables are lower + case. ## Use cases @@ -66,7 +67,7 @@ this package aims to fulfil: This is the list of functionality we aim to have in the osdc package 1. Classify individuals type 1 and type 2 diabetes status and create a - data frame with that information. + data frame with that information and the date of onset of diabetes. 2. Provide helper functions to check and process individual registers for the variables required to enter into the classifier. 3. Provide a list of required variables and registers in order to @@ -92,63 +93,51 @@ might have type 1 diabetes, otherwise classify as type 2 diabetes. Initial **diabetes** classification is defined as the second occurrence of any of the listed inclusion events. Wherever possible, all available data for each event is used, except for the purchases of -glucose-lowering drugs, since data is only available from 1997 onwards. -Inclusion criteria are: +glucose-lowering drugs, since the data on obstetric diagnoses necessary +to censor glucose-lowering drug purchases is only complete from 1997 +onwards. Inclusion criteria are: -1. HbA1c measurement of ≥48 mmol/mol. -2. Hospital diagnosis of diabetes. +1. HbA1c measurements of ≥48 mmol/mol. +2. Hospital diagnoses of diabetes. 3. Diabetes-specific services received at podiatrist. 4. Purchase of glucose-lowering drugs. Exclusions are: -1. HbA1c: - - Taken during pregnancies, as that could be a potential +1. HbA1c samples: + - Samples taken during pregnancies, as that could be a potential gestational diabetes mellitus. -2. Drugs: - - Brand drugs for weight loss, e.g. *Saxenda.*. +2. Glucose-lowering drugs: + - Brand drugs for weight loss, e.g. *Saxenda*. - Purchases during pregnancies, as that is a potential treatment for gestational diabetes mellitus. - Metformin for women below age 40, as that could be a treatment for polycystic ovary syndrome. -### Classifying type 2 diabetes - -The inclusion criteria after being classified with non-specific diabetes -are any of: - -- Any purchases of non-insulin glucose-lowering drugs. -- A hospital diagnosis of type 2 diabetes as the most recent - type-specific diabetes diagnosis. - -The exclusion criteria are: +### Classifying type 1 diabetes -- Women that have purchased only metformin and have any diagnoses of - polycystic ovarian syndrome or have purchases of clomifene or - combination drugs containing antiandrogens and oestrogens. -- Only one recorded inclusion event. -- No recorded inclusion events in the last 10 years prior to the most - recent date available for the individual (index date). +Diabetes type is classified as either T1D or T2D based on patterns of +purchases of insulins (including analogues) and hospital primary +diagnoses of T1D and T2D. -### Classifying type 1 diabetes +Classification as T1D requires an individual to fulfil either of the +following criteria: -The inclusion criteria after being classified with non-specific diabetes -are any of: +a. Must have purchased only insulins and never any other type of GLD, + and have at least one diagnosis of T1D +b. Must have a majority of T1D diagnoses from endocrinological + departments (or from other medical departments, in the absence of + contacts to endocrinological departments), and a purchase of insulin + within 180 days after onset of diabetes, with insulin contributing + at least two thirds of all defined daily doses of GLD purchased. -- Any purchases of insulin drugs. -- A hospital diagnosis of type 1 diabetes as the most recent - type-specific diabetes diagnosis. +In populations generated on a fixed index date (such as the +cross-sectional studies associated with this dissertation), individuals +classified as T1D cases must have purchased insulins in the last year +prior to the index date. -The exclusion criteria are: +### Classifying type 2 diabetes -- Women with any diagnoses of gestational diabetes mellitus, who have - purchased glucose-lowering drugs only in the period from 280 days - prior to their first diagnosis of gestational diabetes mellitus - until 280 days after their last diagnosis. -- No purchases of glucose-lowering drugs or only one purchase and no - hospital records of type 1 diabetes. -- No insulin drug purchases in the last 10 years prior to the index - date. +Individuals not classified as T1D cases are classified as T2D cases. ## References -