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 f1c7f6de..f8ee92bc 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 f8ee92bc..1c514732 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 00000000..08294926 --- /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 00000000..edbb69b4 --- /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 1c514732..6a6ad552 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 6a6ad552..ebfd9aa4 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 ae0f8151d0e654d649e9a395499afc59c1449744 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Fri, 15 Mar 2024 11:12:28 +0100 Subject: [PATCH 5/5] docs: include list of required variables in design doc. Closes #52 --- vignettes/design.Rmd | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/vignettes/design.Rmd b/vignettes/design.Rmd index ebfd9aa4..03e0f4c5 100644 --- a/vignettes/design.Rmd +++ b/vignettes/design.Rmd @@ -14,6 +14,7 @@ knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) +library(dplyr) ``` ## Principles @@ -29,8 +30,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 @@ -150,5 +152,16 @@ The exclusion criteria are: - No insulin drug purchases in the last 10 years prior to the index date. -## References +## Data required from registers + +The following is a list of the variables required from specific +registers in order for the package to classify diabetes status: +```{r, echo=FALSE} +variable_description |> + mutate(Register = paste0(register_name, "(", register_abbrev, ")")) |> + select(Register, Variable = variable_name) |> + knitr::kable() +``` + +## References