From 1f310201d3c2f85192ad2f51d5683366b01f1d96 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Fri, 8 Mar 2024 15:27:49 +0100 Subject: [PATCH 1/5] docs: copied and revised textual algorithm from thesis --- vignettes/design.Rmd | 75 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/vignettes/design.Rmd b/vignettes/design.Rmd index f1c7f6d..f8ee92b 100644 --- a/vignettes/design.Rmd +++ b/vignettes/design.Rmd @@ -72,3 +72,78 @@ This is the list of functionality we aim to have in the osdc package 5. Provide a common and easily accessible standard for determining diabetes status within the context of research using Danish registers. + +## Classifier algorithm + +A more complete description of the classifier is found in Anders Aasted +Isaksen's [PhD Thesis](https://aastedet.github.io/dissertation/) as well +as the validation paper [@Isaksen2023]. The description below is a brief +and concise version of those documents. + +The algorithm for classifying individuals with diabetes is described +below. The overall output of this algorithm is first to classify those +with diabetes, then to further classify and check if the individuals +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: + +1. HbA1c measurement of ≥48 mmol/mol. +2. Hospital diagnosis 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 + gestational diabetes mellitus. +2. 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: + +- 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). + +### Classifying type 1 diabetes + +The inclusion criteria after being classified with non-specific diabetes +are any of: + +- Any purchases of insulin drugs. +- A hospital diagnosis of type 1 diabetes as the most recent + type-specific diabetes diagnosis. + +The exclusion criteria are: + +- 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. + +## References From 107c5c338881f8c1f1cbf542102a9129ce63cb7f Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Fri, 8 Mar 2024 15:28:24 +0100 Subject: [PATCH 2/5] docs: add bib and csl files --- vignettes/design.Rmd | 3 + vignettes/references.bib | 14 ++ vignettes/vancouver.csl | 351 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 368 insertions(+) create mode 100644 vignettes/references.bib create mode 100644 vignettes/vancouver.csl diff --git a/vignettes/design.Rmd b/vignettes/design.Rmd index f8ee92b..1c51473 100644 --- a/vignettes/design.Rmd +++ b/vignettes/design.Rmd @@ -1,6 +1,8 @@ --- title: "Design" output: rmarkdown::html_vignette +bibliography: references.bib +csl: vancouver.csl vignette: > %\VignetteIndexEntry{design} %\VignetteEngine{knitr::rmarkdown} @@ -147,3 +149,4 @@ The exclusion criteria are: date. ## References + diff --git a/vignettes/references.bib b/vignettes/references.bib new file mode 100644 index 0000000..0829492 --- /dev/null +++ b/vignettes/references.bib @@ -0,0 +1,14 @@ +@Article{Isaksen2023, + author = {Isaksen, Anders Aasted and Sandbæk, Annelli and Bjerg, Lasse}, + journal = {Clinical Epidemiology}, + title = {Validation of Register-Based Diabetes Classifiers in Danish Data}, + year = {2023}, + issn = {1179-1349}, + month = may, + pages = {569--581}, + volume = {Volume 15}, + doi = {10.2147/clep.s407019}, + publisher = {Informa UK Limited}, +} + +@Comment{jabref-meta: databaseType:bibtex;} diff --git a/vignettes/vancouver.csl b/vignettes/vancouver.csl new file mode 100644 index 0000000..edbb69b --- /dev/null +++ b/vignettes/vancouver.csl @@ -0,0 +1,351 @@ + + From fe92506b0f4d034508e6e1f7b2fb8137c397d39c Mon Sep 17 00:00:00 2001 From: Luke W Johnston Date: Fri, 8 Mar 2024 15:35:41 +0100 Subject: [PATCH 3/5] docs: match title and entry --- vignettes/design.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/design.Rmd b/vignettes/design.Rmd index 1c51473..6a6ad55 100644 --- a/vignettes/design.Rmd +++ b/vignettes/design.Rmd @@ -4,7 +4,7 @@ output: rmarkdown::html_vignette bibliography: references.bib csl: vancouver.csl vignette: > - %\VignetteIndexEntry{design} + %\VignetteIndexEntry{Design} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- From 52799c67ea1323c66f14c244c9694367d91c91d2 Mon Sep 17 00:00:00 2001 From: Luke W Johnston Date: Fri, 8 Mar 2024 15:54:43 +0100 Subject: [PATCH 4/5] docs: add principle on lowercasing of variables --- vignettes/design.Rmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vignettes/design.Rmd b/vignettes/design.Rmd index 6a6ad55..ebfd9aa 100644 --- a/vignettes/design.Rmd +++ b/vignettes/design.Rmd @@ -29,6 +29,8 @@ 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. ## Use cases From e01c0026befa3960474494862cd9679a7b178d7f Mon Sep 17 00:00:00 2001 From: Anders Aasted Isaksen Date: Fri, 15 Mar 2024 14:13:06 +0100 Subject: [PATCH 5/5] description of algorithm now describes osdc, not register of selected chronic diseases-algorithms. --- vignettes/design.Rmd | 75 +++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 43 deletions(-) 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 -