General description
A more complete description of the classifier is found in Anders Aasted Isaksen’s PhD Thesis as well as the validation paper (1). The description of the algorithm below is a brief and concise version of those documents.
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.
The 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 the data on obstetric diagnoses necessary to censor glucose-lowering drug purchases is only complete from 1997 onwards. Inclusion criteria are:
- HbA1c measurements of ≥48 mmol/mol.
- Hospital diagnoses of diabetes.
- Diabetes-specific services received at podiatrist.
- Purchase of glucose-lowering drugs.
Exclusions are:
- HbA1c samples:
- Samples taken during pregnancies, as that could be a potential gestational diabetes mellitus.
- 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 1 diabetes
Diabetes type is classified as either T1D or T2D based on patterns of purchases of insulin drugs (including analogues) and hospital primary diagnoses of T1D and T2D.
Classification as T1D requires an individual to fulfill either of the following criteria:
- Must have purchased only insulin drugs and never any other type of glucose-lowering drugs, and have at least one diagnosis of T1D
- 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 glucose-lowering drugs purchased.
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 insulin drugs in the last year prior to the index date.
Detailed and technical description
Below are the technical, exact implementation of the above description. These are the logical conditions and exact variables and registers used that results in the classification of diabetes status and types. They are shown in the form of tables for each register, as well as for each
lpr_diag
register | title | logic | comments |
---|---|---|---|
lpr_diag | Relevant LPR2 diagnoses codes | c_diag =~ ‘^(DO0[0-6]|DO8[0-4]|DZ3[37]|DE1[0-4]|249|250)’ AND (c_diagtype == ‘A’ OR c_diagtype == ‘B’) | ‘A’ c_diagtype means primary
diagnosis. |
lpr_adm
register | title | logic | comments |
---|---|---|---|
lpr_adm | LPR2 endocrinology department | na_if(c_spec, NOT (c_spec %in% 8:30)) == 8 |
TRUE when the department is endocrinology,
FALSE when it is other medical departments, and missing is
all other cases. |
diagnoser
register | title | logic | comments |
---|---|---|---|
diagnoser | Relevant LPR3 diagnoses codes | diagnosekode =~ ‘^(DO0[0-6]|DO8[0-4]|DZ3[37]|DE1[0-4])’ AND (diagnosetype == ‘A’ OR diagnosetype == ‘B’) AND (senere_afkraeftet == ‘Nej’) |
A diagnosekode means primary
diagnosis and senere_afkraeftet means diagnosis was later
retracted. |
kontakter
register | title | logic | comments |
---|---|---|---|
kontakter | LPR3 endocrinology department | na_if(hovedspeciale_ans, NOT (hovedspeciale_ans %in% c(‘medicinsk endokrinologi’, ‘blandet medicin og kirurgi’, ‘intern medicin’, ‘geriatri’, ‘hepatologi’, ‘hæmatologi’, ‘infektionsmedicin’, ‘kardiologi’, ‘medicinsk allergologi’, ‘medicinsk gastroenterologi’, ‘medicinsk lungesygdomme’, ‘nefrologi’, ‘reumatologi’, ‘palliativ medicin’, ‘akut medicin’, ‘dermato-venerologi’, ‘neurologi’, ‘onkologi’, ‘fysiurgi’, ‘tropemedicin’))) == ‘medicinsk endokrinologi’ |
TRUE when the department is endocrinology,
FALSE when it is other medical departments, and missing in
all other cases. |
lab_forsker
register | title | logic | comments |
---|---|---|---|
lab_forsker | HbA1c inclusion | (analysiscode == ‘NPU27300’ AND value >= 48) OR (analysiscode == ‘NPU03835’ AND value >= 6.5) | Is the IFCC units for NPU27300 and DCCT units for NPU03835. |
ssyi
and sssy
for podiatrist services
register | title | logic | comments |
---|---|---|---|
NA | Podiatrist services | speciale =~ ‘^54’ AND barnmak != 0 |
barnmak means the services were provided
to a child of the individual. |
lmdb
for glucose lowering drugs
register | title | logic | comments |
---|---|---|---|
lmdb | Glucose-lowering drug inclusion | atc =~ ‘^A10’ AND NOT (atc =~ ‘^(A10BJ|A10BK01|A10BK03)’) | Do not keep GLP-RAs or dapagliflozin/empagliflozin drugs. |